UNIX commands in C
Michael Stefanik
mike at bria.UUCP
Thu May 2 16:34:56 AEST 1991
In article <174 at 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?
More information about the Comp.unix.questions
mailing list