1 /* 2 * Copyright (c) 1988 University of Utah. 3 * Copyright (c) 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department. 9 * 10 * %sccs.include.redist.c% 11 * 12 * @(#)ipc.h 7.2 (Berkeley) 02/05/91 13 */ 14 15 /* 16 * SVID compatible ipc.h file 17 */ 18 #ifndef _IPC_H_ 19 #define _IPC_H_ 20 21 typedef long key_t; /* XXX should be in types.h */ 22 23 struct ipc_perm { 24 ushort cuid; /* creator user id */ 25 ushort cgid; /* creator group id */ 26 ushort uid; /* user id */ 27 ushort gid; /* group id */ 28 ushort mode; /* r/w permission */ 29 ushort seq; /* sequence # (to generate unique msg/sem/shm id) */ 30 key_t key; /* user specified msg/sem/shm key */ 31 }; 32 33 /* common mode bits */ 34 #define IPC_R 00400 /* read permission */ 35 #define IPC_W 00200 /* write/alter permission */ 36 37 /* SVID required constants (same values as system 5) */ 38 #define IPC_CREAT 01000 /* create entry if key does not exist */ 39 #define IPC_EXCL 02000 /* fail if key exists */ 40 #define IPC_NOWAIT 04000 /* error if request must wait */ 41 42 #define IPC_PRIVATE (key_t)0 /* private key */ 43 44 #define IPC_RMID 0 /* remove identifier */ 45 #define IPC_SET 1 /* set options */ 46 #define IPC_STAT 2 /* get options */ 47 48 #endif /* !_IPC_H_ */ 49