X-Spam-Check-By: sourceware.org
X-T2-Posting-ID: dCnToGxhL58ot4EWY8b+QGwMembwLoz1X2yB7MdtIiA=
X-Cloudmark-Score: 0.000000 []
Date: Sat, 3 Dec 2005 01:34:15 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: cygwin@cygwin.com
Subject: Re: SA_SIGINFO and signal info ?
Message-ID: <20051203003415.GR10913@bouh.residence.ens-lyon.fr>
Mail-Followup-To: cygwin@cygwin.com
References: <20051202230909.GM10913@bouh.residence.ens-lyon.fr> <Pine.GSO.4.63.0512021855380.8881@slinky.cs.nyu.edu> <20051203001911.GQ10913@bouh.residence.ens-lyon.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20051203001911.GQ10913@bouh.residence.ens-lyon.fr>
User-Agent: Mutt/1.5.9i-nntp
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Samuel Thibault, le Sat 03 Dec 2005 01:19:11 +0100, a écrit :
> Igor Pechtchanski, le Fri 02 Dec 2005 18:56:56 -0500, a écrit :
> > > Cygwin defines SA_SIGINFO, but it doesn't seem to be implemented: the
> > > following program gets in "info" just 0x0 or a strange pointer. Could
> > > it be supported somehow? The bit of information I'd really need is
> > > info->si_code, so as to know whether the signal is sent by "kernelspace"
> > > (because of alarm, setitimer, ...) or by "userspace" (kill, raise).
> > 
> > AFAICS, this should work in the snapshots, according to
> > <http://cygwin.com/ml/cygwin-cvs/2005-q3/msg00205.html>.
> 
> pthread_kill still gives 0 as info to
> the handler (and unfortunately, that's precisely the case I need)

And posix says in sigaction documentation: "If the value of si_code is
less than or equal to 0, then the signal was generated by a process and
si_pid and si_uid, respectively, indicate the process ID and the real
user ID of the sender."

So SI_USER should rather be defined to 0.

Mmm, btw, SIGALRM sets 0 in si_code, while it should set SI_KERNEL.

Regards,
Samuel

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

