From owner-freebsd-fs Sat Mar 17 8: 1:47 2001 Delivered-To: freebsd-fs@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id A857D37B718 for ; Sat, 17 Mar 2001 08:01:42 -0800 (PST) (envelope-from roam@orbitel.bg) Received: (qmail 911 invoked by uid 1000); 17 Mar 2001 16:00:55 -0000 Date: Sat, 17 Mar 2001 18:00:55 +0200 From: Peter Pentchev To: Dag-Erling Smorgrav Cc: Tony Finch , Duncan Barclay , Kris Kennaway , hackers@FreeBSD.ORG, fs@FreeBSD.ORG Subject: Re: httpfs Message-ID: <20010317180055.A486@ringworld.oblivion.bg> Mail-Followup-To: Dag-Erling Smorgrav , Tony Finch , Duncan Barclay , Kris Kennaway , hackers@FreeBSD.ORG, fs@FreeBSD.ORG References: <20010310031515.A8998@mollari.cthul.hu> <20010315095533.C12432@ringworld.oblivion.bg> <000d01c0ad3c$0ed83fb0$d26020c2@Cadence.COM> <000d01c0ad3c$0ed83fb0$d26020c2@Cadence.COM> <20010315124244.A442@ringworld.oblivion.bg> <20010316054649.F385@hand.dotat.at> <20010316174424.A428@ringworld.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from des@ofug.org on Sat, Mar 17, 2001 at 04:53:34PM +0100 Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Sat, Mar 17, 2001 at 04:53:34PM +0100, Dag-Erling Smorgrav wrote: > Peter Pentchev 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 majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message