kevents, waitpid() with WNOHANG race
kevents, waitpid() with WNOHANG race
- Subject: kevents, waitpid() with WNOHANG race
- From: Dave Keck <email@hidden>
- Date: Wed, 21 Oct 2009 12:29:42 -1000
Hey list,
I'm using kevents to wait for a child process to exit (EVFILT_PROC,
NOTE_EXIT). Once kevent() reports that the process exited, I use
waitpid() to get its exit status. (I'm using kevents to actually do
the waiting so I can enforce a timeout.)
When I call waitpid(), I specify the WNOHANG option. Intuitively, I
would assume that this option would be safe because by the time I call
waitpid(), kevent() already reported that the child exited. But I'm
wondering if this is always the case: will waitpid() ever return 0
when using WNOHANG, because of some ordering in the kernel where the
kevent machinery notices a process exited before waitpid() would be
able to?
Thanks!
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden