[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0804091256490.6235@alien.or.mcafeemobile.com>
Date: Wed, 9 Apr 2008 12:59:37 -0700 (PDT)
From: Davide Libenzi <davidel@...ilserver.org>
To: Michael Kerrisk <mtk.manpages@...glemail.com>
cc: lkml <linux-kernel@...r.kernel.org>
Subject: Re: signalfd() not handling sigqueue() sigval data correctly
On Tue, 8 Apr 2008, Michael Kerrisk wrote:
> Hi Davide,
>
> I was doing some playing about with signalfd(), and seem to have encountered a
> bug: when a signalfd read() fetches data for a signal that was sent by
> sigqueue(), the data accompanying the signal is not returned. Instead
> ssi_int/ssi_ptr is zero.
Michael, can you give the patch below a spin? I tested it on my x86_64 box
and seems to be working fine:
Got signal 44
ssi_code= -1
ssi_pid = 6314
ssi_uid = 1000
ssi_int = 123
ssi_ptr = 7b
- Davide
---
fs/signalfd.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Index: linux-2.6.mod/fs/signalfd.c
===================================================================
--- linux-2.6.mod.orig/fs/signalfd.c 2008-04-09 11:53:37.000000000 -0700
+++ linux-2.6.mod/fs/signalfd.c 2008-04-09 12:05:46.000000000 -0700
@@ -111,9 +111,14 @@
err |= __put_user(kinfo->si_uid, &uinfo->ssi_uid);
err |= __put_user((long) kinfo->si_ptr, &uinfo->ssi_ptr);
break;
- default: /* this is just in case for now ... */
+ default:
+ /*
+ * This case catches also the signals queued by sigqueue().
+ */
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;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists