public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] signalfd: fill in ssi_int for posix timers and message queues
@ 2010-07-03  0:38 Nathan Lynch
  2010-07-03 19:09 ` Davide Libenzi
  2010-07-20 22:42 ` Andrew Morton
  0 siblings, 2 replies; 9+ messages in thread
From: Nathan Lynch @ 2010-07-03  0:38 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Davide Libenzi

If signalfd is used to consume a signal generated by a POSIX interval
timer or POSIX message queue, the ssi_int field does not reflect the
data (sigevent->sigev_value) supplied to timer_create(2) or
mq_notify(3).  (The ssi_ptr field, however, is filled in.)

This behavior differs from signalfd's treatment of sigqueue-generated
signals -- see the default case in signalfd_copyinfo.  It also gives
results that differ from the case when a signal is handled
conventionally via a sigaction-registered handler.

So, set signalfd_siginfo->ssi_int in the remaining cases (__SI_TIMER,
__SI_MESGQ) where ssi_ptr is set.

Signed-off-by: Nathan Lynch <ntl@pobox.com>
---
 fs/signalfd.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/signalfd.c b/fs/signalfd.c
index f329849..1c5a6ad 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -88,6 +88,7 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo,
 		 err |= __put_user(kinfo->si_tid, &uinfo->ssi_tid);
 		 err |= __put_user(kinfo->si_overrun, &uinfo->ssi_overrun);
 		 err |= __put_user((long) kinfo->si_ptr, &uinfo->ssi_ptr);
+		 err |= __put_user(kinfo->si_int, &uinfo->ssi_int);
 		break;
 	case __SI_POLL:
 		err |= __put_user(kinfo->si_band, &uinfo->ssi_band);
@@ -111,6 +112,7 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo,
 		err |= __put_user(kinfo->si_pid, &uinfo->ssi_pid);
 		err |= __put_user(kinfo->si_uid, &uinfo->ssi_uid);
 		err |= __put_user((long) kinfo->si_ptr, &uinfo->ssi_ptr);
+		err |= __put_user(kinfo->si_int, &uinfo->ssi_int);
 		break;
 	default:
 		/*
-- 
1.6.6.1




^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-07-25  4:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-03  0:38 [PATCH] signalfd: fill in ssi_int for posix timers and message queues Nathan Lynch
2010-07-03 19:09 ` Davide Libenzi
2010-07-05 12:22   ` Nathan Lynch
2010-07-05 18:23     ` Davide Libenzi
2010-07-20 22:42 ` Andrew Morton
2010-07-21  3:44   ` Nathan Lynch
2010-07-21  4:10     ` Andrew Morton
2010-07-21 17:39       ` Nathan Lynch
2010-07-25  4:09       ` Davide Libenzi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox