home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / mint104s.zoo / mint.src / file.h < prev    next >
C/C++ Source or Header  |  1993-03-08  |  17KB  |  526 lines

  1. /*
  2. Copyright 1991,1992 Eric R. Smith.
  3. Copyright 1992 Atari Corporation.
  4. All rights reserved.
  5. */
  6.  
  7. #ifndef _filesys_h
  8. #define _filesys_h
  9.  
  10. struct filesys;        /* forward declaration */
  11. struct devdrv;        /* ditto */
  12.  
  13. typedef struct f_cookie {
  14.     struct filesys *fs;    /* filesystem that knows about this cookie */
  15.     ushort    dev;        /* device info (e.g. Rwabs device number) */
  16.     ushort    aux;        /* extra data that the file system may want */
  17.     long    index;        /* this+dev uniquely identifies a file */
  18. } fcookie;
  19.  
  20. #define TOS_NAMELEN 13
  21.  
  22. typedef struct dtabuf {
  23.     short    index;        /* index into arrays in the PROC struct */
  24.     long    magic;
  25. #define SVALID    0x1234fedcL    /* magic for a valid search */
  26. #define EVALID    0x5678ba90L    /* magic for an exhausted search */
  27.  
  28.     char    dta_pat[TOS_NAMELEN+1];    /* pointer to pattern, if necessary */
  29.     char    dta_sattrib;    /* attributes being searched for */
  30. /* this stuff is returned to the user */
  31.     char    dta_attrib;
  32.     short    dta_time;
  33.     short    dta_date;
  34.     long    dta_size;
  35.     char    dta_name[TOS_NAMELEN+1];
  36. } DTABUF;
  37.  
  38. /* structure for opendir/readdir/closedir */
  39. typedef struct dirstruct {
  40.     fcookie fc;        /* cookie for this directory */
  41.     ushort    index;        /* index of the current entry */
  42.     ushort    flags;        /* flags (e.g. tos or not) */
  43. #define TOS_SEARCH    0x01
  44.     char    fsstuff[60];    /* anything else the file system wants */
  45.                 /* NOTE: this must be at least 45 bytes */
  46.     struct dirstruct *next;    /* linked together so we can close them
  47.                    on process termination */
  48. } DIR;
  49.  
  50. /* structure for getxattr */
  51. typedef struct xattr {
  52.     ushort    mode;
  53. /* file types */
  54. #define S_IFMT    0170000        /* mask to select file type */
  55. #define S_IFCHR    0020000        /* BIOS special file */
  56. #define S_IFDIR    0040000        /* directory file */
  57. #define S_IFREG 0100000        /* regular file */
  58. #define S_IFIFO 0120000        /* FIFO */
  59. #define S_IMEM    0140000        /* memory region or process */
  60. #define S_IFLNK    0160000        /* symbolic link */
  61.  
  62. /* special bits: setuid, setgid, sticky bit */
  63. #define S_ISUID    04000
  64. #define S_ISGID 02000
  65. #define S_ISVTX    01000
  66.  
  67. /* file access modes for user, group, and other*/
  68. #define S_IRUSR    0400
  69. #define S_IWUSR 0200
  70. #define S_IXUSR 0100
  71. #define S_IRGRP 0040
  72. #define S_IWGRP    0020
  73. #define S_IXGRP    0010
  74. #define S_IROTH    0004
  75. #define S_IWOTH    0002
  76. #define S_IXOTH    0001
  77. #define DEFAULT_DIRMODE (0777)
  78. #define DEFAULT_MODE    (0666)
  79.     long    index;
  80.     ushort    dev;
  81.     ushort    reserved1;
  82.     ushort    nlink;
  83.     ushort    uid;
  84.     ushort    gid;
  85.     long    size;
  86.     long    blksize;
  87.     long    nblocks;
  88.     short    mtime, mdate;
  89.     short    atime, adate;
  90.     short    ctime, cdate;
  91.     short    attr;
  92. /* defines for TOS attribute bytes */
  93. #ifndef FA_RDONLY
  94. #define           FA_RDONLY           0x01
  95. #define           FA_HIDDEN           0x02
  96. #define           FA_SYSTEM           0x04
  97. #define           FA_LABEL               0x08
  98. #define           FA_DIR               0x10
  99. #define           FA_CHANGED           0x20
  100. #endif
  101.     short    reserved2;
  102.     long    reserved3[2];
  103. } XATTR;
  104.  
  105. typedef struct fileptr {
  106.     short    links;        /* number of copies of this descriptor */
  107.     ushort    flags;        /* file open mode and other file flags */
  108.     long    pos;        /* position in file */
  109.     long    devinfo;    /* device driver specific info */
  110.     fcookie    fc;        /* file system cookie for this file */
  111.     struct devdrv *dev; /* device driver that knows how to deal with this */
  112.     struct fileptr *next; /* link to next fileptr for this file */
  113. } FILEPTR;
  114.  
  115. struct flock {
  116.     short l_type;            /* type of lock */
  117. #define F_RDLCK        0
  118. #define F_WRLCK        1
  119. #define F_UNLCK        3
  120.     short l_whence;            /* SEEK_SET, SEEK_CUR, SEEK_END */
  121.     long l_start;            /* start of locked region */
  122.     long l_len;            /* length of locked region */
  123.     short l_pid;            /* pid of locking process
  124.                         (F_GETLK only) */
  125. };
  126.  
  127. /* structure for internal kernel locks */
  128. typedef struct ilock {
  129.     struct flock l;        /* the actual lock */
  130.     struct ilock *next;    /* next lock in the list */
  131.     long    reserved[4];    /* reserved for future expansion */
  132. } LOCK;
  133.  
  134. typedef struct devdrv {
  135.     long ARGS_ON_STACK (*open)    P_((FILEPTR *f));
  136.     long ARGS_ON_STACK (*write)    P_((FILEPTR *f, const char *buf, long bytes));
  137.     long ARGS_ON_STACK (*read)    P_((FILEPTR *f, char *buf, long bytes));
  138.     long ARGS_ON_STACK (*lseek)    P_((FILEPTR *f, long where, int whence));
  139.     long ARGS_ON_STACK (*ioctl)    P_((FILEPTR *f, int mode, void *buf));
  140.     long ARGS_ON_STACK (*datime)    P_((FILEPTR *f, short *timeptr, int rwflag));
  141.     long ARGS_ON_STACK (*close)    P_((FILEPTR *f, int pid));
  142.     long ARGS_ON_STACK (*select)    P_((FILEPTR *f, long proc, int mode));
  143.     void ARGS_ON_STACK (*unselect) P_((FILEPTR *f, long proc, int mode));
  144. } DEVDRV;
  145.  
  146. typedef struct filesys {
  147.     struct    filesys    *next;    /* link to next file system on chain */
  148.     long    fsflags;
  149. #define FS_KNOPARSE    0x01    /* kernel shouldn't do parsing */
  150. #define FS_CASESENSITIVE    0x02    /* file names are case sensitive */
  151. #define FS_NOXBIT    0x04    /* if a file can be read, it can be executed */
  152. #define    FS_LONGPATH    0x08    /* file system understands "size" argument to
  153.                    "getname" */
  154.     long    ARGS_ON_STACK (*root) P_((int drv, fcookie *fc));
  155.     long    ARGS_ON_STACK (*lookup) P_((fcookie *dir, const char *name, fcookie *fc));
  156.     long    ARGS_ON_STACK (*creat) P_((fcookie *dir, const char *name, unsigned mode,
  157.                 int attrib, fcookie *fc));
  158.     DEVDRV * ARGS_ON_STACK (*getdev) P_((fcookie *fc, long *devspecial));
  159.     long    ARGS_ON_STACK (*getxattr) P_((fcookie *file, XATTR *xattr));
  160.     long    ARGS_ON_STACK (*chattr) P_((fcookie *file, int attr));
  161.     long    ARGS_ON_STACK (*chown) P_((fcookie *file, int uid, int gid));
  162.     long    ARGS_ON_STACK (*chmode) P_((fcookie *file, unsigned mode));
  163.     long    ARGS_ON_STACK (*mkdir) P_((fcookie *dir, const char *name, unsigned mode));
  164.     long    ARGS_ON_STACK (*rmdir) P_((fcookie *dir, const char *name));
  165.     long    ARGS_ON_STACK (*remove) P_((fcookie *dir, const char *name));
  166.     long    ARGS_ON_STACK (*getname) P_((fcookie *relto, fcookie *dir,
  167.                 char *pathname, int size));
  168.     long    ARGS_ON_STACK (*rename) P_((fcookie *olddir, char *oldname,
  169.                 fcookie *newdir, const char *newname));
  170.     long    ARGS_ON_STACK (*opendir) P_((DIR *dirh, int tosflag));
  171.     long    ARGS_ON_STACK (*readdir) P_((DIR *dirh, char *name, int namelen, fcookie *fc));
  172.     long    ARGS_ON_STACK (*rewinddir) P_((DIR *dirh));
  173.     long    ARGS_ON_STACK (*closedir) P_((DIR *dirh));
  174.     long    ARGS_ON_STACK (*pathconf) P_((fcookie *dir, int which));
  175.     long    ARGS_ON_STACK (*dfree) P_((fcookie *dir, long *buf));
  176.     long    ARGS_ON_STACK (*writelabel) P_((fcookie *dir, const char *name));
  177.     long    ARGS_ON_STACK (*readlabel) P_((fcookie *dir, char *name, int namelen));
  178.     long    ARGS_ON_STACK (*symlink) P_((fcookie *dir, const char *name, const char *to));
  179.     long    ARGS_ON_STACK (*readlink) P_((fcookie *dir, char *buf, int len));
  180.     long    ARGS_ON_STACK (*hardlink) P_((fcookie *fromdir, const char *fromname,
  181.                 fcookie *todir, const char *toname));
  182.     long    ARGS_ON_STACK (*fscntl) P_((fcookie *dir, const char *name, int cmd, long arg));
  183.     long    ARGS_ON_STACK (*dskchng) P_((int drv));
  184.     long    ARGS_ON_STACK (*release) P_((fcookie *));
  185.     long    ARGS_ON_STACK (*dupcookie) P_((fcookie *new, fcookie *old));
  186. } FILESYS;
  187.  
  188. /*
  189.  * this is the structure passed to loaded file systems to tell them
  190.  * about the kernel
  191.  */
  192.  
  193. struct kerinfo {
  194.     short    maj_version;    /* kernel version number */
  195.     short    min_version;    /* minor kernel version number */
  196.     ushort    default_perm;    /* default file permissions */
  197.     short    reserved1;    /* room for expansion */
  198.  
  199. /* OS functions */
  200.     Func    *bios_tab;    /* pointer to the BIOS entry points */
  201.     Func    *dos_tab;    /* pointer to the GEMDOS entry points */
  202.  
  203. /* media change vector */
  204.     void    ARGS_ON_STACK (*drvchng) P_((unsigned));
  205.  
  206. /* Debugging stuff */
  207.     void    ARGS_ON_STACK (*trace) P_((const char *, ...));
  208.     void    ARGS_ON_STACK (*debug) P_((const char *, ...));
  209.     void    ARGS_ON_STACK (*alert) P_((const char *, ...));
  210.     EXITING void ARGS_ON_STACK (*fatal) P_((const char *, ...));
  211.  
  212. /* memory allocation functions */
  213.     void *    ARGS_ON_STACK (*kmalloc) P_((long));
  214.     void    ARGS_ON_STACK (*kfree) P_((void *));
  215.     void *    ARGS_ON_STACK (*umalloc) P_((long));
  216.     void    ARGS_ON_STACK (*ufree) P_((void *));
  217.  
  218. /* utility functions for string manipulation */
  219.     int    ARGS_ON_STACK (*strnicmp) P_((const char *, const char *, int));
  220.     int    ARGS_ON_STACK (*stricmp) P_((const char *, const char *));
  221.     char *    ARGS_ON_STACK (*strlwr) P_((char *));
  222.     char *    ARGS_ON_STACK (*strupr) P_((char *));
  223.     int    ARGS_ON_STACK (*sprintf) P_((char *, const char *, ...));
  224.  
  225. /* utility functions for manipulating time */
  226.     void    ARGS_ON_STACK (*millis_time) P_((unsigned long, short *));
  227.     long    ARGS_ON_STACK (*unixtim) P_((unsigned, unsigned));
  228.     long    ARGS_ON_STACK (*dostim) P_((long));
  229.  
  230. /* utility functions for dealing with pauses, or for putting processes
  231.  * to sleep
  232.  */
  233.     void    ARGS_ON_STACK (*nap) P_((unsigned));
  234.     void    ARGS_ON_STACK (*sleep) P_((int que, long cond));
  235.     void    ARGS_ON_STACK (*wake) P_((int que, long cond));
  236.     void    ARGS_ON_STACK (*wakeselect) P_((long param));
  237.  
  238. /* file system utility functions */
  239.     int    ARGS_ON_STACK (*denyshare) P_((FILEPTR *, FILEPTR *));
  240.  
  241. /* reserved for future use */
  242.     LOCK *    ARGS_ON_STACK (*denylock) P_((LOCK *, LOCK *));
  243.     long    res2[9];
  244. };
  245.  
  246. /* flags for open() modes */
  247. #define O_RWMODE      0x03    /* isolates file read/write mode */
  248. #    define O_RDONLY    0x00
  249. #    define O_WRONLY    0x01
  250. #    define O_RDWR    0x02
  251. #    define O_EXEC    0x03    /* execute file; used by kernel only */
  252.  
  253. /* 0x04 is for future expansion */
  254. #define O_APPEND    0x08    /* all writes go to end of file */
  255.  
  256. #define O_SHMODE    0x70    /* isolates file sharing mode */
  257. #    define O_COMPAT    0x00    /* compatibility mode */
  258. #    define O_DENYRW    0x10    /* deny both read and write access */
  259. #    define O_DENYW    0x20    /* deny write access to others */
  260. #    define O_DENYR    0x30    /* deny read access to others */
  261. #    define O_DENYNONE 0x40    /* don't deny any access to others */
  262.  
  263. #define O_NOINHERIT    0x80    /* private file (not passed to child) */
  264.  
  265. #define O_NDELAY    0x100    /* don't block for i/o on this file */
  266. #define O_CREAT        0x200    /* create file if it doesn't exist */
  267. #define O_TRUNC        0x400    /* truncate file to 0 bytes if it does exist */
  268. #define O_EXCL        0x800    /* fail open if file exists */
  269.  
  270. #define O_USER        0x0fff    /* isolates user-settable flag bits */
  271.  
  272. #define O_GLOBAL    0x1000    /* for opening a global file */
  273.  
  274. /* kernel mode bits -- the user can't set these! */
  275. #define O_TTY        0x2000
  276. #define O_HEAD        0x4000
  277. #define O_LOCK        0x8000
  278.  
  279. /* GEMDOS file attributes */
  280.  
  281. /* macros to be applied to FILEPTRS to determine their type */
  282. #define is_terminal(f) (f->flags & O_TTY)
  283.  
  284. /* lseek() origins */
  285. #define    SEEK_SET    0        /* from beginning of file */
  286. #define    SEEK_CUR    1        /* from current location */
  287. #define    SEEK_END    2        /* from end of file */
  288.  
  289. /* The requests for Dpathconf() */
  290. #define DP_IOPEN    0    /* internal limit on # of open files */
  291. #define DP_MAXLINKS    1    /* max number of hard links to a file */
  292. #define DP_PATHMAX    2    /* max path name length */
  293. #define DP_NAMEMAX    3    /* max length of an individual file name */
  294. #define DP_ATOMIC    4    /* # of bytes that can be written atomically */
  295. #define DP_TRUNC    5    /* file name truncation behavior */
  296. #    define    DP_NOTRUNC    0    /* long filenames give an error */
  297. #    define    DP_AUTOTRUNC    1    /* long filenames truncated */
  298. #    define    DP_DOSTRUNC    2    /* DOS truncation rules in effect */
  299. #define DP_CASE        6
  300. #    define    DP_CASESENS    0    /* case sensitive */
  301. #    define    DP_CASECONV    1    /* case always converted */
  302. #    define    DP_CASEINSENS    2    /* case insensitive, preserved */
  303. #define DP_MAXREQ    6    /* highest legal request */
  304.  
  305. /* Dpathconf and Sysconf return this when a value is not limited
  306.    (or is limited only by available memory) */
  307.  
  308. #define UNLIMITED    0x7fffffffL
  309.  
  310. /* various character constants and defines for TTY's */
  311. #define MiNTEOF 0x0000ff1a    /* 1a == ^Z */
  312.  
  313. /* defines for tty_read */
  314. #define RAW    0
  315. #define COOKED    0x1
  316. #define NOECHO    0
  317. #define ECHO    0x2
  318. #define ESCSEQ    0x04        /* cursor keys, etc. get escape sequences */
  319.  
  320. /* constants for Fcntl calls */
  321. #define F_DUPFD        0        /* handled by kernel */
  322. #define F_GETFD        1        /* handled by kernel */
  323. #define F_SETFD        2        /* handled by kernel */
  324. #    define FD_CLOEXEC    1    /* close on exec flag */
  325.  
  326. #define F_GETFL        3        /* handled by kernel */
  327. #define F_SETFL        4        /* handled by kernel */
  328. #define F_GETLK        5
  329. #define F_SETLK        6
  330. #define F_SETLKW    7
  331.  
  332. /* more constants for various Fcntl's */
  333. #define FSTAT        (('F'<< 8) | 0)        /* handled by kernel */
  334. #define FIONREAD    (('F'<< 8) | 1)
  335. #define FIONWRITE    (('F'<< 8) | 2)
  336. #define TIOCGETP    (('T'<< 8) | 0)
  337. #define TIOCSETP    (('T'<< 8) | 1)
  338. #define TIOCSETN    TIOCSETP
  339. #define TIOCGETC    (('T'<< 8) | 2)
  340. #define TIOCSETC    (('T'<< 8) | 3)
  341. #define TIOCGLTC    (('T'<< 8) | 4)
  342. #define TIOCSLTC    (('T'<< 8) | 5)
  343. #define TIOCGPGRP    (('T'<< 8) | 6)
  344. #define TIOCSPGRP    (('T'<< 8) | 7)
  345. #define TIOCFLUSH    (('T'<< 8) | 8)
  346. #define TIOCSTOP    (('T'<< 8) | 9)
  347. #define TIOCSTART    (('T'<< 8) | 10)
  348. #define TIOCGWINSZ    (('T'<< 8) | 11)
  349. #define TIOCSWINSZ    (('T'<< 8) | 12)
  350. #define TIOCGXKEY    (('T'<< 8) | 13)
  351. #define TIOCSXKEY    (('T'<< 8) | 14)
  352. #define TIOCIBAUD    (('T'<< 8) | 18)
  353. #define TIOCOBAUD    (('T'<< 8) | 19)
  354. #define TIOCCBRK    (('T'<< 8) | 20)
  355. #define TIOCSBRK    (('T'<< 8) | 21)
  356. #define TIOCGFLAGS    (('T'<< 8) | 22)
  357. #define TIOCSFLAGS    (('T'<< 8) | 23)
  358.  
  359. /* cursor control Fcntls:
  360.  * NOTE THAT THESE MUST BE TOGETHER
  361.  */
  362. #define TCURSOFF    (('c'<< 8) | 0)
  363. #define TCURSON        (('c'<< 8) | 1)
  364. #define TCURSBLINK    (('c'<< 8) | 2)
  365. #define TCURSSTEADY    (('c'<< 8) | 3)
  366. #define TCURSSRATE    (('c'<< 8) | 4)
  367. #define TCURSGRATE    (('c'<< 8) | 5)
  368.  
  369. /* process stuff */
  370. #define PPROCADDR    (('P'<< 8) | 1)
  371. #define PBASEADDR    (('P'<< 8) | 2)
  372. #define PCTXTSIZE    (('P'<< 8) | 3)
  373. #define PSETFLAGS    (('P'<< 8) | 4)
  374. #define PGETFLAGS    (('P'<< 8) | 5)
  375. #define PTRACESFLAGS    (('P'<< 8) | 6)
  376. #define PTRACEGFLAGS    (('P'<< 8) | 7)
  377. #    define    P_ENABLE    (1 << 0)    /* enable tracing */
  378. #ifdef NOTYETDEFINED
  379. #    define    P_DOS        (1 << 1)    /* trace DOS calls - unimplemented */
  380. #    define    P_BIOS        (1 << 2)    /* trace BIOS calls - unimplemented */
  381. #    define    P_XBIOS        (1 << 3)    /* trace XBIOS calls - unimplemented */
  382. #endif
  383.  
  384. #define PTRACEGO    (('P'<< 8) | 8)    /* these 4 must be together */
  385. #define PTRACEFLOW    (('P'<< 8) | 9)
  386. #define PTRACESTEP    (('P'<< 8) | 10)
  387. #define PTRACE11    (('P'<< 8) | 11)
  388.  
  389. #define SHMGETBLK    (('M'<< 8) | 0)
  390. #define SHMSETBLK    (('M'<< 8) | 1)
  391.  
  392. /* terminal control constants (tty.sg_flags) */
  393. #define T_CRMOD        0x0001
  394. #define T_CBREAK    0x0002
  395. #define T_ECHO        0x0004
  396. /* #define T_XTABS    0x0008  unimplemented*/
  397. #define T_RAW        0x0010
  398. /* #define T_LCASE    0x0020  unimplemented */
  399.  
  400. #define T_NOFLSH    0x0040        /* don't flush buffer when signals
  401.                        are received */
  402. #define T_TOS        0x0080
  403. #define T_TOSTOP    0x0100
  404. #define T_XKEY        0x0200        /* Fread returns escape sequences for
  405.                        cursor keys, etc. */
  406. /* 0x0400 and 0x0800 still available */
  407. #define T_TANDEM    0x1000
  408. #define T_RTSCTS    0x2000
  409. #define T_EVENP        0x4000        /* EVENP and ODDP are mutually exclusive */
  410. #define T_ODDP        0x8000
  411.  
  412. #define TF_FLAGS    0xF000
  413.  
  414. /* some flags for TIOC[GS]FLAGS */
  415. #define TF_STOPBITS    0x0003
  416. #define TF_1STOP    0x0001
  417. #define TF_15STOP    0x0002
  418. #define    TF_2STOP    0x0003
  419.  
  420. #define TF_CHARBITS    0x000C
  421. #define TF_8BIT        0
  422. #define TF_7BIT        0x4
  423. #define TF_6BIT        0x8
  424. #define TF_5BIT        0xC
  425.  
  426. /* the following are terminal status flags (tty.state) */
  427. /* (the low byte of tty.state indicates a part of an escape sequence still
  428.  * hasn't been read by Fread, and is an index into that escape sequence)
  429.  */
  430. #define TS_ESC        0x00ff
  431. #define TS_HOLD        0x1000        /* hold (e.g. ^S/^Q) */
  432. #define TS_COOKED    0x8000        /* interpret control chars */
  433.  
  434. /* structures for terminals */
  435. struct tchars {
  436.     char t_intrc;
  437.     char t_quitc;
  438.     char t_startc;
  439.     char t_stopc;
  440.     char t_eofc;
  441.     char t_brkc;
  442. };
  443.  
  444. struct ltchars {
  445.     char t_suspc;
  446.     char t_dsuspc;
  447.     char t_rprntc;
  448.     char t_flushc;
  449.     char t_werasc;
  450.     char t_lnextc;
  451. };
  452.  
  453. struct sgttyb {
  454.     char sg_ispeed;
  455.     char sg_ospeed;
  456.     char sg_erase;
  457.     char sg_kill;
  458.     ushort sg_flags;
  459. };
  460.  
  461. struct winsize {
  462.     short    ws_row;
  463.     short    ws_col;
  464.     short    ws_xpixel;
  465.     short    ws_ypixel;
  466. };
  467.  
  468. struct xkey {
  469.     short    xk_num;
  470.     char    xk_def[8];
  471. };
  472.  
  473. struct tty {
  474.     short        pgrp;        /* process group of terminal */
  475.     short        state;        /* terminal status, e.g. stopped */
  476.     short        use_cnt;    /* number of times terminal is open */
  477.     short        res1;        /* reserved for future expansion */
  478.     struct sgttyb     sg;
  479.     struct tchars     tc;
  480.     struct ltchars     ltc;
  481.     struct winsize    wsiz;
  482.     long        rsel;        /* selecting process for read */
  483.     long        wsel;        /* selecting process for write */
  484.     char        *xkey;        /* extended keyboard table */
  485.     long        resrvd[3];    /* for future expansion */
  486. };
  487.  
  488. /* Dcntl constants and types */
  489. #define DEV_NEWTTY    0xde00
  490. #define DEV_NEWBIOS    0xde01
  491. #define DEV_INSTALL    0xde02
  492.  
  493. struct dev_descr {
  494.     DEVDRV    *driver;
  495.     short    dinfo;
  496.     short    flags;
  497.     struct tty *tty;
  498.     long    reserved[4];
  499. };
  500.  
  501.  
  502. /* number of BIOS drives */
  503. #define NUM_DRIVES 32
  504.  
  505. #define BIOSDRV (NUM_DRIVES)
  506. #define PIPEDRV (NUM_DRIVES+1)
  507. #define PROCDRV (NUM_DRIVES+2)
  508. #define SHMDRV    (NUM_DRIVES+3)
  509.  
  510. #define UNI_NUM_DRVS (NUM_DRIVES+4)
  511. #define UNIDRV    ('U'-'A')
  512.  
  513. #define PSEUDODRVS ((1L<<UNIDRV))
  514.  
  515. #define PROC_BASE_DEV 0xA000
  516.  
  517. #ifndef GENMAGIC
  518. /* external variables */
  519.  
  520. extern FILESYS *drives[NUM_DRIVES];
  521. extern struct tty default_tty;
  522. extern char follow_links[];
  523. #endif
  524.  
  525. #endif /* _filesys_h */
  526.