home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 202.img / SCO386N2.TD0 / usr / include / sys / file.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-18  |  1.5 KB  |  61 lines

  1. /*
  2.  *    @(#) file.h 2.2 88/05/18 
  3.  *
  4.  *    Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987.
  5.  *    Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987.
  6.  *    This Module contains Proprietary Information of
  7.  *    The Santa Cruz Operation, Microsoft Corporation
  8.  *    and AT&T, and should be treated as Confidential.
  9.  */
  10.  
  11. /*
  12.  * THIS FILE CONTAINS CODE WHICH IS DESIGNED TO BE
  13.  * PORTABLE BETWEEN DIFFERENT MACHINE ARCHITECTURES
  14.  * AND CONFIGURATIONS. IT SHOULD NOT REQUIRE ANY
  15.  * MODIFICATIONS WHEN ADAPTING XENIX TO NEW HARDWARE.
  16.  */
  17.  
  18. /*
  19.  * One file structure is allocated for each open/creat/pipe call.
  20.  * Main use is to hold the read/write pointer associated with
  21.  * each open file.
  22.  */
  23. struct    file
  24. {
  25.     char    f_flag;
  26.     char    f_res;        /* reserved field to word align */
  27.     ushort    f_count;    /* reference count */
  28.     inodep_t f_inode;    /* pointer to inode structure */
  29.     union {
  30.         off_t    f_off;        /* read/write character pointer */
  31.         filep_t    f_slnk;        /* next waiter for semaphore */
  32.     } f_un;
  33. };
  34.  
  35. #define    f_offset    f_un.f_off
  36.  
  37. #if defined(M_I8086) || defined(M_I286)
  38. extern struct file far file[];    /* The file table itself */
  39. #else
  40. extern struct file file[];    /* The file table itself */
  41. #endif
  42.  
  43. /* flags */
  44. #define    FOPEN    (-1)
  45. #define    FREAD    00001
  46. #define    FWRITE    00002
  47. #define    FNDELAY    00004
  48. #define    FAPPEND    00010
  49. #ifdef M_I386
  50. #define FSYNC   00020
  51. #define OFSYNC   0100        /* for 286 compatibility */
  52. #else
  53. #define FSYNC   0100        
  54. #endif
  55. #define    FMASK    00377
  56.  
  57. /* open only modes */
  58. #define    FCREAT    00400
  59. #define    FTRUNC    01000
  60. #define    FEXCL    02000
  61.