|
|
coherent
msgget() COHERENT System Call msgget() Get message queue #include <sys/msg.h> mmssggggeett(_k_e_y, _m_s_g_f_l_g) kkeeyy_tt _k_e_y; iinntt _m_s_g_f_l_g; msgget returns the message queue identifier associated with key, should it exist. If key has no message queue associated with it, msgget checks whether (_m_s_g_f_l_g & IIPPCC_CCRREEAATT) is true; if it is, then msgget creates a message queue identifier and associated message queue and data structure for _k_e_y. Upon creation, the data structure associated with the new message queue identifier is initialized as follows: * msg_perm.cuid, msg_perm.uid, msg_perm.cgid, and msg_perm.gid are set to, respectively, the effective user identifier and effective group identifier of the calling process. * The low-order nine bits of msg_perm.mode are set to the low- order nine bits of msgflg. These nine bits define access per- missions: the top three bits specify the owner's access per- missions (read, write, execute), the middle three bits specify the owning group's access permissions, and the low three bits specify access permissions for others. * msg_ctime is set to the current time. * msg_qbytes is set equal to the system limit, as defined by the kernel variable NMSQB. msgget fails if any of the following is true. The term within parentheses gives the value to which msgget sets errno, as defined in the header file errno.h: * A message queue identifier exists for key but operation per- mission as specified by the low-order nine bits of msgflg would not be granted (EEAACCCCEESS). * A message queue identifier does not exist for key and (_m_s_g_f_l_g & IIPPCC_CCRREEAATT) is false (EENNOOEENNTT). * A message queue identifier is to be created but the number of message queue identifiers system-wide exceeds the system limit as specified in the kernel variable NMSQID (EENNOOSSPPCC). * A message queue identifier exists for key, but ((_m_s_g_f_l_g & IIPPCC_CCRREEAATT) && (_m_s_g_f_l_g & IIPPCC_EEXXCCLL)) is true (EEEEXXIISSTT). ***** Return Value ***** Upon successful completion, msgget returns the message-queue identifier, which is always a non-negative integer. Otherwise, it returns -1 and sets eerrrrnnoo to an appropriate value. COHERENT Lexicon Page 1 msgget() COHERENT System Call msgget() ***** Files ***** /usr/include/sys/ipc.h /usr/include/sys/msg.h /dev/msg ***** See Also ***** COHERENT system calls, msg, msgctl(), msgrcv(), msgsnd() ***** Notes ***** To improve portability, the mmssgg functions are presently im- plemented as a device driver rather than as an actual system call. COHERENT Lexicon Page 2
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.