From owner-freebsd-hackers Fri Jun 8 1:53:38 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from snipe.mail.pas.earthlink.net (snipe.mail.pas.earthlink.net [207.217.120.62]) by hub.freebsd.org (Postfix) with ESMTP id 4193B37B406 for ; Fri, 8 Jun 2001 01:53:36 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.245.138.245.Dial1.SanJose1.Level3.net [209.245.138.245]) by snipe.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id BAA14095; Fri, 8 Jun 2001 01:53:32 -0700 (PDT) Message-ID: <3B2092A9.67B58DA6@mindspring.com> Date: Fri, 08 Jun 2001 01:54:01 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Cejka Rudolf Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: [Patch?] signal(SIGCHLD, SIG_IGN) is against SUSv2 References: <20010607143050.A13932@dcse.fee.vutbr.cz> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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