Cejka Rudolf wrote:
>
> There is following paragraph in SUSv2:
>
> If a process sets the action for the SIGCHLD signal to SIG_IGN,
> the behaviour is unspecified, except as specified below. If the
> action for the SIGCHLD signal is set to SIG_IGN, child processes
> of the calling processes will not be transformed into zombie
> processes when they terminate. If the calling process subsequently
> waits for its children, and the process has no unwaited for children
> that were transformed into zombie processes, it will block until all
> of its children terminate, and wait(), wait3(), waitid() and waitpid()
> will fail and set errno to [ECHILD]. ...
>
> However, if I use "signal(SIGCHLD, SIG_IGN)", zombies are still
> created in FreeBSD, which is against SUSv2.
Look at the sigaction() man page. There is a POSIX way
to do what you want, using the sa_flags bits.
If you hack up signal() to do this, it should be done
by noting the SIG_IGN and the fact you are using the
historical compatability signal() wrapper to the POSIX
interface, and just set the sa_flags bit to do the job.
I'm pretty sure the "wait" and other behaviour is also
documented on that page, in the context of the sa_flags
bit.
-- Terry
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message