tLib9.h updated to support plumber from Caerwyn Jones. (New lib9.h expected soon.) - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit b3161d97b017728799c72fba3563d32126b72d49
 (DIR) parent 3d7e9092a436b707f2160fb869ab68e2a222bc4e
 (HTM) Author: rsc <devnull@localhost>
       Date:   Tue, 14 Oct 2003 02:36:15 +0000
       
       Lib9.h updated to support plumber from Caerwyn Jones.
       (New lib9.h expected soon.)
       
       Diffstat:
         M include/lib9.h                      |      40 +++++++++++++++++++++++++++++++
       
       1 file changed, 40 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/include/lib9.h b/include/lib9.h
       t@@ -69,6 +69,15 @@ typedef unsigned int u32int;
        typedef unsigned long long uvlong;
        typedef long long vlong;
        
       +#define NAMELEN        28
       +#define CHDIR                0x80000000        /* mode bit for directories */
       +#define CHAPPEND        0x40000000        /* mode bit for append only files */
       +#define CHEXCL                0x20000000        /* mode bit for exclusive use files */
       +#define CHMOUNT                0x10000000        /* mode bit for mounted channel */
       +#define CHREAD                0x4                /* mode bit for read permission */
       +#define CHWRITE                0x2                /* mode bit for write permission */
       +#define CHEXEC                0x1                /* mode bit for execute permission */
       +
        /* rfork to create new process running fn(arg) */
        
        #if defined(__FreeBSD__)
       t@@ -174,6 +183,35 @@ extern int                rwakeupall(Rendez*);
        
        extern ulong        rendezvous(ulong, ulong);
        
       +typedef        struct        Qid        Qid;
       +typedef        struct        Dir        Dir;
       +
       +struct        Qid
       +{
       +        ulong        path;
       +        ulong        vers;
       +};
       +
       +struct Dir
       +{
       +        char        name[NAMELEN];
       +        char        uid[NAMELEN];
       +        char        gid[NAMELEN];
       +        Qid        qid;
       +        ulong        mode;
       +        long        atime;
       +        long        mtime;
       +        vlong        length;
       +        ushort        type;
       +        ushort        dev;
       +};
       +
       +extern        int        dirstat(char*, Dir*);
       +extern        int        dirfstat(int, Dir*);
       +extern        int        dirwstat(char*, Dir*);
       +extern        int        dirfwstat(int, Dir*);
       +
       +
        /* one of a kind */
        extern void        sysfatal(char*, ...);
        extern int        nrand(int);
       t@@ -185,6 +223,7 @@ extern long        readn(int, void*, long);
        extern void        exits(char*);
        extern void        _exits(char*);
        extern ulong        getcallerpc(void*);
       +extern        char*        cleanname(char*);
        
        /* string routines */
        extern char*        strecpy(char*, char*, char*);
       t@@ -242,6 +281,7 @@ extern void __fixargv0(void);
        
        #define OREAD O_RDONLY
        #define OWRITE O_WRONLY
       +#define ORDWR        O_RDWR
        #define AEXIST 0
        #define AREAD 4
        #define AWRITE 2