From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,2e4d096a5138be03 X-Google-Attributes: gidfee84,public From: jenkinsj@oils.ozy.dec.com (Jon Jenkins) Subject: Re: SIGCHLD signal problem in OSF1 3.0 Date: 1995/04/12 Message-ID: <3mhke4$gg4@nntpd.lkg.dec.com>#1/1 X-Deja-AN: 100355218 references: <3m16e8$reo@ncar.ucar.edu> organization: Digital Equipment Corporation newsgroups: comp.unix.osf.osf1 David Yeung (yeung@ncar.ucar.edu) wrote: : 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. This is traditional UNIX problem. For a refernece read Richard Stevens Book " Advanced Programming in the UNIX Environment" WRS says that "if a blocked signal (blocked automatically during signal delivery) then POSIX.1 allows for the signal to be delivered either once or more than once. If the signal is delivered more than once we say that the signals are queued. Most UNIX systems do "not" (his emphasis) do not queue signals. Instead the UNIX kernal just delivers the signal once. " As to whether OSF/1 queues signals of the same type I dont know the man pages are silent on this issue. Perhaps some of the OSF/1 signal people would comment. They might also like to comment on the differences between linking with the two versions (sys5 and bsd) versions of the library. He [WRS] goes on to say that "The manual pages for System V claimed that SIGCLD signal was queued, but it realy wasn't. Instead the signal was regenerated by the kernel as described in Section 10.7" (sse the discussion below and code frag) "The sigaction manual page in AT&T [1990e] claims that the SA_SIGINFO flag (Figure 10.5) causes signals to be reliably queued. This is wrong. Apparently this feature exists within the kernel, but it is not enabled in SVR4." Accoring to what is said that fact that it works onother systems may be a "fluke" of ther OS timing or OS strategy rather than a feature. However he does also say that the SYSV semantics of SIGCLD (NOT SIGCHLD) are such that if it is placed after the call to wait() then the kernel will check if any other children have died and will recursively call the handler. This avoids the window problem of the older unreliable signals. i.e. func1 should look like: void func1 () { pid_t pid; pid = wait (NULL); printf ("func1 pid = %d\n", (int)pid); sigset(SIGCHLD, func1); } But this dont work either no matter which library is linked ;-( -- ---------------------------------------------------------------------- Name: Dr Jon Jenkins Location: Digital Equipment Corp, NaC, Burnett Place, Research Park, Bond University, Gold Coast QLD, AUSTRALIA 4229 Phone: 61-75-75-0151 Fax: 61-75-75-0100 Internet: jenkinsj@ozy.dec.com Close Proximity: "HEY YOU !!!" The opinions expressed above are entirely personal and do not reflect the corporate policy of DEC or the opinions of DEC management. -----------------------------------------------------------------------