| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 2: System Calls Oracle Solaris 11 Information Library |
- message control operations
#include <sys/msg.h>intmsgctl(intmsqid,intcmd,struct msqid_ds *buf);
Themsgctl() function provides a variety of message control operations as specifiedbycmd. The followingcmds are available:
Place the current value of each member of the data structure associated withmsqid into the structure pointed to bybuf. The contents of this structure are defined inIntro(2).
Set the value of the following members of the data structure associated withmsqid to the corresponding value found in the structure pointed to bybuf:
msg_perm.uidmsg_perm.gidmsg_perm.mode /* access permission bits only */msg_qbytes
This command can be executed only by a process that has either the {PRIV_IPC_OWNER} privilege or an effective user ID equal to the value ofmsg_perm.cuid ormsg_perm.uid in the data structure associated withmsqid. Only a process with the {PRIV_SYS_IPC_CONFIG} privilege can raise the value ofmsg_qbytes.
Remove the message queue identifier specified bymsqid from the system and destroy the message queue and data structure associated with it. Thiscmd can only be executed by a process that has an effective user ID either with appropriate privileges asserted in the effective set or equal to the value ofmsg_perm.cuid ormsg_perm.uid in the data structure associated withmsqid. Thebuf argument is ignored.
Upon successful completion,msgctl() returns0. Otherwise, it returns-1 and setserrno to indicate the error.
Themsgctl() function will fail if:
Thecmd argument isIPC_STAT and operation permission is denied to the calling process (seeIntro(2)).
Thebuf argument points to an illegal address.
Themsqid argument is not a valid message queue identifier; or thecmd argument is not a valid command or isIPC_SET andmsg_perm.uid ormsg_perm.gid is not valid.
Thecmd argument isIPC_STAT anduid orgid is too large to be stored in the structure pointed to bybuf.
Thecmd argument isIPC_RMID orIPC_SET, the {PRIV_SYS_IPC_OWNER} privilege is not asserted in the effective set of the calling process, and is not equal to the value ofmsg_perm.cuid ormsg_perm.uid in the data structure associated withmsqid.
Thecmd argument isIPC_SET, an attempt is being made to increase to the value ofmsg_qbytes, and the {PRIV_SYS_IPC_CONFIG} privilege is not asserted in the effective set of the calling process.
Seeattributes(5) for descriptions of the following attributes:
|
Intro(2),msgget(2),msgrcv(2),msgsnd(2),attributes(5),privileges(5),standards(5)
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |