/*
 * $Header: /smsa/bsd:include/sys/ipc.h:bsd  1.6  $
 * $Source: /smsa/bsd:include/sys/ipc.h: $
 *
 * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
 *
 */

#ifndef	__sys_ipc_h
#define	__sys_ipc_h

/* Common IPC Access Structure */

#ifndef	__sys_types_h
#include "types.h"
#endif

struct ipc_perm {
	uid_t	uid;	/* owner's user id */
	gid_t	gid;	/* owner's group id */
	uid_t	cuid;	/* creator's user id */
	gid_t	cgid;	/* creator's group id */
	mode_t	mode;	/* access modes */
	ushort	seq;	/* slot usage sequence number */
	key_t	key;	/* key */
};

/* Common IPC Definitions. */
/* Mode bits. */
#define	IPC_ALLOC	0100000		/* entry currently allocated */
#define	IPC_CREAT	0001000		/* create entry if key doesn't exist */
#define	IPC_EXCL	0002000		/* fail if key exists */
#define	IPC_NOWAIT	0004000		/* error if request must wait */
#define IPC_MODEMASK	0000777		/* for mode field of ipc_perm */
#define IPC_USERMODE	0000600		/* user mode bits */
#define IPC_GROUPMODE	0000060		/* group mode bits */
#define IPC_OTHERMODE	0000006		/* other mode bits */
#define IPC_UREAD	0000400		/* read by user */
#define IPC_UWRITE	0000200		/* write by user */
#define IPC_GREAD	0000040		/* read by group */
#define IPC_GWRITE	0000020		/* write by group */
#define IPC_OREAD	0000004		/* read by others */
#define IPC_OWRITE	0000002		/* write by others */

/* Keys. */
#define	IPC_PRIVATE	(key_t)0	/* private key */

/* Control Commands. */
#define	IPC_RMID	0	/* remove identifier */
#define	IPC_SET		1	/* set options */
#define	IPC_STAT	2	/* get options */

#endif/*__sys_ipc_h*/

/* EOF ipc.h */
