Establishing a new memory segment with rsm_memseg_export_create enables the association of physical memory with the segment at creation time. The operation returns an export-side memory segment handle to the new memory segment. The segment exists for the lifetime of the creating process or until destroyed with rsm_memseg_export_destroy.
If destroy operation is performed before an import side disconnect, the disconnect is forced.
This function creates a segment handle. After the segment handle is created, the segment handle is bound to the specified virtual address range [vaddr..vaddr+size]. The range must be valid and aligned on the controller's alignment property. The flags argument is a bitmask, which enables:
Unbinding on the segment
Rebinding on the segment
Passing RSM_ALLOW_REBIND to flags
Support of lock operations
Passing RSM_LOCK_OPS to flags
The RSM_LOCK_OPS flag is not included in the initial release of RSMAPI.
Return Values: Returns 0 if successful. Returns an error value otherwise.
Invalid controller handle
Controller not present
Invalid segment handle
Length zero or length exceeds controller limits
Invalid address
Permission denied
Insufficient memory
Insufficient resources
Address not aligned on page boundary
Operation interrupted by signal
This function deallocates segment and its free resources. All importing processes are forcibly disconnected.
Return Values: Returns 0 if successful. Returns an error value otherwise.
Invalid segment handle
pollfd in use