wait() on a PID that is not your child
wait() on a PID that is not your child
Posted Oct 8, 2011 3:10 UTC (Sat) by neilbrown (subscriber, #359)In reply to: wait() on a PID that is not your child by HelloWorld
Parent article: A Plumber's Wish List for Linux
I would suggest that the best way to do this is not to use 'wait' at all but to support 'poll' on some file in /proc/$pid.
I would suggest /proc/$pid/status. It wouldn't be hard to get a poll on this file to report POLLERR when the process dies or changes state.
For extra points you could add an 'exit status' field that only appears after the process has exited - not sure if that is necessary though.
I would suggest /proc/$pid/status. It wouldn't be hard to get a poll on this file to report POLLERR when the process dies or changes state.
For extra points you could add an 'exit status' field that only appears after the process has exited - not sure if that is necessary though.
