System V and SIGCLD
Nigel Holder Marconi
nwh at hrc63.UUCP
Fri May 9 19:07:52 AEST 1986
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 !
trap(sig)
int sig;
{
int c;
printf("trapped SIGCLD\n");
wait(&c);
signal(SIGCLD, trap); /* reset handler */
}
Now that brings me to wait. 4.2 at least provides two flavours of wait :
wait and wait3. Now wait3 is new and is free to do what it wants in its own
way. Wait however, does not requires an int pointer, it requires a pointer
to a union which happens to start with an int. Whether this affects
programs written in Sys V flavour or not is probably well defined at the
moment, but it could change. Just another example of a transparent
difference between flavours that is easily overlooked.
More information about the Comp.unix.wizards
mailing list