X-Spam-Check-By: sourceware.org X-T2-Posting-ID: dCnToGxhL58ot4EWY8b+QGwMembwLoz1X2yB7MdtIiA= X-Cloudmark-Score: 0.000000 [] Date: Sat, 3 Dec 2005 00:09:09 +0100 From: Samuel Thibault To: cygwin AT cygwin DOT com Subject: SA_SIGINFO and signal info ? Message-ID: <20051202230909.GM10913@bouh.residence.ens-lyon.fr> Mail-Followup-To: cygwin AT cygwin DOT com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i-nntp X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hi, 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). Regards, Samuel #include #include #include #include #include void handler (int sig, siginfo_t *info, void *uc) { fprintf (stderr,"%d: %p %p\n", sig, info, uc); } void *foo (void *bar) { while(1) pause (); return NULL; } int main (void) { struct sigaction sa; pthread_t t; sigemptyset (&sa.sa_mask); sa.sa_flags = SA_SIGINFO; sa.sa_sigaction = handler; sigaction (SIGALRM, &sa, NULL); sigaction (SIGINT, &sa, NULL); sigaction (SIGWINCH, &sa, NULL); pthread_create (&t,NULL,foo,NULL); alarm (5); pthread_kill (t,SIGINT); raise (SIGINT); sleep (10); sleep (10); return 0; } -- 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/