1: /*
   2:  * One file structure is allocated
   3:  * for each open/creat/pipe call.
   4:  * Main use is to hold the read/write
   5:  * pointer associated with each open
   6:  * file.
   7:  */
   8: struct  file
   9: {
  10:     char    f_flag;
  11:     char    f_count;    /* reference count */
  12:     struct  inode   *f_inode;   /* pointer to inode structure */
  13:     union {
  14:         off_t   f_offset;   /* read/write character pointer */
  15:         struct  chan *f_chan;   /* mpx channel pointer */
  16: #ifdef  UCB_NET
  17:         struct  socket *f_Socket;
  18: #endif
  19:     } f_un;
  20: };
  21: #ifdef  UCB_NET
  22: #define f_socket        f_un.f_Socket
  23: #endif
  24: 
  25: #ifdef  KERNEL
  26: extern  struct file file[]; /* The file table itself */
  27: #endif
  28: 
  29: /* flags */
  30: #define FREAD   01
  31: #define FWRITE  02
  32: #define FPIPE   04
  33: #ifdef  MPX_FILS
  34: #define FMPX    010
  35: #define FMPY    020
  36: #define FMP 030
  37: #endif
  38: #ifdef  UCB_NET
  39: #define FSOCKET 040     /* descriptor of a socket */
  40: #endif
  41: 
  42: /* flags supplied to access call */
  43: #define FACCESS_EXISTS  0x0 /* does file exist? */
  44: #define FACCESS_EXECUTE 0x1 /* is it executable by caller? */
  45: #define FACCESS_WRITE   0x2 /* is it writable by caller? */
  46: #define FACCESS_READ    0x4 /* is it readable by caller? */
  47: #define F_OK        FACCESS_EXISTS
  48: #define X_OK        FACCESS_EXECUTE
  49: #define W_OK        FACCESS_WRITE
  50: #define R_OK        FACCESS_READ
  51: 
  52: /* flags supplies to lseek call */
  53: #define FSEEK_ABSOLUTE  0x0 /* absolute offset */
  54: #define FSEEK_RELATIVE  0x1 /* relative to current offset */
  55: #define FSEEK_EOF   0x2 /* relative to end of file */
  56: #define L_SET       FSEEK_ABSOLUTE
  57: #define L_INCR      FSEEK_RELATIVE
  58: #define L_XTND      FSEEK_EOF
  59: 
  60: /* flags supplied to open call */
  61: #define FATT_RDONLY 0x0 /* open for reading only */
  62: #define FATT_WRONLY 0x1 /* open for writing only */
  63: #define FATT_RDWR   0x2 /* open for reading and writing */
  64: #define O_RDONLY    FATT_RDONLY
  65: #define O_WRONLY    FATT_WRONLY
  66: #define O_RDWR      FATT_RDWR

Defined struct's

file defined in line 8; used 78 times

Defined macros

FACCESS_EXECUTE defined in line 44; used 2 times
FACCESS_EXISTS defined in line 43; used 1 times
  • in line 47
FACCESS_READ defined in line 46; used 2 times
FATT_RDWR defined in line 63; used 3 times
FATT_WRONLY defined in line 62; used 2 times
FMP defined in line 36; used 20 times
FMPX defined in line 34; used 4 times
FMPY defined in line 35; used 3 times
FPIPE defined in line 32; used 8 times
FSEEK_ABSOLUTE defined in line 53; used 33 times
FSEEK_EOF defined in line 55; used 3 times
FSEEK_RELATIVE defined in line 54; used 2 times
F_OK defined in line 47; never used
L_INCR defined in line 57; never used
L_SET defined in line 56; never used
L_XTND defined in line 58; never used
O_RDONLY defined in line 64; never used
O_RDWR defined in line 66; never used
O_WRONLY defined in line 65; never used
R_OK defined in line 50; never used
W_OK defined in line 49; never used
X_OK defined in line 48; never used

Usage of this include

Last modified: 1983-08-28
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1121
Valid CSS Valid XHTML 1.0 Strict