Handle SIGSTOP more consistently and according to POSIX rules; it can no longer be ignored

This commit is contained in:
Erik van der Kouwe 2009-09-13 12:24:23 +00:00
parent ba83b7663d
commit 3615d93383
2 changed files with 6 additions and 1 deletions

View file

@ -182,7 +182,9 @@ The process should be stopped, but is killed instead.
.PP .PP
The The
.B SIGKILL .B SIGKILL
signal cannot be caught or ignored. The and
.B SIGSTOP
signals cannot be caught or ignored. The
.B SIGILL .B SIGILL
and and
.B SIGTRAP .B SIGTRAP

View file

@ -82,6 +82,7 @@ PUBLIC int do_sigaction()
} }
mp->mp_sigact[m_in.sig_nr].sa_handler = svec.sa_handler; mp->mp_sigact[m_in.sig_nr].sa_handler = svec.sa_handler;
sigdelset(&svec.sa_mask, SIGKILL); sigdelset(&svec.sa_mask, SIGKILL);
sigdelset(&svec.sa_mask, SIGSTOP);
mp->mp_sigact[m_in.sig_nr].sa_mask = svec.sa_mask; mp->mp_sigact[m_in.sig_nr].sa_mask = svec.sa_mask;
mp->mp_sigact[m_in.sig_nr].sa_flags = svec.sa_flags; mp->mp_sigact[m_in.sig_nr].sa_flags = svec.sa_flags;
mp->mp_sigreturn = (vir_bytes) m_in.sig_ret; mp->mp_sigreturn = (vir_bytes) m_in.sig_ret;
@ -160,6 +161,7 @@ PUBLIC int do_sigsuspend()
mp->mp_sigmask2 = mp->mp_sigmask; /* save the old mask */ mp->mp_sigmask2 = mp->mp_sigmask; /* save the old mask */
mp->mp_sigmask = (sigset_t) m_in.sig_set; mp->mp_sigmask = (sigset_t) m_in.sig_set;
sigdelset(&mp->mp_sigmask, SIGKILL); sigdelset(&mp->mp_sigmask, SIGKILL);
sigdelset(&mp->mp_sigmask, SIGSTOP);
mp->mp_flags |= SIGSUSPENDED; mp->mp_flags |= SIGSUSPENDED;
check_pending(mp); check_pending(mp);
return(SUSPEND); return(SUSPEND);
@ -178,6 +180,7 @@ PUBLIC int do_sigreturn()
mp->mp_sigmask = (sigset_t) m_in.sig_set; mp->mp_sigmask = (sigset_t) m_in.sig_set;
sigdelset(&mp->mp_sigmask, SIGKILL); sigdelset(&mp->mp_sigmask, SIGKILL);
sigdelset(&mp->mp_sigmask, SIGSTOP);
r = sys_sigreturn(who_e, (struct sigmsg *) m_in.sig_context); r = sys_sigreturn(who_e, (struct sigmsg *) m_in.sig_context);
check_pending(mp); check_pending(mp);