home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / ipc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  3.3 KB  |  115 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_IPC_H
  11. #define _SYS_IPC_H
  12.  
  13. #ident    "@(#)/usr/include/sys/ipc.h.sl 1.1 4.0 12/08/90 56757 AT&T-USL"
  14. /* Common IPC Access Structure */
  15.  
  16. /* The kernel supports both the SVR3 ipc_perm and expanded ipc_perm
  17. ** structures simultaneously.
  18. */
  19.  
  20. /* Applications that read /dev/mem must be built like the kernel. A new
  21. ** symbol "_KMEMUSER" is defined for this purpose.
  22. */
  23.  
  24. #if defined(_KERNEL) || defined(_KMEMUSER)
  25. /* SVR3 ipc_perm structure */
  26. struct o_ipc_perm {
  27.     o_uid_t    uid;    /* owner's user id */
  28.     o_gid_t    gid;    /* owner's group id */
  29.     o_uid_t    cuid;    /* creator's user id */
  30.     o_gid_t    cgid;    /* creator's group id */
  31.     o_mode_t mode;    /* access modes */
  32.     ushort    seq;    /* slot usage sequence number */
  33.     key_t    key;    /* key */
  34. };
  35. /* expanded ipc_perm structure */
  36. struct ipc_perm {
  37.     uid_t    uid;    /* owner's user id */
  38.     gid_t    gid;    /* owner's group id */
  39.     uid_t    cuid;    /* creator's user id */
  40.     gid_t    cgid;    /* creator's group id */
  41.     mode_t    mode;    /* access modes */
  42.     ulong    seq;    /* slot usage sequence number */
  43.     key_t    key;    /* key */
  44.     long    pad[4]; /* reserve area */
  45. };
  46. #else    /* user definition */
  47.  
  48. struct ipc_perm {
  49. #if !defined(_STYPES)
  50. /* maps to kernel ipc_perm structure */
  51.     uid_t    uid;    /* owner's user id */
  52.     gid_t    gid;    /* owner's group id */
  53.     uid_t    cuid;    /* creator's user id */
  54.     gid_t    cgid;    /* creator's group id */
  55.     mode_t    mode;    /* access modes */
  56.     ulong    seq;    /* slot usage sequence number */
  57.     key_t    key;    /* key */
  58.     long    pad[4];    /* reserve area */
  59. #else
  60.     o_uid_t    uid;    /* owner's user id */
  61.     o_gid_t    gid;    /* owner's group id */
  62.     o_uid_t    cuid;    /* creator's user id */
  63.     o_gid_t    cgid;    /* creator's group id */
  64.     o_mode_t mode;    /* access modes */
  65.     ushort    seq;    /* slot usage sequence number */
  66.     key_t    key;    /* key */
  67. #endif    /* !defined(_STYPES) */
  68. };
  69. #endif    /* defined(_KERNEL) */
  70.  
  71. /* Common IPC Definitions. */
  72. /* Mode bits. */
  73. #define    IPC_ALLOC    0100000        /* entry currently allocated */
  74. #define    IPC_CREAT    0001000        /* create entry if key doesn't exist */
  75. #define    IPC_EXCL    0002000        /* fail if key exists */
  76. #define    IPC_NOWAIT    0004000        /* error if request must wait */
  77.  
  78. /* Keys. */
  79. #define    IPC_PRIVATE    (key_t)0    /* private key */
  80.  
  81. /* Control Commands. */
  82.  
  83. #if defined(_KERNEL) || defined(_KMEMUSER)
  84. /* Command values for EFT definition */
  85. #define IPC_RMID    10    /* remove identifier */
  86. #define    IPC_SET        11    /* set options */
  87. #define    IPC_STAT    12    /* get options */
  88.  
  89.     /* For compatibility */
  90. #define    IPC_O_RMID    0    /* remove identifier */
  91. #define    IPC_O_SET    1    /* set options */
  92. #define    IPC_O_STAT    2    /* get options */
  93.  
  94. #else    /* user definition */
  95.  
  96. #if !defined(_STYPES)
  97.  
  98.     /* EFT definition */
  99. #define    IPC_RMID    10    /* remove identifier */
  100. #define    IPC_SET        11    /* set options */
  101. #define    IPC_STAT    12    /* get options */
  102. #else    /* compatibility mode - NON EFT  definition */
  103. #define    IPC_RMID    0    /* remove identifier */
  104. #define    IPC_SET        1    /* set options */
  105. #define    IPC_STAT    2    /* get options */
  106.  
  107. #endif    /* !defined(_STYPES) */
  108. #endif    /* defined(_KERNEL) */
  109.  
  110. #if defined(__STDC__) && !defined(_KERNEL)
  111. key_t ftok(const char *, int);
  112. #endif
  113.  
  114. #endif    /* _SYS_IPC_H */
  115.