plan9port/src/lib9p/tpost.c

31 lines
502 B
C
Raw Normal View History

#include <u.h>
#include <libc.h>
#include <fcall.h>
#include <thread.h>
#include <9p.h>
2005-02-11 17:00:06 +00:00
static void
launchsrv(void *v)
{
srv(v);
}
void
threadpostmountsrv(Srv *s, char *name, char *mtpt, int flag)
{
2005-02-11 17:00:06 +00:00
int fd[2];
2005-02-11 17:00:06 +00:00
if(mtpt)
sysfatal("mount not supported");
2005-02-11 17:00:06 +00:00
if(!s->nopipe){
if(pipe(fd) < 0)
sysfatal("pipe: %r");
s->infd = s->outfd = fd[1];
s->srvfd = fd[0];
}
if(name && post9pservice(s->srvfd, name) < 0)
sysfatal("post9pservice %s: %r", name);
proccreate(launchsrv, s, 32*1024);
}