| MSGGET(2) | 21 January 1990 | MSGGET(2) |
| NAME |
| msgget - get message queue |
| SYNOPSIS |
|
|
| DESCRIPTION |
|
msgget()
returns the message queue identifier associated with
key. A message queue identifier and associated message queue and data structure (see intro(2)) are created for key() if one of the following is true:
Upon creation, the data structure associated with the new message queue identifier is initialized as follows:
A message queue identifier (msqid) is a unique positive integer created by a msgget(2) 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:
msg_perm() is an ipc_perm structure that specifies the message operation permission (see below). This structure includes the following members:
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(2) operation that changed a member of the above structure. |
| RETURN |
| msgget() returns A non-negative message queue identifier on success. On failure, it returns -1 and sets errno to indicate the error. |
| ERRORS |
|
| SEE |
| MSGGET(2) | 21 January 1990 | MSGGET(2) |