home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / flock.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  1.6 KB  |  59 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_FLOCK_H
  11. #define _SYS_FLOCK_H
  12.  
  13. #ident    "@(#)/usr/include/sys/flock.h.sl 1.1 4.0 12/08/90 51627 AT&T-USL"
  14.  
  15. #define    INOFLCK        1    /* Vnode is locked when reclock() is called. */
  16. #define    SETFLCK        2    /* Set a file lock. */
  17. #define    SLPFLCK        4    /* Wait if blocked. */
  18. #define    RCMDLCK        8    /* RGETLK/RSETLK/RSETLKW specified */
  19.  
  20. #define IGN_PID        (-1)    /* ignore epid when cleaning locks */
  21.  
  22. /* file locking structure (connected to vnode) */
  23.  
  24. #define l_end         l_len
  25. #define MAXEND      017777777777
  26.  
  27. typedef struct filock {
  28.     struct    flock set;    /* contains type, start, and end */
  29.     union    {
  30.         int wakeflg;    /* for locks sleeping on this one */
  31.         struct {
  32.             long sysid;
  33.             pid_t pid;
  34.         } blk;            /* for sleeping locks only */
  35.     }    stat;
  36. #ifdef    u3b
  37.     int    wakesem;
  38. #endif
  39.     struct    filock *prev;
  40.     struct    filock *next;
  41. } filock_t;
  42.  
  43. /* file and record locking configuration structure */
  44. /* record use total may overflow */
  45. struct flckinfo {
  46.     long reccnt;    /* number of records currently in use */
  47.     long rectot;    /* number of records used since system boot */
  48. };
  49.  
  50. extern struct flckinfo    flckinfo;
  51.  
  52. #if defined(__STDC__)
  53. int    reclock(struct vnode *, struct flock *, int, int, off_t);
  54. #else
  55. int    reclock();
  56. #endif
  57.  
  58. #endif    /* _SYS_FLOCK_H */
  59.