pub unsafe extern "C" fn suit_worker_try_prepare(
    buffer: *mut *mut u8,
    size: *mut size_t
) -> c_int
Expand description

@brief Prepare for a worker run with a preloaded manifest

This obtains a lock on the SUIT worker, and provides a pointer to a memory area into which the manifest is to be written. The lock must be released by calling @ref suit_worker_trigger_prepared later.

@param[out] buffer On success, buffer into which the image may be written. @param[inout] size Requested buffer size. On some errors, this will be decreased to a size that would be acceptable.

@return 0 on success @return -EAGAIN if the worker is currently busy. @return -ENOMEM if the worker is available but the requested size is too large. (In this case, an acceptable size is indicated in size).

@note There is no blocking version of this (it behaves like @ref mutex_trylock, not like @ref mutex_lock). This allows a simpler implementation on the thread handling side, and is also what typical use cases need.