Date: Thu, 23 Jan 2003 05:28:33 +0200 From: Enache Adrian <enache@rdslink.ro> To: hackers@freebsd.org Subject: signals lost when linked with libc_r ? Message-ID: <20030123032833.GA5075@ratsnest.hole>
next in thread | raw e-mail | index | archive | help
FreeBSD seems to loose signals in programs linked with libc_r.
sigaction.c ( freely translated from Perl's ext/POSIX/t/posix.t test)
-----------------8x----------------------
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
void sighup(int dummy)
{
kill(getpid(),SIGINT);
sleep(1);
printf("sigint delayed ...\n");
}
void sigint(int dummy)
{
printf("SIGINT !\n");
}
struct sigaction act;
int main()
{
act.sa_handler = sighup;
sigaddset(&act.sa_mask, SIGINT);
sigaction(SIGHUP, &act, NULL);
signal(SIGINT,sigint);
kill(getpid(),SIGHUP);
sleep(2);
printf("*\n");
return 0;
}
-----------------8x-----------------------
csh# cc sigaction.c -o sigaction
csh# ./sigaction
sigint delayed ...
SIGINT !
*
csh# cc -lc_r sigaction.c -o sigaction
csh# ./sigaction
sigint delayed ...
*
(this is -CURRENT, cvsup'ed 3 days ago)
Please enlighten me.
Adi
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030123032833.GA5075>
