Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!mucs!liv-cs!adh From: adh@mva.cs.liv.ac.uk Newsgroups: comp.unix.questions Subject: Can a parent process determine its child's status ? Message-ID: <5090.25e135aa@mva.cs.liv.ac.uk> Date: 20 Feb 90 12:18:50 GMT Organization: Computer Science CSMVAX, Liverpool University Lines: 23 Does anyone know how a parent process can determine the status of one of its children if it *hasn't* executed a wait ? It could arrange to catch a SIGCLD signal, but if the parent had several children it wouldn't know which one had sent it the SIGCLD ... would it ? My reason for asking is as follows: I need to write a program which starts several children and reads from their respective stdout's via pipes. 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. Any advice and suggestions would be appreciated. Thanks David Harper University of Liverpool Computer Laboratory Liverpool, U.K. Preferred path for email replies: qq68@liverpool.ac.uk