Return to BSD News archive
Newsgroups: comp.os.386bsd.bugs Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!bogus.sura.net!news-feed-1.peachnet.edu!umn.edu!csus.edu!netcom.com!alm From: alm@netcom.com (Andrew Moore) Subject: first call to signal() returns NULL? Message-ID: <almC5v240.92E@netcom.com> Organization: NETCOM On-line Communication Services (408 241-9760 guest) Date: Thu, 22 Apr 1993 01:14:20 GMT Lines: 28 The first call to signal() returns NULL. The following code under both 386BSD and SunOS, whether run in foreground or background returns: err: NULL returned first call If run in the background, SIGINT is correctly ignored, but the first call to signal() does not indicate this... Aside from the fact that sigaction() should be used to probe the status of a signal, what am I missing? -Andrew Moore <alm@netcom.com> #include <stdio.h> #include <signal.h> #ifdef __STDC__ typedef void sighandler(int); sigfunc *signal(int, sighandler *); #else void (*signal())(); #endif main() { /* first time signal is called, it returns NULL! */ if (signal(SIGINT, SIG_IGN) != NULL) printf("okay: non-NULL returned first call\n"), exit(1); if (signal(SIGINT, SIG_IGN) != SIG_IGN) printf("err: NULL returned second call\n"), exit(1); printf("err: NULL returned first call\n"); }