kqueue NOTE_EXIT doesn't work
I am trying to use Apple's example of using kqueue but the callback is never called unless I start observing the kqueue after th开发者_开发百科e process starts. But the lifetime of the process is short and i need the code to work if the process starts before or after I start observing it.
What if you send the process a SIGSTOP immediately after starting it, and then SIGCONT after setting up the kqueue?
If you're using fork and exec directly, you could have the child send itself SIGSTOP (using raise(3)) and have the parent send it SIGCONT
.
精彩评论