Gets the security attributes of a shared memory segment.
Standard C library (libc.a)
#include <sys/mac.h>
#include <sys/ipc.h>
#include <sys/shm.h>
int sec_getshmsec (shmid, ipcsec)
int shmid;
ipc_sec_t *ipcsec;
The sec_getshmsec subroutine retrieves the security attributes associated with the shared memory segment that is specified by the shmid 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 shared memory segment.
Item | Description |
---|---|
shmid | Specifies the shared memory segment. |
ipcsec | Points to an ipc_sec_t structure. |
Item | Description |
---|---|
0 | Successful |
-1 | Unsuccessful |
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 shared memory segment that the shmid parameter specifies is not valid. |