Re: linux bug in pclose

Matthias Urlichs (
Sun, 14 Jul 1996 12:06:49 +0100

In, article <>,
Michiel Boland <> writes:
> So, to fix your program, you should check inside the SIGCHLD
> handler *what* child has exited, and realize that wait() may
> return -1 when someone else already waited for the child.
Note also that if you know which process you want to wait for, you shou=
use waitpid() or wait4() instead of wait().

Note also that _any_ process can in fact have extra children it doesn't
know about. This happens if a process calls fork() and then the father
exec()s your program instead of the child.

Attendants at a service station in Eunice, Louisiana, handed more than
$100 to a naked man who claimed to have a gun in his pocket.
Matthias Urlichs \ noris network GmbH / Xlink-POP N=FCrnberg=
Schleiermacherstra=DFe 12 \ Linux+Internet / EMail: urlichs@nor=
90491 N=FCrnberg (Germany) \ Consulting+Programming+Networking+etc=
PGP: 1024/4F578875 1B 89 E2 1C 43 EA 80 44 15 D2 29 CF C6 C7 E0 D=
Click <A HREF=3D"">here</A>. =