Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!harvard!seismo!mcvax!ukc!cheviot!lindsay From: lindsay@cheviot.uucp (Lindsay F. Marshall) Newsgroups: net.unix-wizards Subject: Re: System V and SIGCLD Message-ID: <715@cheviot.uucp> Date: Mon, 12-May-86 06:59:40 EDT Article-I.D.: cheviot.715 Posted: Mon May 12 06:59:40 1986 Date-Received: Thu, 15-May-86 06:04:04 EDT References: <344@hrc63.UUCP> Reply-To: lindsay@cheviot.newcastle.ac.uk (Lindsay F. Marshall) Organization: U. of Newcastle upon Tyne, U.K. Lines: 23 In article <344@hrc63.UUCP> nwh@hrc63.UUCP (Nigel Holder Marconi) writes: > > The problem with resetng SIGCLD is that the signal is still valid since >the child process is waiting for the parent to perform a wait. The following >implements this and of course works ! >...... > wait(&c); This is, of course, perfectly obvious, but DOESNT ANSWER MY QUESTION!! In the application I have I MUST not do a wait inside the signal handler. The solution of adding wait has been suggested by many people, but it simply is no good. If you want to save status information you then have to implement a stack wait return data, and then a new verion of wait that looks at the stack to see if anything has terminated etc. etc. The bottom line is that SIGCLD is very broken and ougth to be fixed!! One way round this problem if you are only expecting SIGCLD's to come in ones is to put signal(SIGCLD, SIG_IGN); before you reset the signal. This cause any outstanding SIGCLD's to be junked (hence it only works when there is a single child) but does allow you to reset the signal for future parent/child interactions withou causing an infinite loop.