bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] addition: wait-process.h, wait-process.c, 2nd round


From: Paul Eggert
Subject: Re: [Bug-gnulib] addition: wait-process.h, wait-process.c, 2nd round
Date: 27 Oct 2003 00:31:47 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Bruno Haible <address@hidden> writes:

> I think this scenario is
>   - extremely rare, due to the time it requires until a PID is reused,
>   - due to an inherent limitation of waitpid in POSIX: there is no way to
>     ask waitpid: "Tell me when the process terminates but keep the process
>     in zombie state afterwards."

If you can assume the XSI standard extension to POSIX, it sounds like
there is a way to solve the problem: you can pass WNOWAIT to waitpid.
WNOWAIT keeps the process whose status is returned in a waitable
state. The process may be waited for again with identical results, and
this sounds like it's what you want.  See
<http://www.opengroup.org/onlinepubs/007904975/basedefs/sys/wait.h.html>.

So you could use WNOWAIT if available, and fall back on the current
code if it's not available.


> > I'm a bit dubious about the semantics, portability, and
> > understandability of structs whose members are volatile.
> 
> It's the same as with const:

Yes, but the same objections apply to const.  Anyway, your other
arguments were good ones, though I admit that I still have a few
qualms, as it's unlikely that compiler bugs in this area will be found
and fixed.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]