system (and popen)
Doug Gwyn
gwyn at brl-smoke.ARPA
Mon Jan 25 08:35:09 AEST 1988
In article <569 at cresswell.quintus.UUCP> ok at quintus.UUCP (Richard A. O'Keefe) writes:
>>But, if their command is a shell script, exec() will fail.
>BSD UNIX doesn't have this restriction; that is a System V "feature".
This Berkeley feature requires that the script start with
an appropriate #! line; not all scripts do. The #! line
contains system-specific (non-portable) instructions, in
general. For example, someone just reported a problem
when he used a copy of one of my #!/usr/5bin/sh scripts
on a Sun workstation (which didn't have /usr/5bin/sh).
>{Why isn't there a popen() which gives me *two*
>stdio streams, one to each end of the command?}
Because this isn't generally helpful; if you don't carefully
design an IPC protocol, deadlock can easily result.
If you keep your "packets" below the pipe buffer size,
and use a strict alternation of (write, then read), then
such a connection should work. But a naive programmer
will just get in trouble with such a facility.
More information about the Comp.lang.c
mailing list