• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
kevents, waitpid() with WNOHANG race
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: kevents, waitpid() with WNOHANG race
      • From: Damien Sorresso <email@hidden>
  • Prev by Date: Debugging libraries
  • Next by Date: Re: kevents, waitpid() with WNOHANG race
  • Previous by thread: Debugging libraries
  • Next by thread: Re: kevents, waitpid() with WNOHANG race
  • Index(es):
    • Date
    • Thread