tsys.h - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
tsys.h (2570B)
---
     1 /*
     2  * System dependent header files for research
     3  */
     4 
     5 #include 
     6 #include 
     7 #include 
     8 #include 
     9 #include 
    10 
    11 /*
    12  *  for the lock routines in libsys.c
    13  */
    14 typedef struct Mlock        Mlock;
    15 struct Mlock {
    16         int fd;
    17         int pid;
    18         String *name;
    19 };
    20 
    21 /*
    22  *  from config.c - call upasconfig() before using
    23  */
    24 extern char *_MAILROOT;        /* root of mail system */
    25 extern char *_UPASLOG;        /* log directory */
    26 extern char *_UPASLIB;        /* upas library directory */
    27 extern char *_UPASBIN;        /* upas binary directory */
    28 extern char *_UPASTMP;        /* temporary directory */
    29 extern char *_SHELL;        /* path name of shell */
    30 extern char *_POST;        /* path name of post server addresses */
    31 extern int MBOXMODE;        /* default mailbox protection mode */
    32 extern void upasconfig(void);
    33 
    34 /* forgive me */
    35 #define        MAILROOT        (upasconfig(), _MAILROOT)
    36 #define        UPASLOG        (upasconfig(), _UPASLOG)
    37 #define        UPASLIB        (upasconfig(), _UPASLIB)
    38 #define        UPASBIN        (upasconfig(), _UPASBIN)
    39 #define        UPASTMP        (upasconfig(), _UPASTMP)
    40 #define        SHELL        (upasconfig(), _SHELL)
    41 #define        POST        (upasconfig(), _POST)
    42 
    43 /*
    44  *  files in libsys.c
    45  */
    46 extern char        *sysname_read(void);
    47 extern char        *alt_sysname_read(void);
    48 extern char        *domainname_read(void);
    49 extern char        **sysnames_read(void);
    50 extern char        *getlog(void);
    51 extern char        *thedate(void);
    52 extern Biobuf        *sysopen(char*, char*, ulong);
    53 extern int        sysopentty(void);
    54 extern int        sysclose(Biobuf*);
    55 extern int        sysmkdir(char*, ulong);
    56 extern int        syschgrp(char*, char*);
    57 extern Mlock        *syslock(char *);
    58 extern void        sysunlock(Mlock *);
    59 extern void        syslockrefresh(Mlock *);
    60 extern int        e_nonexistent(void);
    61 extern int        e_locked(void);
    62 extern long        sysfilelen(Biobuf*);
    63 extern int        sysremove(char*);
    64 extern int        sysrename(char*, char*);
    65 extern int        sysexist(char*);
    66 extern int        sysisdir(char*);
    67 extern int        syskill(int);
    68 extern int        syskillpg(int);
    69 extern int        syscreate(char*, int, ulong);
    70 extern Mlock        *trylock(char *);
    71 extern void        pipesig(int*);
    72 extern void        pipesigoff(void);
    73 extern int        holdon(void);
    74 extern void        holdoff(int);
    75 extern int        syscreatelocked(char*, int, int);
    76 extern int        sysopenlocked(char*, int);
    77 extern int        sysunlockfile(int);
    78 extern int        sysfiles(void);
    79 extern int         become(char**, char*);
    80 extern int        sysdetach(void);
    81 extern int        sysdirreadall(int, Dir**);
    82 extern String        *username(String*);
    83 extern char*        remoteaddr(int, char*);
    84 extern int        creatembox(char*, char*);
    85 
    86 extern String        *readlock(String*);
    87 extern char        *homedir(char*);
    88 extern String        *mboxname(char*, String*);
    89 extern String        *deadletter(String*);
    90 
    91 /*
    92  *  maximum size for a file path
    93  */
    94 #define MAXPATHLEN 128