pub unsafe extern "C" fn sys_clock_nanosleep(
clock_id: i32,
flags: i32,
rqtp: *const timespec,
rmtp: *mut timespec,
) -> i32
Expand description
@brief Sleep for the specified amount of time with respect to the specified clock.
This function will cause the calling thread to sleep either
- until the absolute time specified by @a rqtp (if @a flags includes @ref SYS_TIMER_ABSTIME), or
- until the relative time specified by @a rqtp (if @a flags does not include @ref SYS_TIMER_ABSTIME).
The accepted values for @a clock_id include
- @ref SYS_CLOCK_REALTIME
- @ref SYS_CLOCK_MONOTONIC
If @a rmtp is not NULL, and the thread is awoken prior to the time specified by @a rqtp, then any remaining time will be written to @a rmtp. If the thread has slept for at least the time specified by @a rqtp, then @a rmtp will be set to zero.
@param clock_id The clock to by which to sleep. @param flags Flags to modify the behavior of the sleep operation. @param rqtp Pointer to the requested time to sleep. @param rmtp Pointer to memory into which to copy the remaining time, if any.
@retval 0 on success.
@retval -EINVAL when an invalid @a clock_id, when @a rqtp contains nanoseconds outside of the
range [0, 999999999]
, or when @a rqtp contains a negative value.