This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bash returns incorrect process status

> Is there some reason why we aren't discussing this on the mailing
> list?

Which mailing list?  I'm not on the cygwin list.

> >POSIX shells are required to remember at least CHILD_MAX (but
> >optionally more) process statuses.  There is a gray area about whether
> >or not the user can query the status of those processes, implying that
> >once the status of a background or foreground job has been reported,
> >its status, and the status of its constituent processes, can be
> >discarded, but those rules are hard to decipher.
> Are you saying that waitpid should be able to return the status of an
> exited process when it is called repeatedly?  I've never seen anything
> like that.  I thought that once you'd done a wait the process was
> unzombified, it goes away, and it is unavailable for future querying.

No.  The portion of the POSIX spec describing the shell's behavior is
independent of the exact function used to query a process's status.  It
says the shell has to remember.  It doesn't mention waitpid(), nor does
it need to.

You're assuming that the shell just does a waitpid() whenever it needs to
get a particular process's status.  No shell does it that way.


``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Chet Ramey, ITS, CWRU

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]