add descriptions to sleep and nanosleep

This commit is contained in:
auronandace
2026-07-05 10:50:57 +01:00
parent fef4343580
commit fe1c4e0135
3 changed files with 25 additions and 3 deletions
+14
View File
@@ -485,7 +485,21 @@ pub unsafe extern "C" fn mktime(timeptr: *mut tm) -> time_t {
timestamp
}
// FIXME seems redox-rt sys posix_nanosleep calls wrapper which disables signals
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/nanosleep.html>.
///
/// Causes the current thread to be suspended from execution until either the
/// time interval specified by `rqtp` has elapsed or a signal is delivered to
/// the calling thread, and its action is to invoke a signal-catching function
/// or to terminate the process.
///
/// Has no effect on the action or blockage of any signal.
///
/// Upon success, returns `0`. Upon failure, returns `-1` and sets errno to
/// indicate the error. If `rmtp` is non-NULL and `nanosleep()` is interrupted
/// by a signal, returns `-1` and updates `rmtp` to contain the requested time
/// minus the actually elapsed time. If `rmtp` is NULL the remaining time is
/// not returned.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> c_int {
unsafe { Sys::nanosleep(rqtp, rmtp) }