Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753903Ab0GCAi5 (ORCPT ); Fri, 2 Jul 2010 20:38:57 -0400 Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:39096 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752437Ab0GCAiz (ORCPT ); Fri, 2 Jul 2010 20:38:55 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=subject:from:to :cc:content-type:date:message-id:mime-version :content-transfer-encoding; q=dns; s=sasl; b=dMChFE4hOG+6D6Zt7QC hpGaW5ZGs8LeCNZmKgiYnmm+urlLZqoZz0ux+1Bexr0rZ1q4fzY8hw3ZlsFKJgAP 9hdTOBdA9/zvs01S9ePYGX5LFx9/CxQrjRPWlhBDENQEVBrR4Fz/QXi8aG/kbov9 XsNaA4Yhi4D42RQKRgjhfR20= Subject: [PATCH] signalfd: fill in ssi_int for posix timers and message queues From: Nathan Lynch To: Linux Kernel Mailing List Cc: Davide Libenzi Content-Type: text/plain; charset="UTF-8" Date: Fri, 02 Jul 2010 19:38:48 -0500 Message-ID: <1278117528.21917.354.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) Content-Transfer-Encoding: 7bit X-Pobox-Relay-ID: 5B160956-863B-11DF-8986-9056EE7EF46B-04752483!a-pb-sasl-quonix.pobox.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1854 Lines: 48 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/