Xref: utzoo comp.unix.questions:30988 comp.lang.c:38970 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!zaphod.mps.ohio-state.edu!wuarchive!uunet!bria!mike From: mike@bria.UUCP (Michael Stefanik) Newsgroups: comp.unix.questions,comp.lang.c Subject: Re: UNIX commands in C Message-ID: <239@bria.UUCP> Date: 2 May 91 06:34:56 GMT References: <1991Apr28.153127.24926@jack.sns.com> <174@shasta.Stanford.EDU> Reply-To: uunet!bria!mike Followup-To: comp.unix.questions Organization: MGI Group International, Los Angeles, CA Lines: 48 In article <174@shasta.Stanford.EDU> you write: |1. Parent program does a popen(3), and happily starts writing | to the pipe, assuming that it should dump the whole of the | input into the child program. | | [ etc, etc on how the process will eventually block ] The popen() will either create the pipe for reading *or* for writing, not both. Therefore, unless your popened command does some pipelining or is blocked on a device, the deadlock situation that you describe cannot occur. (ie: if the parent popens a filter for writing, the parent may only write and never read on the pipe, while the child may only read and never write on the pipe). Michael Stefanik, MGI Inc, Los Angeles | Opinions stated are never realistic Title of the week: Systems Engineer | UUCP: ...!uunet!bria!mike ------------------------------------------------------------------------------- If MS-DOS didn't exist, who would UNIX programmers have to make fun of?