home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 202.img / SCO386N2.TD0 / usr / include / sys / fcntl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-09  |  1.7 KB  |  70 lines

  1. /*
  2.  *    @(#) fcntl.h 2.3 88/08/09 
  3.  *
  4.  *    Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987, 1988.
  5.  *    Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987, 1988.
  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. #include "lockcmn.h"
  12.  
  13. /* Flag values accessible to open(2) and fcntl(2) */
  14. /*  (The first three can only be set by open) */
  15. #define    O_RDONLY    0000
  16. #define    O_WRONLY    0001
  17. #define    O_RDWR        0002
  18. #define    O_NDELAY    0004    /* Non-blocking I/O */
  19. #define    O_APPEND    0010    /* append (writes guaranteed at the end) */
  20. #ifdef M_I386
  21. #define O_SYNCW        0020    /* synchronous write option */
  22. #else
  23. #define O_SYNCW        0100
  24. #endif
  25. #define    O_SYNC        O_SYNCW
  26.  
  27. /* Flag values accessible only to open(2) */
  28. #define    O_CREAT    00400    /* open with file create (uses third open arg)*/
  29. #define    O_TRUNC    01000    /* open with truncation */
  30. #define    O_EXCL    02000    /* exclusive open */
  31.  
  32. /* fcntl(2) requests */
  33. #define    F_DUPFD    0    /* Duplicate fildes */
  34. #define    F_GETFD    1    /* Get fildes flags */
  35. #define    F_SETFD    2    /* Set fildes flags */
  36. #define    F_GETFL    3    /* Get file flags */
  37. #define    F_SETFL    4    /* Set file flags */
  38.  
  39. #define F_GETLK 5    /* Get first blocking lock */
  40. #define F_SETLK 6    /* Non-blocking lock */
  41. #define F_SETLKW 7    /* Blocking lock */
  42. #define F_CHKFL    8
  43.  
  44. #define F_RDLCK CMN_RDLCK
  45. #define F_WRLCK CMN_WRLCK
  46. #define F_UNLCK CMN_UNLCK
  47.  
  48. #ifdef M_KERNEL
  49. /* COFF versions of the flock structure flags */
  50. #define CF_RDLCK    1
  51. #define CF_WRLCK    2
  52. #define CF_UNLCK    3
  53. #endif
  54.  
  55. /* Flock structure used for System V fcntl(). */
  56.  
  57. struct    flock {
  58.         short    l_type;
  59.         short    l_whence;
  60.         long    l_start;
  61.         long    l_len;
  62. #ifdef M_I386
  63.         short    l_sysid;
  64.         short    l_pid;
  65. #else
  66.         short    l_pid;
  67.         short    l_sysid;
  68. #endif
  69. };
  70.