]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/include/9p.h
libc: use usize for sbrk() increment
[plan9front.git] / sys / include / 9p.h
index 17f4e105fdd9c5927f542aecf45e03839a843f57..bfbe0d7ec73320b1b6c1aa583c16169bd9911f53 100644 (file)
@@ -44,7 +44,7 @@ struct Reqqueue
        QLock;
        Rendez;
        Queueelem;
-       int pid;
+       int pid, flush;
        Req *cur;
 };
 
@@ -152,7 +152,6 @@ struct Tree {
 /* below is implementation-specific; don't use */
        Lock genlock;
        ulong qidgen;
-       ulong dirqidgen;
 };
 
 Tree*  alloctree(char*, char*, ulong, void(*destroy)(File*));
@@ -162,7 +161,7 @@ int         removefile(File*);
 void           closefile(File*);
 File*          walkfile(File*, char*);
 Readdir*       opendirfile(File*);
-long           readdirfile(Readdir*, uchar*, long);
+long           readdirfile(Readdir*, uchar*, long, long);
 void           closedirfile(Readdir*);
 
 /*
@@ -195,6 +194,7 @@ struct Srv {
        Tree*   tree;
        void            (*destroyfid)(Fid*);
        void            (*destroyreq)(Req*);
+       void            (*start)(Srv*);
        void            (*end)(Srv*);
        void*   aux;
 
@@ -214,9 +214,6 @@ struct Srv {
 
        int             infd;
        int             outfd;
-       int             nopipe;
-       int             srvfd;
-       int             leavefdsopen;   /* magic for acme win */
        char*   keyspec;
 
 /* below is implementation-specific; don't use */
@@ -232,25 +229,34 @@ struct Srv {
        char*   addr;
 
        QLock   slock;
-       Ref     sref;
+       Ref     sref;   /* srvwork procs */
+       Ref     rref;   /* requests in flight */
+
+       int     spid;   /* pid of srv() caller */
+
+       void    (*forker)(void (*)(void*), void*, int);
+       void    (*free)(Srv*);
 };
 
+void           srvforker(void (*)(void*), void*, int);
+void           threadsrvforker(void (*)(void*), void*, int);
+
 void           srv(Srv*);
+int            postsrv(Srv*, char*);
 void           postmountsrv(Srv*, char*, char*, int);
-void           _postmountsrv(Srv*, char*, char*, int);
 void           postsharesrv(Srv*, char*, char*, char*);
-void           _postsharesrv(Srv*, char*, char*, char*);
 void           listensrv(Srv*, char*);
-void           _listensrv(Srv*, char*);
-int            postfd(char*, int);
-int            sharefd(char*, char*, int);
-int            chatty9p;
-void           respond(Req*, char*);
-void           responderror(Req*);
+
+void           threadsrv(Srv*);
+int            threadpostsrv(Srv*, char*);
 void           threadpostmountsrv(Srv*, char*, char*, int);
 void           threadpostsharesrv(Srv*, char*, char*, char*);
 void           threadlistensrv(Srv *s, char *addr);
 
+int            chatty9p;
+void           respond(Req*, char*);
+void           responderror(Req*);
+
 /*
  * Helper.  Assumes user is same as group.
  */
@@ -275,12 +281,10 @@ void              authwrite(Req*);
 void           authdestroy(Fid*);
 int            authattach(Req*);
 
-extern void (*_forker)(void (*)(void*), void*, int);
-
 void           srvacquire(Srv *);
 void           srvrelease(Srv *);
 
 Reqqueue*      reqqueuecreate(void);
 void           reqqueuepush(Reqqueue*, Req*, void (*)(Req *));
 void           reqqueueflush(Reqqueue*, Req*);
-int            reqqueueflushed(void);
+void           reqqueuefree(Reqqueue*);