Provides message-queue control operations.
#include <sys/types.h> #include <sys/errno.h> #include <sys/ipc.h> #include <sys/msg.h>
int kmsgctl (msqid, cmd, buf) int msqid, cmd; struct msqid_ds *buf;
The kmsgctl kernel service provides a variety of message-queue control operations as specified by the cmd parameter. The kmsgctl kernel service provides the same functions for user-mode processes in kernel mode as the msgctl subroutine performs for kernel processes or user-mode processes in user mode. The kmsgctl service can be called by a user-mode process in kernel mode or by a kernel process. A kernel process can also call the msgctl subroutine to provide the same function.
The following three commands can be specified with the cmd parameter:
IPC_STAT | Sets only documented fields. See the msgctl subroutine. |
IPC_SET | Sets the value of the following fields of the data structure associated with
the
msqid parameter to the corresponding values found in the structure pointed to by
the
buf parameter:
To perform the IPC_SET operation, the current process must have an effective user ID equal to the value of the msg_perm.uid or msg_perm.cuid field in the data structure associated with the msqid parameter. To raise the value of the msg_qbytes field, the calling process must have the appropriate system privilege. |
IPC_RMID | Removes from the system the message-queue identifier specified by the msqid parameter. This operation also destroys both the message queue and the data structure associated with it. To perform this operation, the current process must have an effective user ID equal to the value of the msg_perm.uid or msg_perm.cuid field in the data structure associated with the msqid parameter. |
The kmsgctl kernel service can be called from the process environment only.
The kmsgctl kernel service is part of Base Operating System (BOS) Runtime.
The msgctl subroutine.
Message Queue Kernel Services and Understanding System Call Execution in AIX Kernel Extensions and Device Support Programming Concepts.