Re: while (wait(&status) != pid) and waitpid (pid, &status, 0)
From: Alex Fraser (me_at_privacy.net)
Date: 11/26/05
- Next message: Paul Pluzhnikov: "Re: while (wait(&status) != pid) and waitpid (pid, &status, 0)"
- Previous message: Gordon Burditt: "Re: argv[0] in execvp()"
- In reply to: Alex Vinokur: "while (wait(&status) != pid) and waitpid (pid, &status, 0)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 26 Nov 2005 19:17:32 -0000
"Alex Vinokur" <alexvn@x-privat.org> wrote in message
news:43888857$1_2@x-privat.org...
> Are 'while (wait(&status) != pid)' and 'waitpid (pid, &status, 0)' have
> the same behavior?
No. Ignoring errors, the wait() loop ends after the child specified by pid
terminates, and waitpid() returns after the child specified by pid
terminates. But the wait() loop may collect (and promptly throw away) the
statuses of some other children, whereas waitpid() will not.
Alex
- Next message: Paul Pluzhnikov: "Re: while (wait(&status) != pid) and waitpid (pid, &status, 0)"
- Previous message: Gordon Burditt: "Re: argv[0] in execvp()"
- In reply to: Alex Vinokur: "while (wait(&status) != pid) and waitpid (pid, &status, 0)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|