msg(FP) 6 January 1993 msg(FP) Name msg - IPC message structures Syntax #include <sys/msg.h> Description 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 msqidds 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 */ msgperm is an ipcperm 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 */ msgqnum is the number of messages currently on the queue. msgqbytes is the maximum number of bytes allowed on the queue. msglspid is the pro- cess ID of the last process that performed a msgsnd operation. msglrpid is the process ID of the last process that performed a msgrcv operation. msgstime is the time of the last msgsnd operation, msgrtime is the time of the last msgrcv operation, and msgctime 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)