home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / file.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  1.6 KB  |  60 lines

  1. /*    Copyright (c) 1984, 1986, 1987, 1988 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8. /*    Copyright (c) 1987, 1988 Microsoft Corporation    */
  9. /*      All Rights Reserved    */
  10.  
  11. /*    This Module contains Proprietary Information of Microsoft  */
  12. /*    Corporation and should be treated as Confidential.       */
  13.  
  14. #ident    "@(#)head.sys:file.h    1.3.1.2"
  15.  
  16. /*
  17.  * One file structure is allocated for each open/creat/pipe call.
  18.  * Main use is to hold the read/write pointer associated with
  19.  * each open file.
  20.  */
  21.  
  22. typedef struct file
  23. {
  24.     char    f_flag;
  25.     cnt_t    f_count;        /* reference count */
  26.     union {
  27.         struct inode *f_uinode;    /* pointer to inode structure */
  28.         struct file  *f_unext;    /* pointer to next entry in freelist */
  29.     } f_up;
  30.     union {
  31.         off_t    f_off;
  32.         struct    file *f_slnk;    /* XENIX semaphore queue */
  33.     } f_un;
  34. } file_t;
  35.  
  36. #define f_inode        f_up.f_uinode
  37. #define f_next        f_up.f_unext
  38. #define f_offset    f_un.f_off    /* read/write character pointer */
  39.  
  40. extern struct file file[];    /* The file table itself */
  41. extern struct file *ffreelist;    /* Head of freelist pool */
  42.  
  43. /* flags */
  44.  
  45. #define    FOPEN    0xffffffff
  46. #define    FREAD    0x01
  47. #define    FWRITE    0x02
  48. #define    FNDELAY    0x04
  49. #define    FAPPEND    0x08
  50. #define FSYNC    0x10
  51. #define FRCACH  0x20        /* Used for file and record locking cache*/
  52. #define    FMASK    0x7f        /* FMASK should be disjoint from FNET */
  53. #define FNET    0x80        /* needed by 3bnet */
  54.  
  55. /* open only modes */
  56.  
  57. #define    FCREAT    0x100
  58. #define    FTRUNC    0x200
  59. #define    FEXCL    0x400
  60.