diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2003-04-22 18:23:49 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2003-04-22 18:23:49 +0000 |
| commit | fe8cdcae8755884de5038365ebd6730c32cbc1bd (patch) | |
| tree | 222816ecfa4d78c70aa83bd9c9691fc78e08ee97 /sys/compat/linux | |
| parent | 3301bb23492830723c51ec4ff7d82fac17522f2f (diff) | |
Notes
Diffstat (limited to 'sys/compat/linux')
| -rw-r--r-- | sys/compat/linux/linux_signal.c | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index b70e99d93d2d..a69f27d07c80 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -227,40 +227,22 @@ static int linux_do_sigprocmask(struct thread *td, int how, l_sigset_t *new, l_sigset_t *old) { + sigset_t omask, nmask; + sigset_t *nmaskp; int error; - sigset_t mask; - struct proc *p = td->td_proc; - error = 0; td->td_retval[0] = 0; - PROC_LOCK(p); - if (old != NULL) - bsd_to_linux_sigset(&td->td_sigmask, old); - if (new != NULL) { - linux_to_bsd_sigset(new, &mask); + linux_to_bsd_sigset(new, &nmask); + nmaskp = &nmask; + } else + nmaskp = NULL; - switch (how) { - case LINUX_SIG_BLOCK: - SIGSETOR(td->td_sigmask, mask); - SIG_CANTMASK(td->td_sigmask); - break; - case LINUX_SIG_UNBLOCK: - SIGSETNAND(td->td_sigmask, mask); - signotify(td); - break; - case LINUX_SIG_SETMASK: - td->td_sigmask = mask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - break; - default: - error = EINVAL; - break; - } - } - PROC_UNLOCK(p); + /* Linux sigprocmask flag values are one less than FreeBSD values. */ + error = kern_sigprocmask(td, how + 1, nmaskp, &omask, 0); + if (error != 0 && old != NULL) + bsd_to_linux_sigset(&omask, old); return (error); } |
