get_shm_handle

Function get_shm_handle 

Source
pub fn get_shm_handle(shm: ShmLabel) -> Status
Expand description

Get global identifier for a given SHM label

§Usage

This syscall set the SHM handle that matches the given label in the SVC_EXCHANGE area if the label matches a shared-memory that has been declared in the device tree, and is owned or shared with the current task.

If label is not found or no accessible shared memory is found, the resulting status is Status::Invalid. The SVC_EXCHANGE area is not set.

NOTE: except without good reasons, do not use this syscall directly

§Example

match sentry_uapi::syscall::get_shm_handle(shmlabel) {
    Status::Ok => (),
    any_err => return (any_err),
}
let exch_area = unsafe { &mut SVC_EXCHANGE_AREA[..4] };
let handle = u32::from_ne_bytes(exch_area.try_into().map_err(|_| Status::Invalid)?);