Subject: Re: wait(2) suggestion
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
Date: 12/26/2004 20:33:27
>> I found myself wanting an analog to MSG_PEEK for wait(), largely so
>> as to make it possible to do "wait for a child to die/stop, but
>> don't reap/mark it" call,
>> So I invented one: WNOREAP.
> It is called WNOWAIT and it has already been implemented (I think).
Well, you're right and you're wrong.
You're right that WNOWAIT exists and has been implemented, and that
it's related to what I wanted. You're right that I missed it (which
you didn't quite say, and actually might not even have meant for all I
know). But you're wrong that it's what I wanted.
WNOWAIT is the "don't mark stopped child as waited-for" part of what I
wanted. But it doesn't do the "don't reap zombies" part; a WNOWAIT
wait that finds a zombie will still reap it. (I suspect it's designed
to be used with WNOZOMBIE, which does avoid reaping zombies, but also
avoids noticing them altogether.)
For my purposes I never want to change any process's state; I just want
the call to block until something is available that a similar wait,
without the flag bit, would return. (My WNOREAP returns the status and
PID, but that's unnecessary for my current application - an accident of
the implementation, as it were.)
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML firstname.lastname@example.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B