Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

msg.h(3head) [redhat man page]

msg.h(3HEAD)							      Headers							      msg.h(3HEAD)

NAME
msg.h, msg - message queue structures SYNOPSIS
#include <sys/msg.h> DESCRIPTION
The <sys/msg.h> header defines the following data types through typedef: msgqnum_t used for the number of messages in the message queue msglen_t used for the number of bytes allowed in the message queue These types are unsigned integer types that are able to store values at least as large as a type unsigned short. The <sys/msg.h> header defines the following constant as a message operation flag: MSG_NOERROR no error if big message The msqid_ds structure contains the following members: struct ipc_perm msg_perm Operation permission structure. msgqnum_t msg_qnum Number of messages currently on queue. msglen_t msg_qbytes Maximum number of bytes allowed on queue. pid_t msg_lspid Process ID of last msgsnd(2). pid_t msg_lrpid Process ID of last msgrcv(2). time_t msg_stime Time of last msgsnd(). time_t msg_rtime Time of last msgrcv(). time_t msg_ctime Time of last change. The pid_t, time_t, key_t, size_t, and ssize_t types are defined as described in <sys/types.h>. See types(3HEAD). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
msgctl(2), msgget(2), msgrcv(2), msgsnd(2), ipc.h(3HEAD), types.h(3HEAD), attributes(5), standards(5) SunOS 5.10 10 Sep 2004 msg.h(3HEAD)

Check Out this Related Man Page

msqid_ds(4)						     Kernel Interfaces Manual						       msqid_ds(4)

NAME
msqid_ds - Defines a message queue SYNOPSIS
#include <sys/msg.h> struct msqid_ds{ struct ipc_perm msg_perm; struct msg *msg_first; struct msg *msg_last; u_short msg_cbytes; u_short msg_qnum; u_short msg_qbytes; u_short msg_lspid; ushort msg_lrpid; time_t msg_stime; time_t msg_rtime; time_t msg_ctime; }; DESCRIPTION
The msqid_ds structure defines a message queue associated with a message queue ID. There is one queue per message queue ID. Collectively, the queues are stored as an array, with message queue IDs serving as an index into the array. A message queue is implemented as a linked list of messages, with msg_first amd msg_last pointing to the first and last messages on the queue. The IPC permissions for the message queue are implemented in a separate, but associated, ipc_perm structure. A message queue is created indirectly via the msgget() call. If msgget() is called with a non-existent message queue ID, the kernel allo- cates a new msqid_ds structure, initializes it, and returns the message queue ID that is to be associated with the message queue. FIELDS
The ipc_perm structure that defines permissions for message operations. See NOTES. A pointer to the first message on the queue. A pointer to the last message on the queue. The current number of bytes on the queue. The number of messages currently on the queue. The maximum number of bytes allowed on the queue. The process ID of the last process that called msgsnd() for the queue. The process ID of the last process that called msgrcv() for the queue. The time of the last msgsnd() operation. The time of the last msgrcv() operation. The time of the last msgctl() operation that changed a member of the msqid_ds structure. NOTES
The msg_perm field identifies the associated ipc_perm structure that defines the permissions for operations on the message queue. The ipc_perm structure (from the sys/ipc.h header file) is shown here. struct ipc_perm { 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; /* access modes */ ushort seq; /* slot usage sequence number */ key_t key; /* key */ }; The mode field is a 9-bit field that contains the permissions for message operations. The first three bits identify owner permissions; the second three bits identify group permissions; and the last three bits identify other permissions. In each group, the first bit indicates read permission; the second bit indicates write permission; and the third bit is not used. RELATED INFORMATION
Functions: msgctl(2), msgget(2), msgrcv(2), msgsnd(2) delim off msqid_ds(4)
Man Page