#ifndef _CH_SYS_IPC_H_
#define _CH_SYS_IPC_H_

/*
 * XXX almost all members have wrong types.
 */
struct ipc_perm {  
        unsigned short  cuid;   /* creator user id */
        unsigned short  cgid;   /* creator group id */
        unsigned short  uid;    /* user id */
        unsigned short  gid;    /* group id */
        unsigned short  mode;   /* r/w permission */
        unsigned short  seq;    /* sequence # (to generate unique ipcid) */
        key_t           key;    /* user specified msg/sem/shm key */
};

/* common mode bits */ 
#define IPC_R           000400  /* read permission */
#define IPC_W           000200  /* write/alter permission */
#define IPC_M           010000  /* permission to change control info */

/* SVID required constants (same values as system 5) */
#define IPC_CREAT       001000  /* create entry if key does not exist */
#define IPC_EXCL        002000  /* fail if key exists */
#define IPC_NOWAIT      004000  /* error if request must wait */

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

#define IPC_RMID        0       /* remove identifier */
#define IPC_SET         1       /* set options */
#define IPC_STAT        2       /* get options */
#define IPC_INFO        3       /* get info */

#endif /* _CH_SYS_IPC_H_ */
