| To: | austin-group-l@xxxxxxxxxxxxx |
|---|---|
| Subject: | wait() spec (SIGCHLD ignored) |
| From: | Michael Kerrisk <mtk.lists@xxxxxxxxx> |
| Date: | Mon, 04 Aug 2008 11:37:37 +0200 |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=88h4dnhbJCHIaWExZJWf23ksALR88DdRki5hMKtSw5A=; b=obh1K9UnUYeFRUrK6NtKGcQIkLPCpqMEKPbyRA1yIqNdByo6yIr6yGPmgrOPcuKA3x ziWVZdiBIHYZDBANrYBYEd/bHt3TlGsWOSci6eezWme/RPJmtQdXSXT5Vn8VtW798qF+ aGRYiVlFWn4YHvaquCGxRF8ruZUeZrt0hUUlg= |
| Domainkey-signature: | a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=HGJG6zr1HHMW/7O+IllAFEGPPt20uGreqGrOa97ZED7xmceRqj7sBENn2QHpmBXhyC DPw1V/sEddyzuD0K3LP9PToR3MaxkuQqbdIHklpGkvVxhFKovxcGLK63j4hoQ0zjWqBr SIScNMcdCekVYkraN+BESTOaIy8VLpAo8YrbM= |
| References: | <1217604384.26163.32.camel@xxxxxx> <200808011542.m71Fgc2p002689@xxxxxx> <20080801160715.GA14327@xxxxxx> <200808011654.m71GsV9i005409@xxxxxx> <20080801171355.GA15855@xxxxxx> |
|
(I'm not sure if I'm misreading the text, or whether this perhaps
warrants an Aardvark.) In both POSIX.1-2001 and the current revision, there is the following text for wait(): == If the calling process has SA_NOCLDWAIT set or has SIGCHLD set to SIG_IGN, and the process has no unwaited-for children that were transformed into zombie processes, the calling thread shall block until all of the children of the process containing the calling thread terminate, and wait() and waitpid() shall fail and set errno to [ECHILD]. == If I read this right, then the standard is saying that in the following scenario where a process has created 2 children, and a) One child still executing b) One child already terminated Then the above standards para does *not* apply ("and the process has no unwaited-for children that were transformed into zombie processes"), and instead the wait() call should return the status of the child that has already terminated. Is that a correct interpretation. Notwithstanding that, in this circumstance, on Linux (2.6.25), FreeBSD (6.2), and Solaris (8), a waitpid() call does wait until child a) has already terminated, and then the call fails with ECHILD. It looks as though the standard deviates from existing practice on this point (or did I miss something?). Cheers, Michael |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [Fwd: Re: Clearing environ], David-Sarah Hopwood |
|---|---|
| Next by Date: | Re: wait() spec (SIGCHLD ignored), Roland McGrath |
| Previous by Thread: | Re: [Fwd: Re: Clearing environ], Robert C. Seacord |
| Next by Thread: | Re: wait() spec (SIGCHLD ignored), Roland McGrath |
| Indexes: | [Date] [Thread] [All Lists] |