summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-03-30 20:06:33 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-03-30 20:06:33 +0200
commit9c844d90e117c9cb7b7fc16e4b0741a0df88456c (patch)
treececcc3bfb5107ad2eb8ea94900053f410a6002b2
parentd9f65faf71ff09a3427309f8b69500280c481ac6 (diff)
lib9p: add Srv.start
-rw-r--r--sys/include/9p.h1
-rw-r--r--sys/man/2/9p6
-rw-r--r--sys/src/lib9p/srv.c3
3 files changed, 10 insertions, 0 deletions
diff --git a/sys/include/9p.h b/sys/include/9p.h
index 6cac480fb..a8fb1fdc1 100644
--- a/sys/include/9p.h
+++ b/sys/include/9p.h
@@ -195,6 +195,7 @@ struct Srv {
Tree* tree;
void (*destroyfid)(Fid*);
void (*destroyreq)(Req*);
+ void (*start)(Srv*);
void (*end)(Srv*);
void* aux;
diff --git a/sys/man/2/9p b/sys/man/2/9p
index 381308da4..dcff3e44a 100644
--- a/sys/man/2/9p
+++ b/sys/man/2/9p
@@ -52,6 +52,7 @@ typedef struct Srv {
void (*destroyfid)(Fid *fid);
void (*destroyreq)(Req *r);
+ void (*start)(Srv *s);
void (*end)(Srv *s);
void* aux;
@@ -721,6 +722,7 @@ has been sent.
.PP
.IR Destroyfid ,
.IR destroyreq ,
+.IR start ,
and
.I end
are auxiliary functions, not called in direct response to 9P requests.
@@ -751,6 +753,10 @@ is called to allow the program to dispose of the
.IB r -> aux
pointer.
.TP
+.I Start
+This gets called (from the forked service process)
+prior entering the 9P service loop.
+.TP
.I End
Once the 9P service loop has finished
(end of file been reached on the service pipe
diff --git a/sys/src/lib9p/srv.c b/sys/src/lib9p/srv.c
index 8c4b95389..33791cb18 100644
--- a/sys/src/lib9p/srv.c
+++ b/sys/src/lib9p/srv.c
@@ -765,6 +765,9 @@ srv(Srv *srv)
srv->fpool->srv = srv;
srv->rpool->srv = srv;
+ if(srv->start)
+ srv->start(srv);
+
srvwork(srv);
}