On Sat, Mar 17, 2001 at 04:53:34PM +0100, Dag-Erling Smorgrav wrote:
> Peter Pentchev <[EMAIL PROTECTED]> writes:
> > There was at the time - socketpair(2) had totally slipped my mind ;)
>
> Umm, you want pipe(2), not socketpair(2).
Actually, I want socketpair(2). pipe(2) was what I used before,
and that's the reason I had a read-only file descriptor - the portalfs
architecture allows for only one fd to be returned, and pipe(2)
provides a one-way pipe. I dup2'd stdout and stderr of the executed
program to the child fd, and the parent could read its output, yet
not write to its stdin.
With socketpair(2), I can dup stdin, too, and have mount_portal return
a two-way pipe/fd/socket to whoever requested it. At least, that's
the common/standard/easiest way to create a two-way pipe on the same
fd, described in APUE :)
G'luck,
Peter
--
This would easier understand fewer had omitted.
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message