8 static void postproc(void*);
11 _postmountsrv(Srv *s, char *name, char *mtpt, int flag)
18 s->infd = s->outfd = fd[1];
22 if(postfd(name, s->srvfd) < 0)
23 sysfatal("postfd %s: %r", name);
26 sysfatal("no forker");
27 _forker(postproc, s, RFNAMEG);
30 * Normally the server is posting as the last thing it does
31 * before exiting, so the correct thing to do is drop into
32 * a different fd space and close the 9P server half of the
33 * pipe before trying to mount the kernel half. This way,
34 * if the file server dies, we don't have a ref to the 9P server
35 * half of the pipe. Then killing the other procs will drop
36 * all the refs on the 9P server half, and the mount will fail.
37 * Otherwise the mount hangs forever.
39 * Libthread in general and acme win in particular make
40 * it hard to make this fd bookkeeping work out properly,
41 * so leaveinfdopen is a flag that win sets to opt out of this
48 if(s->infd != s->outfd)
53 if(amount(s->srvfd, mtpt, flag, "") == -1)
54 sysfatal("mount %s: %r", mtpt);