|IPC_STAT||Gather information about the message queue and place it in the structure pointed to by buf.|
Set the value of the
fields in the structure associated with
The values are taken from the corresponding fields in the structure
pointed to by
This operation can only be executed by the super-user, or a process that
has an effective user id equal to either
in the data structure associated with the message queue.
The value of
can only be increased by the super-user.
that exceed the system limit (MSGMNB from
.In sys/msg.h ) are silently truncated to that limit.
|IPC_RMID||Remove the message queue specified by msqid and destroy the data associated with it. Only the super-user or a process with an effective uid equal to the msg_perm.cuid or msg_perm.uid values in the data structure associated with the queue can do this.|
The permission to read from or write to a message queue (see msgsnd(2) and msgrcv(2)) is determined by the msg_perm.mode field in the same way as is done with files (see chmod(2)), but the effective uid can match either the msg_perm.cuid field or the msg_perm.uid field, and the effective gid can match either msg_perm.cgid or msg_perm.gid.
.Rv -std msgctl
The msgctl function will fail if:
[EPERM] The cmd argument is equal to IPC_SET or IPC_RMID and the caller is not the super-user, nor does the effective uid match either the msg_perm.uid or msg_perm.cuid fields of the data structure associated with the message queue.
An attempt is made to increase the value of msg_qbytes through IPC_SET but the caller is not the super-user.
[EACCES] The command is IPC_STAT and the caller has no read permission for this message queue. [EINVAL] The msqid argument is not a valid message queue identifier.
cmd is not a valid command.
[EFAULT] The buf argument specifies an invalid address.
Message queues appeared in the first release of AT&T V .