]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/cwfs/all.h
grep: error if sbrk fails
[plan9front.git] / sys / src / cmd / cwfs / all.h
1 #include <u.h>
2 #include <libc.h>
3 #include <ctype.h>
4 #define Tfile Tfilescsi         /* avoid name conflict */
5 #include <disk.h>
6 #undef  Tfile
7 #include <bio.h>
8 #include <ip.h>
9
10 #include "dat.h"
11 #include "portfns.h"
12
13 #define CHAT(cp) ((cons.flags&chatflag) || \
14                         ((cp) && (((Chan*)(cp))->flags&chatflag)))
15 #define QID9P1(a,b)     (Qid9p1){a,b}
16
17 #define SECOND(n)       (n)
18 #define MINUTE(n)       ((n)*SECOND(60))
19 #define HOUR(n)         ((n)*MINUTE(60))
20 #define DAY(n)          ((n)*HOUR(24))
21
22 enum {
23         QPDIR           = 0x80000000L,
24         QPNONE          = 0,
25         QPROOT          = 1,
26         QPSUPER         = 2,
27
28         FID1            = 1,
29         FID2            = 2,
30
31         MAXBIAS         = SECOND(20),
32         TLOCK           = MINUTE(5),
33 };
34
35 Uid*    uid;
36 short*  gidspace;
37 Lock    printing;
38 Time    tim;
39 File*   files;
40 Wpath*  wpaths;
41 Lock    wpathlock;
42 char*   errstr9p[MAXERR];
43 Chan*   chans;
44 RWLock  mainlock;
45 Timet   fs_mktime;
46 Timet   boottime;
47 Queue*  serveq;
48 Queue*  raheadq;
49 Rabuf*  rabuffree;
50 QLock   reflock;
51 Lock    rabuflock;
52 Tlock   tlocks[NTLOCK];
53 Lock    tlocklock;
54 Device* devnone;
55 Startsb startsb[5];
56 int     mballocs[MAXCAT];
57
58 /* from config block */
59 char    service[50];            /* my name */
60 Filsys  filsys[30];             /* named file systems */
61 /*
62  * these are only documentation, but putting them in the config block makes
63  * them visible.  the real values are compiled into cwfs.
64  */
65 typedef struct Fspar Fspar;
66 struct Fspar {
67         char*   name;
68         long    actual;         /* compiled-in value */
69         long    declared;
70 } fspar[];
71
72 ulong   roflag;
73 ulong   errorflag;
74 ulong   chatflag;
75 ulong   authdebugflag;
76 int     noattach;               /* attach is disabled */
77 int     noauth;                 /* auth is disable */
78 int     nonone;                 /* attach as none disabled */
79 int     noatime;                /* atime is disabled */
80 int     noatimeset;             /* noatime was changed (reset after dump) */
81 int     allowed;                /* allow wstat and disable permission checks
82                                  * for user or anyone when -1 */
83 int     duallow;                /* single user to allow du */
84 int     readonly;               /* disable writes if true */
85 int     rawreadok;              /* allow reading raw data */
86
87 File*   flist[5003];            /* base of file structures */
88 Lock    flock;                  /* manipulate flist */
89
90 long    growacct[1000];
91
92 struct
93 {
94         RWLock  uidlock;
95         Iobuf*  uidbuf;
96         int     flen;
97         int     find;
98 } uidgc;
99
100 extern  char    statecall[];
101 extern  char*   wormscode[];
102 extern  char*   tagnames[];