Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!rex!mb From: mb@rex.cs.tulane.edu (Mark Benard) Newsgroups: comp.unix.questions Subject: Re: Can a parent process determine its child's status ? Message-ID: <2377@rex.cs.tulane.edu> Date: 6 Mar 90 23:29:08 GMT References: <5090.25e135aa@mva.cs.liv.ac.uk> Reply-To: mb@rex.UUCP (Mark Benard) Organization: Computer Science Dept., Tulane Univ., New Orleans, LA Lines: 18 In article <5090.25e135aa@mva.cs.liv.ac.uk> adh@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@cs.tulane.edu Tulane University USENET: rex!mb New Orleans, LA 70118