10 _post1(Srv *s, char *name, char *mtpt, int flag)
14 p = emalloc9p(sizeof *p);
18 s->infd = s->outfd = p->fd[1];
22 if(postfd(name, s->srvfd) < 0)
23 sysfatal("postfd %s: %r", name);
38 rendezvous((ulong)s, 0);
48 * Normally the server is posting as the last thing it does
49 * before exiting, so the correct thing to do is drop into
50 * a different fd space and close the 9P server half of the
51 * pipe before trying to mount the kernel half. This way,
52 * if the file server dies, we don't have a ref to the 9P server
53 * half of the pipe. Then killing the other procs will drop
54 * all the refs on the 9P server half, and the mount will fail.
55 * Otherwise the mount hangs forever.
57 * Libthread in general and acme win in particular make
58 * it hard to make this fd bookkeeping work out properly,
59 * so leaveinfdopen is a flag that win sets to opt out of this
62 if(!p->s->leavefdsopen){
64 rendezvous((ulong)p->s, 0);
66 if(p->s->infd != p->s->outfd)
71 if(amount(p->s->srvfd, p->mtpt, p->flag, "") == -1)
72 sysfatal("mount %s: %r", p->mtpt);