On 9/3/10 10:44 AM, Eric Blake wrote:
On 09/02/2010 04:44 PM, Philip Prindeville wrote:
I wanted to check in and see if there was a chance of this feature being
accepted upstream before I spent any time on it... so here goes.
The "wait [n]" command is handy, but would be even handier is:
wait [[-a] n]
instead, which asynchronously checks to see if process 'n' has completed.
What's wrong with using the existing 'kill -0 pid' to check if pid still
exists, rather than inventing a new argument to 'wait'?
Well, in theory, if you waited long enough (to look for the process), and it
had exited and a new process with that id was created, you'd detect the wrong
process.
At least with 'wait' you're guaranteed it's still in your process-group, right?
Besides, 'wait' is just a lot easier to read and understand... not everyone
knows the system call semantics of kill().