#include <sys/msg.h>
sys/msg.h
$NetBSD: msg.h,v 1.4 1994/06/29 06:44:43 cgd Exp $
struct__msqid_ds_old
| struct __ipc_perm_old | msg_perm | [XSI] msg queue permissions |
| __int32_t | msg_first | RESERVED: kernel use only |
| __int32_t | msg_last | RESERVED: kernel use only |
| msglen_t | msg_cbytes | # of bytes on the queue |
| msgqnum_t | msg_qnum | [XSI] number of msgs on the queue |
| msglen_t | msg_qbytes | [XSI] max bytes on the queue |
| pid_t | msg_lspid | [XSI] pid of last msgsnd() |
| pid_t | msg_lrpid | [XSI] pid of last msgrcv() |
| time_t | msg_stime | [XSI] time of last msgsnd() |
| __int32_t | msg_pad1 | RESERVED: DO NOT USE |
| time_t | msg_rtime | [XSI] time of last msgrcv() |
| __int32_t | msg_pad2 | RESERVED: DO NOT USE |
| time_t | msg_ctime | [XSI] time of last msgctl() |
| __int32_t | msg_pad3 | RESERVED: DO NOT USE |
| __int32_t[4] | msg_pad4 | RESERVED: DO NOT USE |
typedefuser_msgqnum_t
typedef user_ulong_t user_msgqnum_t
typedefuser64_msgqnum_t
typedef user64_ulong_t user64_msgqnum_t
typedefuser32_msgqnum_t
typedef user32_ulong_t user32_msgqnum_t
typedefuser_msglen_t
typedef user_ulong_t user_msglen_t
typedefuser64_msglen_t
typedef user64_ulong_t user64_msglen_t
typedefuser32_msglen_t
typedef user32_ulong_t user32_msglen_t
structuser_msqid_ds
kernel version
| struct ipc_perm | msg_perm | [XSI] msg queue permissions |
| struct msg * | msg_first | first message in the queue |
| struct msg * | msg_last | last message in the queue |
| user_msglen_t | msg_cbytes | # of bytes on the queue |
| user_msgqnum_t | msg_qnum | [XSI] number of msgs on the queue |
| user_msglen_t | msg_qbytes | [XSI] max bytes on the queue |
| pid_t | msg_lspid | [XSI] pid of last msgsnd() |
| pid_t | msg_lrpid | [XSI] pid of last msgrcv() |
| user_time_t | msg_stime | [XSI] time of last msgsnd() |
| __int32_t | msg_pad1 | RESERVED: DO NOT USE |
| user_time_t | msg_rtime | [XSI] time of last msgrcv() |
| __int32_t | msg_pad2 | RESERVED: DO NOT USE |
| user_time_t | msg_ctime | [XSI] time of last msgctl() |
| __int32_t | msg_pad3 | RESERVED: DO NOT USE |
| __int32_t[4] | msg_pad4 |
structuser64_msqid_ds
user64 version - this structure only has to be correct if
compiled LP64, because the 32 bit kernel doesn't need it
| struct ipc_perm | msg_perm | [XSI] msg queue permissions |
| __int32_t | msg_first | RESERVED: kernel use only |
| __int32_t | msg_last | RESERVED: kernel use only |
| user64_msglen_t | msg_cbytes | # of bytes on the queue |
| user64_msgqnum_t | msg_qnum | [XSI] number of msgs on the queue |
| user64_msglen_t | msg_qbytes | [XSI] max bytes on the queue |
| pid_t | msg_lspid | [XSI] pid of last msgsnd() |
| pid_t | msg_lrpid | [XSI] pid of last msgrcv() |
| user64_time_t | msg_stime | [XSI] time of last msgsnd() |
| __int32_t | msg_pad1 | RESERVED: DO NOT USE |
| user64_time_t | msg_rtime | [XSI] time of last msgrcv() |
| __int32_t | msg_pad2 | RESERVED: DO NOT USE |
| user64_time_t | msg_ctime | [XSI] time of last msgctl() |
| __int32_t | msg_pad3 | RESERVED: DO NOT USE |
| __int32_t[4] | msg_pad4 |
structuser32_msqid_ds
| struct ipc_perm | msg_perm | [XSI] msg queue permissions |
| __int32_t | msg_first | RESERVED: kernel use only |
| __int32_t | msg_last | RESERVED: kernel use only |
| user32_msglen_t | msg_cbytes | # of bytes on the queue |
| user32_msgqnum_t | msg_qnum | [XSI] number of msgs on the queue |
| user32_msglen_t | msg_qbytes | [XSI] max bytes on the queue |
| pid_t | msg_lspid | [XSI] pid of last msgsnd() |
| pid_t | msg_lrpid | [XSI] pid of last msgrcv() |
| user32_time_t | msg_stime | [XSI] time of last msgsnd() |
| __int32_t | msg_pad1 | RESERVED: DO NOT USE |
| user32_time_t | msg_rtime | [XSI] time of last msgrcv() |
| __int32_t | msg_pad2 | RESERVED: DO NOT USE |
| user32_time_t | msg_ctime | [XSI] time of last msgctl() |
| __int32_t | msg_pad3 | RESERVED: DO NOT USE |
| __int32_t[4] | msg_pad4 | RESERVED: DO NOT USE |
structmsqid_kernel
Kernel wrapper for the user-level structure
| struct user_msqid_ds | u | |
| struct label * | label | MAC framework label |
variablemsginfo
extern struct msginfo msginfo
macroMSGMNI
#define MSGMNI 40
macroMSGTQL
#define MSGTQL 40
macroMSQID
macros to convert between msqid_ds's and msqid's.
(specific to this implementation)
#define MSQID(ix, ds) ((ix) & 0xffff | (((ds).msg_perm.seq << 16) & 0xffff0000))
macroMSQID_IX
#define MSQID_IX(id) ((id) & 0xffff)
macroMSQID_SEQ
#define MSQID_SEQ(id) (((id) >> 16) & 0xffff)