home *** CD-ROM | disk | FTP | other *** search
- /*
- * @(#) locking.h 2.2 88/05/18
- *
- * Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987, 1988.
- * Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987, 1988.
- * This Module contains Proprietary Information of
- * The Santa Cruz Operation, Microsoft Corporation
- * and AT&T, and should be treated as Confidential.
- */
-
- /*
- * THIS FILE CONTAINS CODE WHICH IS DESIGNED TO BE
- * PORTABLE BETWEEN DIFFERENT MACHINE ARCHITECTURES
- * AND CONFIGURATIONS. IT SHOULD NOT REQUIRE ANY
- * MODIFICATIONS WHEN ADAPTING XENIX TO NEW HARDWARE.
- */
-
-
- /*
- * Flag values for locking system call (sys/sys/locking.c)
- */
-
- #include "lockcmn.h"
-
- #define LK_UNLCK CMN_UNLCK /* unlock request */
- #define LK_LOCK CMN_WRLCK /* lock request */
- #ifdef M_I386
- #define LK_NBLCK 20 /* non-blocking lock request */
- #else
- #define LK_NBLCK 2 /* non-blocking lock request */
- #endif
- #define LK_RLCK CMN_RDLCK /* read permitted only lock request */
- #define LK_NBRLCK 4 /* non-blocking read only lock request */
- #define LK_GETLK 5 /* V2 request to find first blocking lock */
- #define LK_SETLK 6 /* V2 non-blocking lock request */
- #define LK_SETLKW 7 /* V2 blocking lock request */
- #define LK_TESTLK 8 /* V2 request to test for locks */
-
- #ifdef M_KERNEL
-
- struct locklist {
- /* NOTE: ll_link must be first in struct */
- struct locklist *ll_link; /* link to next lock region */
- ushort ll_flags; /* misc flags ** sleeping */
- struct proc *ll_proc; /* process which owns region */
- off_t ll_start; /* starting offset */
- off_t ll_end; /* ending offset, zero is eof */
- };
-
- extern struct locklist locklist[]; /* The lock table itself */
-
- /* ll_flags */
- #define LROLOCK 0x01 /* record is locked & is read only */
- #define LFCNTL 0x02 /* lock was created via fcntl */
- #define LENFRC 0x04 /* lock is enforcement mode */
- #define NOTUSED 0x08
- #define LIWANT 0x10
-
- /* lock_sys flags */
- #define LS_ULK 0
- #define LS_RLK 1
- #define LS_WLK 2
- #define LS_RCHK 3
- #define LS_WCHK 4
- #define LS_MSK 0xf
- #define LS_TLK 0x20
- #define LS_GLK 0x40
- #define LS_BLK 0x80
-
- #define MAXLOCKSZ ((off_t) (1L << 30))
-
- #endif
-