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

From: Alex Vinokur (alexvn_at_x-privat.org)
Date: 11/26/05


Date: 26 Nov 2005 17:21:14 +0100


"Paul Pluzhnikov" <ppluzhnikov-nsp@charter.net> wrote in message news:m3d5knpcf2.fsf@somewhere.in.california.localhost...
> "Alex Vinokur" <alexvn@x-privat.org> writes:
>
> > Are 'while (wait(&status) != pid)' and 'waitpid (pid, &status, 0)' have the same behavior?
>
> No.
>
> The first one will collect any child processes that have exit()ed;
> the second will wait only for the specified process.
>
[snip]

'wait(&status)' collects any child processes that have exit()ed

Also 'while (wait(&status) != pid)' ?

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


Relevant Pages