Can a parent process determine its child's status ?

Mark Benard mb at rex.cs.tulane.edu
Wed Mar 7 09:29:08 AEST 1990


In article <5090.25e135aa at mva.cs.liv.ac.uk> adh at mva.cs.liv.ac.uk writes:
>...... The children are executing simultaneously, so the parent uses
>non-blocking reads, polling each pipe to see if anything has arrived.
>Unfortunately, a call to 'read' returns zero if the child hasn't
>sent any new data *OR* if the child has terminated so the parent cannot
>distinguish between EOF on a pipe and a pipe that temporarily has no
>data in it.

If you have BSD, you can use select instead of polling.  Then do a
blocking read on the selected channels, which will either have data or
an EOF condition.

-Mark
-- 
Mark Benard
Department of Computer Science     INTERNET & BITNET: mb at cs.tulane.edu
Tulane University                  USENET:   rex!mb
New Orleans, LA 70118



More information about the Comp.unix.questions mailing list