From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,2e4d096a5138be03,start X-Google-Attributes: gidfee84,public From: yeung@ncar.ucar.edu (David Yeung) Subject: SIGCHLD signal problem in OSF1 3.0 Date: 1995/04/06 Message-ID: <3m16e8$reo@ncar.ucar.edu>#1/1 X-Deja-AN: 100926867 organization: National Center for Atmospheric Research/Boulder, CO newsgroups: comp.unix.osf.osf1 Hi I am writing a problem trying to catch the SIGCHLD signal when any of its child processes dies. But I find that some SIGCHLD signals are lost if more than one child processes terminate simultaneously. Here is my test program: ================================================ #include #include #include void func1 (); main() { pid_t pid; int i; sigset(SIGCLD, func1); for (i=0;i<10;i++) { if ((pid = fork ()) == 0) { sleep (1); exit (1); } printf ("pid = %d\n", (int)pid); } for (;;); } void func1 () { pid_t pid; pid = wait (NULL); sigset(SIGCHLD, func1); printf ("func1 pid = %d\n", (int)pid); } ================================================= The program forks a number of processes and those child processes terminates at around the same time. But the signal handler (func1) can only catch one or two SIGCHLD signal. The others are lost. If I change the statement "sleep (1)" to "sleep (i+1)", i.e, the child processes are not terminated at the same time, then all SIGCHLD signals are catched. Does anyone know how to resolve this problem? This problem does not appear in SGI and SUN Unix. Thanks in advance. David Yeung --