msg -- IPC message structures


#include <sys/msg.h>


A message queue identifier (msqid) is a unique positive integer created by a msgget(S) system call. Each msqid has a message queue and a data structure associated with it. The data structure is referred to as msqid_ds and contains the following members:
   struct  ipc_perm msg_perm;       /* operation permission struct */
   struct  msg *msg_first;          /* ptr to first message on q */
   struct  msg *msg_last;           /* ptr to last message on q */
   ushort  msg_cbytes;              /* current number of bytes on q */
   ushort  msg_qnum;                /* number of msgs on q */
   ushort  msg_qbytes;              /* max number of bytes on q */
   ushort  msg_lspid;               /* pid of last msgsnd operation */
   ushort  msg_lrpid;               /* pid of last msgrcv operation */
   time_t  msg_stime;               /* last msgsnd time */
   time_t  msg_rtime;               /* last msgrcv time */
   time_t  msg_ctime;               /* last change time */
                                    /* Times measured in secs since */
                                    /* 00:00:00 GMT, Jan. 1, 1970 */
msg_perm is an ipc_perm structure that specifies the message operation permission. The structure includes the following members:
   ushort  uid;        /* owner's user id */
   ushort  gid;        /* owner's group id */
   ushort  cuid;       /* creator's user id */
   ushort  cgid;       /* creator's group id */
   ushort  mode;       /* r/w permission */
   ushort  seq;        /* slot usage sequence number */
   key_t   key;        /* key */
msg_qnum is the number of messages currently on the queue. msg_qbytes is the maximum number of bytes allowed on the queue. msg_lspid is the process ID of the last process that performed a msgsnd operation. msg_lrpid is the process ID of the last process that performed a msgrcv operation. msg_stime is the time of the last msgsnd operation, msg_rtime is the time of the last msgrcv operation, and msg_ctime is the time of the last msgctl(S) operation that changed a member in the preceding structure.

See also

msgctl(S), msgget(S), msgop(S)
© 2003 File Formats for Programming (FP)
SCO OpenServer Release 5.0.7 -- 11 February 2003