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

  1. /*
  2.  *    @(#) locking.h 2.2 88/05/18 
  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. /*
  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. /*
  20.  *   Flag values for locking system call (sys/sys/locking.c)
  21.  */
  22.  
  23. #include "lockcmn.h"
  24.  
  25. #define LK_UNLCK  CMN_UNLCK    /* unlock request */
  26. #define LK_LOCK   CMN_WRLCK    /* lock request */
  27. #ifdef M_I386
  28. #define LK_NBLCK  20        /* non-blocking lock request */
  29. #else
  30. #define LK_NBLCK  2        /* non-blocking lock request */
  31. #endif
  32. #define LK_RLCK   CMN_RDLCK    /* read permitted only lock request */
  33. #define LK_NBRLCK 4        /* non-blocking read only lock request */
  34. #define LK_GETLK  5        /* V2 request to find first blocking lock */
  35. #define LK_SETLK  6        /* V2 non-blocking lock request */
  36. #define LK_SETLKW 7        /* V2 blocking lock request */
  37. #define LK_TESTLK 8        /* V2 request to test for locks */
  38.  
  39. #ifdef M_KERNEL
  40.  
  41. struct locklist {
  42.         /* NOTE: ll_link must be first in struct */
  43.     struct locklist    *ll_link;    /* link to next lock region */
  44.     ushort      ll_flags;    /* misc flags ** sleeping */
  45.     struct proc    *ll_proc;    /* process which owns region */
  46.     off_t        ll_start;    /* starting offset */
  47.     off_t        ll_end;        /* ending offset, zero is eof */
  48. };
  49.  
  50. extern struct locklist locklist[]; /* The lock table itself */
  51.  
  52. /* ll_flags */
  53. #define LROLOCK 0x01    /* record is locked & is read only */
  54. #define LFCNTL    0x02    /* lock was created via fcntl */
  55. #define LENFRC    0x04    /* lock is enforcement mode */
  56. #define NOTUSED 0x08
  57. #define LIWANT    0x10
  58.  
  59. /* lock_sys flags */
  60. #define LS_ULK    0
  61. #define LS_RLK    1
  62. #define LS_WLK    2
  63. #define LS_RCHK 3
  64. #define LS_WCHK 4
  65. #define LS_MSK    0xf
  66. #define LS_TLK    0x20
  67. #define LS_GLK    0x40
  68. #define LS_BLK    0x80
  69.  
  70. #define    MAXLOCKSZ ((off_t) (1L << 30))
  71.  
  72. #endif
  73.