From: David Woodhouse <dwmw2@infradead.org>
To: "Mika Penttilä" <mika.penttila@kolumbus.fi>
Cc: akpm@osdl.org, linuxppc-dev@ozlabs.org,
linux-kernel@vger.kernel.org, drepper@redhat.com
Subject: Re: [PATCH] 3/3 Generic sys_rt_sigsuspend
Date: Tue, 29 Nov 2005 10:42:03 +0000 [thread overview]
Message-ID: <1133260923.31573.131.camel@baythorne.infradead.org> (raw)
In-Reply-To: <438BE48B.9060908@kolumbus.fi>
On Tue, 2005-11-29 at 07:18 +0200, Mika Penttilä wrote:
> You are not setting saved_sigmask here.
Oops; well spotted. Thanks.
> And shouldn't it return -EINTR?
I believe not. The previous versions would loop until do_signal()
returned non-zero; i.e. until a signal was actually delivered.
By returning -ERESTARTNOHAND we achieve the same effect. If there's a
signal delivered, that gets magically converted to -EINTR, but if
there's no signal delivered, the syscall gets restarted.
diff -u b/kernel/compat.c b/kernel/compat.c
--- b/kernel/compat.c
+++ b/kernel/compat.c
@@ -859,7 +859,7 @@
#ifdef __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset, compat_size_t sigsetsize)
{
- sigset_t saveset, newset;
+ sigset_t newset;
compat_sigset_t newset32;
/* XXX: Don't preclude handling different sized sigset_t's. */
@@ -872,7 +872,7 @@
sigdelsetmask(&newset, sigmask(SIGKILL)|sigmask(SIGSTOP));
spin_lock_irq(¤t->sighand->siglock);
- saveset = current->blocked;
+ current->saved_sigmask = current->blocked;
current->blocked = newset;
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
diff -u b/kernel/signal.c b/kernel/signal.c
--- b/kernel/signal.c
+++ b/kernel/signal.c
@@ -2626,7 +2626,7 @@
#ifdef __ARCH_WANT_SYS_RT_SIGSUSPEND
long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize)
{
- sigset_t saveset, newset;
+ sigset_t newset;
/* XXX: Don't preclude handling different sized sigset_t's. */
if (sigsetsize != sizeof(sigset_t))
@@ -2637,7 +2637,7 @@
sigdelsetmask(&newset, sigmask(SIGKILL)|sigmask(SIGSTOP));
spin_lock_irq(¤t->sighand->siglock);
- saveset = current->blocked;
+ current->saved_sigmask = current->blocked;
current->blocked = newset;
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
--
dwmw2
next prev parent reply other threads:[~2005-11-29 10:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1133225007.31573.86.camel@baythorne.infradead.org>
2005-11-29 0:57 ` [PATCH] 1/3 Add pselect/ppoll() system calls David Woodhouse
2005-11-29 0:57 ` [PATCH] 2/3 Add TIF_RESTORE_SIGMASK support for arch/powerpc David Woodhouse
2005-11-29 0:57 ` [PATCH] 3/3 Generic sys_rt_sigsuspend David Woodhouse
2005-11-29 5:18 ` Mika Penttilä
2005-11-29 10:42 ` David Woodhouse [this message]
2005-11-29 15:53 ` Daniel Jacobowitz
2005-11-29 16:09 ` David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1133260923.31573.131.camel@baythorne.infradead.org \
--to=dwmw2@infradead.org \
--cc=akpm@osdl.org \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mika.penttila@kolumbus.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).