On Aug 31, 2015, at 10:55 PM, Ken Thomases <k...@codeweavers.com> wrote:
> 
> Try the following program.  The parent will print the child's PID and exit 
> (by falling out of main()).  Then do a "ps xww -p <the child PID>".  You'll 
> see the child is still running.  You can kill it when satisfied.

Yep, I got it backwards. Nothing special for the child to keep running, special 
to make it die.

Simple old trick is to periodically check ppid to see if it changed. OSX 
specific way, and not requiring any nasty polling loop, is to use kqueue and an 
EVFILT_PROC for NOTE_EXIT. I don't know if there's any Cocoa or CF equivalent.

Sorry for the confusion, this is actually something I've gotten backwards 
before. I've written the code for the child to monitor for the parent's exit, 
yet I still forget that it's necessary. Go figure...


-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice






_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to