sec_getmsgsec Subroutine
Purpose
Gets the security attributes of Interprocess Communication (IPC) message queue.
Library
Standard C library (libc.a)
Syntax
#include <sys/mac.h>
#include <sys/ipc.h>
#include <sys/msg.h>
int sec_getmsgsec (msgid, ipcsec)
int msgid;
ipc_sec_t *ipcsec;
Description
The sec_getmsgsec subroutine retrieves the security attributes associated with the message queue that is specified by the msgid parameter. The returned security attributes are stored in the structure that is pointed to by the ipcsec parameter. For a successful completion of the subroutine, the calling process must have MAC and DAC READ access to the message queue.
Parameters
Item | Description |
---|---|
msgid | Specifies the message queue. |
ipcsec | Points to an ipc_sec_t structure. |
Return Values
Item | Description |
---|---|
0 | Successful |
-1 | Unsuccessful |
Error Codes
Item | Description |
---|---|
EACCES | The calling process does not have permissions or privileges. |
EFAULT | The address that the ipcsec parameter points to is not valid. |
EINVAL | The message queue that the msgid parameter specifies is not valid. |