Go to the previous, next section.
int msgctl(int msqid,int cmd,struct msqid_ds *buf);
msqid: [in] the message queue to manipulate.
cmd: [in] the operation to perform on the message queue.
buf: the interpretation of this parameter depends on cmd.
Manipulates a message queue. cmd may be one of:
IPC_STAT
IPC_SET
msqid_ds
structure. The only modifiable parameters are:
msg_perm.uid
, msg_perm.gid
, msg_perm.mode
(only
lowest 9 bits) and msg_qbytes
. The calling task uid must be one
of the creator uid or the owner uid of the queue or the superuser uid.
Only the superuser may rise msg_qbytes
beyond the system limit of
MSGMNB
.
IPC_RMID
On success zero is returned. On error -1 is returned and errno
is
set to one of the following values:
EACCESS
: the caller tried IPC_STAT
but does not have
read permission on the queue.
EIDRM
: the queue is already removed.
EINVAL
: invalid value for cmd or msqid.
EPERM
: the taks tried an operation for which it does not
have the necessary privileges.
EFAULT
.
Go to the previous, next section.