home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / flock.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  1.3 KB  |  50 lines

  1. /*    Copyright (c) 1984, 1986, 1987, 1988 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8.  
  9. #ident    "@(#)head.sys:flock.h    1.3"
  10.  
  11. #define INOFLCK        1    /* Inode is locked when reclock() is called. */
  12. #define SETFLCK        2    /* Set a file lock. */
  13. #define SLPFLCK        4    /* Wait if blocked. */
  14.  
  15. #define USE_PID        1    /* use epid when cleaning locks        */
  16. #define IGN_PID        2    /* ignore epid when cleaning locks    */
  17.  
  18. /* file locking structure (connected to inode) */
  19.  
  20. #define l_end         l_len
  21. #define MAXEND      017777777777
  22.  
  23. struct    filock    {
  24.     struct    flock set;    /* contains type, start, and end */
  25.     union    {
  26.         int wakeflg;    /* for locks sleeping on this one */
  27.         struct {
  28.             short sysid;
  29.             short pid;
  30.         } blk;            /* for sleeping locks only */
  31.     }    stat;
  32. #ifdef    u3b
  33.     sema_t    wakesem;
  34. #endif
  35.     struct    filock *prev;
  36.     struct    filock *next;
  37. };
  38.  
  39. /* file and record locking configuration structure */
  40. /* record use total may overflow */
  41. struct flckinfo {
  42.     long recs;    /* number of records configured on system */
  43.     long reccnt;    /* number of records currently in use */
  44.     long recovf;    /* number of times system ran out of record locks. */
  45.     long rectot;    /* number of records used since system boot */
  46. };
  47.  
  48. extern struct flckinfo    flckinfo;
  49. extern struct filock    flox[];
  50.