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);
60 _postsharesrv(Srv *s, char *name, char *mtpt, char *desc)
67 s->infd = s->outfd = fd[1];
71 if(postfd(name, s->srvfd) < 0)
72 sysfatal("postfd %s: %r", name);
75 sysfatal("no forker");
76 _forker(postproc, s, RFNAMEG);
79 * Normally the server is posting as the last thing it does
80 * before exiting, so the correct thing to do is drop into
81 * a different fd space and close the 9P server half of the
82 * pipe before trying to mount the kernel half. This way,
83 * if the file server dies, we don't have a ref to the 9P server
84 * half of the pipe. Then killing the other procs will drop
85 * all the refs on the 9P server half, and the mount will fail.
86 * Otherwise the mount hangs forever.
88 * Libthread in general and acme win in particular make
89 * it hard to make this fd bookkeeping work out properly,
90 * so leaveinfdopen is a flag that win sets to opt out of this
97 if(s->infd != s->outfd)
102 if(sharefd(mtpt, desc, s->srvfd) < 0)
103 sysfatal("sharefd %s: %r", mtpt);
115 if(!s->leavefdsopen){