diff options
Diffstat (limited to 'sysdeps/mach/hurd')
-rw-r--r-- | sysdeps/mach/hurd/getdtsz.c | 7 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/sigreturn.c | 10 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/trampoline.c | 18 |
3 files changed, 11 insertions, 24 deletions
diff --git a/sysdeps/mach/hurd/getdtsz.c b/sysdeps/mach/hurd/getdtsz.c index 3e6385f..1befd48 100644 --- a/sysdeps/mach/hurd/getdtsz.c +++ b/sysdeps/mach/hurd/getdtsz.c @@ -21,6 +21,7 @@ Cambridge, MA 02139, USA. */ #include <unistd.h> #include <hurd.h> #include <hurd/fd.h> +#include <hurd/resource.h> /* Return the maximum number of file descriptors the current process could possibly have (until it raises the resource limit). */ @@ -29,9 +30,9 @@ DEFUN_VOID(__getdtablesize) { int size; HURD_CRITICAL_BEGIN; - __mutex_lock (&_hurd_rlimits_lock); - size = _hurd_rlimits[RLIM_NOFILE].rlim_cur; /* XXX RLIM_INFINITY?? */ - __mutex_unlock (&_hurd_rlimits_lock); + __mutex_lock (&_hurd_rlimit_lock); + size = _hurd_rlimits[RLIMIT_NOFILE].rlim_cur; + __mutex_unlock (&_hurd_rlimit_lock); HURD_CRITICAL_END; return size; } diff --git a/sysdeps/mach/hurd/i386/sigreturn.c b/sysdeps/mach/hurd/i386/sigreturn.c index d00fa77..0e5ccfc 100644 --- a/sysdeps/mach/hurd/i386/sigreturn.c +++ b/sysdeps/mach/hurd/i386/sigreturn.c @@ -57,15 +57,13 @@ __sigreturn (struct sigcontext *scp) the signal thread will notice it if it runs another handler, and arrange to have us called over again in the new reality. */ ss->context = scp; - /* Clear the intr_port slot, since we are not in fact doing - an interruptible RPC right now. If SS->intr_port is not null, - the SCP context is doing an interruptible RPC, but the signal - thread will examine us while we are blocked in the sig_post RPC. */ - ss->intr_port = MACH_PORT_NULL; __spin_unlock (&ss->lock); __msg_sig_post (_hurd_msgport, 0, __mach_task_self ()); - /* If a pending signal was handled, sig_post never returned. */ + /* If a pending signal was handled, sig_post never returned. + If it did return, the pending signal didn't run a handler; + proceed as usual. */ __spin_lock (&ss->lock); + ss->context = NULL; } if (scp->sc_onstack) diff --git a/sysdeps/mach/hurd/i386/trampoline.c b/sysdeps/mach/hurd/i386/trampoline.c index 3402181..2a31588 100644 --- a/sysdeps/mach/hurd/i386/trampoline.c +++ b/sysdeps/mach/hurd/i386/trampoline.c @@ -73,23 +73,11 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, sizeof (state->basic)); memcpy (&state->fpu, &ss->context->sc_i386_float_state, sizeof (state->fpu)); - state->set = (1 << i386_THREAD_STATE) | (1 << i386_FLOAT_STATE); - assert (! rpc_wait); - /* The intr_port slot was cleared before sigreturn sent us the - sig_post that made us notice this pending signal, so - _hurd_internal_post_signal wouldn't do interrupt_operation. - After we return, our caller will set SCP->sc_intr_port (in the - new context) from SS->intr_port and clear SS->intr_port. Now - that we are restoring this old context recorded by sigreturn, - we want to restore its intr_port too; so store it in - SS->intr_port now, so it will end up in SCP->sc_intr_port - later. */ - ss->intr_port = ss->context->sc_intr_port; + state->set |= (1 << i386_THREAD_STATE) | (1 << i386_FLOAT_STATE); } - /* If the sigreturn context was bogus, just ignore it. */ - ss->context = NULL; } - else if (! machine_get_basic_state (ss->thread, state)) + + if (! machine_get_basic_state (ss->thread, state)) return NULL; if ((ss->actions[signo].sa_flags & SA_ONSTACK) && |