Go to the source code of this file.
Defines | |
#define | SHM_PERMISSION 0x000001C0 |
Define default permissions for all newly created SHM. It should ne read just like file permissions: 0x1C0 = 111000000 in binary, that is 111 000 000. This gives all rights for the user and nothing for other users. | |
#define | CREATE_SHM_OK -1 |
Return value for the function create_shared_memory_segment(). This means that the SHM has been successfully created. | |
#define | CREATE_SHM_ALREADY_CREATED -2 |
Return value for the function create_shared_memory_segment(). This means that the SHM has already been created. | |
#define | CREATE_SHM_ERROR -3 |
Return value for the function create_shared_memory_segment(). This means that an error occured while creating the shared memory segment. | |
#define | GET_SHM_OK -1 |
Return value for the function get_shared_memory_segment_sys_id(). This means that the SHM system identifier has been looked up successfully. | |
#define | GET_SHM_ALREADY_GET -2 |
Return value for the function get_shared_memory_segment_sys_id(). This means that the SHM system identifier jas already been looked up. | |
#define | GET_SHM_ERROR -3 |
Return value for the function get_shared_memory_segment_sys_id(). This means that an error occured while getting the system's identifier. | |
#define | SHM_HD |
Functions | |
void | change_shm_access_permission (int new_permission) |
Change the SHM's default permissions. | |
int | create_shared_memory_segment (key_t ipc_key, int size) |
Create the shared memory segment. | |
int | get_shared_memory_segment_sys_id (key_t ipc_key, int size) |
Get the system's identifier of a shared memory segment that has already been created (by another process). | |
int | get_shared_memory_segment_id () |
Returns the shared memory segment identifier. | |
SHM_addr | attache_shared_memory_segment () |
Attache a previously created shared memory segment. | |
SHM_addr | get_shm_address () |
Returns the address used by the process to access the shared memory segment. | |
int | set_shm_auto_destroy () |
Tell the IPC library to destroy the SHM on the last detachement. | |
shmid_ds * | get_shm_info () |
Return the data structure that describes the Shared Memory Segment (as documented in man shmget). | |
int | detache_shm () |
Detache the Shared Memory Segment. |
Definition in file my_shm.h.
|
Attache a previously created shared memory segment.
Definition at line 158 of file shm.c. References attachement_address, and shm_id. |
|
Change the SHM's default permissions.
Definition at line 32 of file shm.c. References permissions. |
|
Create the shared memory segment.
Definition at line 51 of file shm.c. References CREATE_SHM_ALREADY_CREATED, CREATE_SHM_ERROR, CREATE_SHM_OK, permissions, and shm_id. |
|
Detache the Shared Memory Segment.
Definition at line 190 of file shm.c. References attachement_address. |
|
Returns the shared memory segment identifier.
Definition at line 137 of file shm.c. References shm_id. |
|
Get the system's identifier of a shared memory segment that has already been created (by another process).
Definition at line 92 of file shm.c. References GET_SHM_ALREADY_GET, GET_SHM_ERROR, GET_SHM_OK, and shm_id. |
|
Returns the address used by the process to access the shared memory segment.
Definition at line 147 of file shm.c. References attachement_address. |
|
Return the data structure that describes the Shared Memory Segment (as documented in man shmget).
Definition at line 174 of file shm.c. References get_shm_info(), shm_id, and shm_info. Referenced by get_shm_info(). |
|
Tell the IPC library to destroy the SHM on the last detachement.
Definition at line 124 of file shm.c. References shm_id. |