pub unsafe extern "C" fn rtapi_shmem_new(
    key: c_int,
    module_id: c_int,
    size: c_ulong
) -> c_int
Expand description

‘rtapi_shmem_new()’ allocates a block of shared memory. ‘key’ identifies the memory block, and must be non-zero. All modules wishing to access the same memory must use the same key. ‘module_id’ is the ID of the module that is making the call (see rtapi_init). The block will be at least ‘size’ bytes, and may be rounded up. Allocating many small blocks may be very wasteful. When a particular block is allocated for the first time, all bytes are zeroed. Subsequent allocations of the same block by other modules or processes will not touch the contents of the block. On success, it returns a positive integer ID, which is used for all subsequent calls dealing with the block. On failure it returns a negative error code. Call only from within user or init/cleanup code, not from realtime tasks.