aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/man4/9pserve.49
-rw-r--r--src/cmd/9pserve.c13
2 files changed, 20 insertions, 2 deletions
diff --git a/man/man4/9pserve.4 b/man/man4/9pserve.4
index 388f24b6..cd34d931 100644
--- a/man/man4/9pserve.4
+++ b/man/man4/9pserve.4
@@ -12,6 +12,10 @@
.I afid
]
[
+.B -c
+.I addr
+]
+[
.B -M
.I msize
]
@@ -73,6 +77,11 @@ used to implement
.B -a
option
.TP
+.B -c
+multiplex clients onto a single connection to
+.IR addr ,
+instead of standard input and output
+.TP
.B -M
do not initialize the connection with a
.B Tversion
diff --git a/src/cmd/9pserve.c b/src/cmd/9pserve.c
index 88e0f6fb..8e03843a 100644
--- a/src/cmd/9pserve.c
+++ b/src/cmd/9pserve.c
@@ -136,7 +136,7 @@ int cvtustat(Fcall*, uchar**, int);
void
usage(void)
{
- fprint(2, "usage: 9pserve [-lnv] [-A aname afid] [-M msize] address\n");
+ fprint(2, "usage: 9pserve [-lnv] [-A aname afid] [-c addr] [-M msize] address\n");
fprint(2, "\treads/writes 9P messages on stdin/stdout\n");
threadexitsall("usage");
}
@@ -146,7 +146,7 @@ extern int _threaddebuglevel;
void
threadmain(int argc, char **argv)
{
- char *file, *x;
+ char *file, *x, *addr;
int fd;
x = getenv("verbose9pserve");
@@ -166,6 +166,15 @@ threadmain(int argc, char **argv)
versioned = 1;
msize = atoi(EARGF(usage()));
break;
+ case 'c':
+ addr = netmkaddr(EARGF(usage()), "net", "9fs");
+ if((fd = dial(addr, nil, nil, nil)) < 0)
+ sysfatal("dial %s: %r", addr);
+ dup(fd, 0);
+ dup(fd, 1);
+ if(fd > 1)
+ close(fd);
+ break;
case 'n':
noauth = 1;
break;