From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <140e7ec30810070048u52f0fe01vad5de85c01785ca7@mail.gmail.com> Date: Tue, 7 Oct 2008 15:48:01 +0800 From: sqweek To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> In-Reply-To: <1223351261.19902.22.camel@goose.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1223061499.22031.9.camel@goose.sun.com> <1223351261.19902.22.camel@goose.sun.com> Subject: Re: [9fans] mounting stdin using 9pfuse Topicbox-Message-UUID: 17bdc470-ead4-11e9-9d60-3106f5b1d025 On Tue, Oct 7, 2008 at 11:47 AM, Roman V. Shaposhnik wrote: > Here's a question thought: > by default 9pserve only listens on an AF_UNIX socket what > would be the best way to connect it to the AF_INET one? Enrico did some work on this, see http://9fans.net/archive/2008/06/150 ... which doesn't include the patch he attached: Index: src/cmd/9pserve.c =================================================================== --- src/cmd/9pserve.c (revision 707) +++ src/cmd/9pserve.c (working copy) @@ -136,7 +136,7 @@ void usage(void) { - fprint(2, "usage: 9pserve [-lnv] [-A aname afid] [-M msize] address\n"); + fprint(2, "usage: 9pserve [-c pipe] [-lnv] [-A aname afid] [-M msize] address\n"); fprint(2, "\treads/writes 9P messages on stdin/stdout\n"); threadexitsall("usage"); } @@ -157,6 +157,19 @@ ARGBEGIN{ default: usage(); + case 'c': + { + char* pipename = EARGF(usage()); + printf("pipename=\"%s\"\n", pipename); + + if((fd = dial(pipename, nil, nil, nil)) < 0) + sysfatal("dial %s: %r"); + dup(fd, 0); + dup(fd, 1); + if(fd > 1) + close(fd); + } + break; case 'A': attached = 1; xaname = EARGF(usage()); And this is the discussion he referred to: http://9fans.net/archive/2008/05/354 http://9fans.net/archive/2008/06/3 http://9fans.net/archive/2008/06/5 http://9fans.net/archive/2008/06/9 http://9fans.net/archive/2008/06/11 http://9fans.net/archive/2008/06/12 http://9fans.net/archive/2008/06/45 http://9fans.net/archive/2008/06/53 (Sometimes 9fans.net's lack of threading is a pain). -sqweek