RTI Connext DDS Micro C API
Version 3.0.2
|
Functions | |
RTIBool | OSAPI_SharedMemorySegment_create_or_attach (struct OSAPI_SharedMemorySegmentHandle *handle, RTI_INT32 *status_out, RTI_INT32 key, RTI_UINT32 size, OSAPI_ProcessId pid_in) |
Attempts to create a new shared memory segment. If the segment already exists and the creator process is dead, attach and recycle it. | |
RTIBool | OSAPI_SharedMemorySegment_create (struct OSAPI_SharedMemorySegmentHandle *handle, RTI_INT32 *status_out, RTI_INT32 key, RTI_UINT32 size, OSAPI_ProcessId pid_in) |
Creates a new shared memory segment with the provided key and returns the handle to access it. | |
RTIBool | OSAPI_SharedMemorySegment_delete (struct OSAPI_SharedMemorySegmentHandle *handle) |
deletes the shared memory segment previously create with OSAPI_SharedMemorySegment_create. If the segment is still attached, it is detached first. | |
RTIBool | OSAPI_SharedMemorySegment_attach (struct OSAPI_SharedMemorySegmentHandle *handle, RTI_INT32 *status_out, RTI_INT32 key) |
Attach to the shared memory previously initialized with OSAPI_SharedMemorySegment_create_or_attach and returns a handle to it. | |
RTIBool | OSAPI_SharedMemorySegment_detach (struct OSAPI_SharedMemorySegmentHandle *handle) |
Detach from the shared memory previously created with OSAPI_SharedMemorySegment_attach. | |
char * | OSAPI_SharedMemorySegment_get_address (struct OSAPI_SharedMemorySegmentHandle *handle) |
Get the address of the shared memory attached by the handle. | |
RTI_INT32 | OSAPI_SharedMemorySegment_get_size (struct OSAPI_SharedMemorySegmentHandle *handle) |
Get the size (available for user data) of the shared memory segment. | |
RTI_UINT32 | OSAPI_SharedMemorySegment_get_max_size () |
Maximum allowable size of a shared memory segment. |
RTIBool OSAPI_SharedMemorySegment_create_or_attach | ( | struct OSAPI_SharedMemorySegmentHandle * | handle, |
RTI_INT32 * | status_out, | ||
RTI_INT32 | key, | ||
RTI_UINT32 | size, | ||
OSAPI_ProcessId | pid_in | ||
) |
Attempts to create a new shared memory segment. If the segment already exists and the creator process is dead, attach and recycle it.
[in,out] | handle | The shared memory segment handle to initialize. |
[out] | status_out | Optional: if not NULL is set to the reason why the call has succeeded or failed. In particular,
|
[in] | key | Key to identify the shared memory segment Across processes. Other processes should call OSAPI_SharedMemorySegment_attach with the same key to attach to this segment. |
[in] | size | Size of memory to be initialized. |
[in] | pid_in | PID of the process that calls this method. |
RTIBool OSAPI_SharedMemorySegment_create | ( | struct OSAPI_SharedMemorySegmentHandle * | handle, |
RTI_INT32 * | status_out, | ||
RTI_INT32 | key, | ||
RTI_UINT32 | size, | ||
OSAPI_ProcessId | pid_in | ||
) |
Creates a new shared memory segment with the provided key and returns the handle to access it.
[in,out] | handle | The shared memory segment handle to initialize. |
[out] | status_out | Optional: if not NULL is set to the reason why the call has succeeded or failed. In particular,
|
[in] | key | Key to identify the shared memory segment across processes. Other processes should call OSAPI_SharedMemorySegment_attach with the same key to attach to this segment. |
[in] | size | Size of memory to be initialized. |
[in] | pid_in | PID of the process that calls this method. |
RTIBool OSAPI_SharedMemorySegment_delete | ( | struct OSAPI_SharedMemorySegmentHandle * | handle | ) |
deletes the shared memory segment previously create with OSAPI_SharedMemorySegment_create. If the segment is still attached, it is detached first.
[in] | handle | The shared memory segment handle identifying the segment to detach |
Once called this function (even if it returns RTI_FALSE) you cannot use anymore this shared memory segment.
RTIBool OSAPI_SharedMemorySegment_attach | ( | struct OSAPI_SharedMemorySegmentHandle * | handle, |
RTI_INT32 * | status_out, | ||
RTI_INT32 | key | ||
) |
Attach to the shared memory previously initialized with OSAPI_SharedMemorySegment_create_or_attach and returns a handle to it.
[in,out] | handle | The shared memory segment handle to initialize. |
[out] | status_out | Optional. If not NULL, will be set to:
|
[in] | key | Key to identify the shared memory segment across processes. Must match that used by other processes calling OSAPI_SharedMemorySegment_create_or_attach or OSAPI_SharedMemorySegment_attach(). |
RTIBool OSAPI_SharedMemorySegment_detach | ( | struct OSAPI_SharedMemorySegmentHandle * | handle | ) |
Detach from the shared memory previously created with OSAPI_SharedMemorySegment_attach.
[in] | handle | The shared memory segment handle identifying the segment to detach |
The shared memory segment is always detached. Once the precondition is met, no errors will be generated.
Once called this function (even if it returns RTI_FALSE) you cannot use anymore this shared memory segment, except for destroying it.
char* OSAPI_SharedMemorySegment_get_address | ( | struct OSAPI_SharedMemorySegmentHandle * | handle | ) |
Get the address of the shared memory attached by the handle.
[in] | handle | Handle to the shared memory segment obtained from an OSAPI_SharedMemorySegment_attach or a OSAPI_SharedMemorySegment_create_or_attach |
RTI_INT32 OSAPI_SharedMemorySegment_get_size | ( | struct OSAPI_SharedMemorySegmentHandle * | handle | ) |
Get the size (available for user data) of the shared memory segment.
This size will match the one passed to the OSAPI_SharedMemorySegment_create_or_attach call
[in] | handle | Handle to the shared memory segment obtained from an OSAPI_SharedMemorySegment_attach or a OSAPI_SharedMemorySegment_create_or_attach call. |
RTI_UINT32 OSAPI_SharedMemorySegment_get_max_size | ( | ) |
Maximum allowable size of a shared memory segment.