clock_getres/clock_settime additions

This commit is contained in:
David Carlier
2023-05-08 18:52:05 +01:00
parent 9661efe619
commit 2db85f9a3f
4 changed files with 29 additions and 5 deletions
+8
View File
@@ -106,10 +106,18 @@ impl Pal for Sys {
}) as c_int
}
fn clock_getres(clk_id: clockid_t, tp: *mut timespec) -> c_int {
e(unsafe { syscall!(CLOCK_GETRES, clk_id, tp) }) as c_int
}
fn clock_gettime(clk_id: clockid_t, tp: *mut timespec) -> c_int {
e(unsafe { syscall!(CLOCK_GETTIME, clk_id, tp) }) as c_int
}
fn clock_settime(clk_id: clockid_t, tp: *const timespec) -> c_int {
e(unsafe { syscall!(CLOCK_SETTIME, clk_id, tp) }) as c_int
}
fn close(fildes: c_int) -> c_int {
e(unsafe { syscall!(CLOSE, fildes) }) as c_int
}