Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Jun 2001 01:54:01 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Cejka Rudolf <cejkar@dcse.fee.vutbr.cz>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: [Patch?] signal(SIGCHLD, SIG_IGN) is against SUSv2
Message-ID:  <3B2092A9.67B58DA6@mindspring.com>
References:  <20010607143050.A13932@dcse.fee.vutbr.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B2092A9.67B58DA6>