From owner-freebsd-hackers Sun Jun 10 9:36:54 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from boco.fee.vutbr.cz (boco.fee.vutbr.cz [147.229.9.11]) by hub.freebsd.org (Postfix) with ESMTP id A281B37B409 for ; Sun, 10 Jun 2001 09:36:41 -0700 (PDT) (envelope-from cejkar@dcse.fee.vutbr.cz) Received: from kazi.dcse.fee.vutbr.cz (kazi.dcse.fee.vutbr.cz [147.229.8.12]) by boco.fee.vutbr.cz (8.11.4/8.11.3) with ESMTP id f5AGacD67540 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified OK); Sun, 10 Jun 2001 18:36:39 +0200 (CEST) Received: (from cejkar@localhost) by kazi.dcse.fee.vutbr.cz (8.11.3/8.11.3) id f5AGab873925; Sun, 10 Jun 2001 18:36:37 +0200 (CEST) Date: Sun, 10 Jun 2001 18:36:37 +0200 From: Cejka Rudolf To: Terry Lambert Cc: hackers@FreeBSD.ORG Subject: Re: [Patch?] signal(SIGCHLD, SIG_IGN) is against SUSv2 Message-ID: <20010610183637.A73238@dcse.fee.vutbr.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from tlambert2@mindspring.com on Fri, Jun 08, 2001 at 01:54:01AM -0700 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 Terry Lambert wrote (2001/06/08): > > However, if I use "signal(SIGCHLD, SIG_IGN)", zombies are still > > created in FreeBSD, which is against SUSv2. I'm sorry that I used this shortening: I know that signal() is implemented via sigaction() in FreeBSD's libc so I used signal() in my description. However, just sigaction() interface is used in my test program. Ok, I repeat it once again - in the full: If I use sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = SIG_IGN; sigaction(SIGCHLD, &sa, NULL); zombies are still created in FreeBSD, which is against SUSv2. My citation was quoted directly from sigaction() page and not from signal() page. Unfortunately, I do not have access to POSIX, so I do not know if it is specified in SUSv2 only or if it is specified in both SUSv2 and in POSIX. I'm afraid that it is in both. However I think, that FreeBSD wants to be SUSv2 compliant too, or not? > Look at the sigaction() man page. There is a POSIX way > to do what you want, using the sa_flags bits. I know about SA_NOCLDWAIT too, but SIG_IGN is the second way how to set up SIGCHLD handler and do not create zombies. Both ways are directly specified in SUSv2. What all says POSIX? Is it so much different from SUSv2? > 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. And why not to use the second way of the two in SUSv2 specification? It is not about (im)possibility. It is about FreeBSD's conformance to SUSv2 specification (and maybe POSIX?). -- Rudolf Cejka (cejkar@dcse.fee.vutbr.cz; http://www.fee.vutbr.cz/~cejkar) Brno University of Technology, Faculty of El. Engineering and Comp. Science Bozetechova 2, 612 66 Brno, Czech Republic To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message