wait() on a PID that is not your child
wait() on a PID that is not your child
Posted Oct 9, 2011 10:54 UTC (Sun) by neilbrown (subscriber, #359)In reply to: wait() on a PID that is not your child by ebiederm
Parent article: A Plumber's Wish List for Linux
hmm... I must have missed an important piece in the code. I just tested and the old empty directory definitely stays empty as you said. Thanks for the correction.
I don't think the race at the top is real. Whatever mechanism was used to determine which pid to wait for can be repeated after the "cd /proc/$pid" to see if it is still the same. If it is the same, then it is perfectly safe to wait for files to disappear (if/when there is a mechanism to do that).
