Re: while (wait(&status) != pid) and waitpid (pid, &status, 0)

From: Alex Vinokur (alexvn_at_go.to)
Date: 11/26/05


Date: Sat, 26 Nov 2005 19:26:05 +0200


"Paul Pluzhnikov" <ppluzhnikov-nsp@charter.net> wrote in message news:m38xvbpas3.fsf@somewhere.in.california.localhost...
> "Alex Vinokur" <alexvn@x-privat.org> writes:
>
> > 'wait(&status)' collects any child processes that have exit()ed
>
> Yes. Did you have a question about it?
>
> > Also 'while (wait(&status) != pid)' ?
>
> Huh? What are you trying to ask?
>
[snip]

http://man.he.net/man2/waitpid

The wait function suspends execution of the current process until a child has exited, or ...
The waitpid function suspends execution of the current process until a child as specified by the pid argument has exited, or
...

The 'while (wait(&status) != pid)' statement suspends execution of the current process until ???

-- 
 Alex Vinokur
     email: alex DOT vinokur AT gmail DOT com
     http://mathforum.org/library/view/10978.html
     http://sourceforge.net/users/alexvn