mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
std.os.linux: Add clock_nanosleep() syscall wrapper.
This commit is contained in:
parent
68bb788df5
commit
8043197995
1 changed files with 15 additions and 0 deletions
|
|
@ -1456,6 +1456,16 @@ pub fn clock_settime(clk_id: i32, tp: *const timespec) usize {
|
|||
return syscall2(.clock_settime, @as(usize, @bitCast(@as(isize, clk_id))), @intFromPtr(tp));
|
||||
}
|
||||
|
||||
pub fn clock_nanosleep(clockid: clockid_t, flags: TIMER, request: *const timespec, remain: ?*timespec) usize {
|
||||
return syscall4(
|
||||
.clock_nanosleep,
|
||||
@intFromEnum(clockid),
|
||||
@as(u32, @bitCast(flags)),
|
||||
@intFromPtr(request),
|
||||
@intFromPtr(remain),
|
||||
);
|
||||
}
|
||||
|
||||
pub fn gettimeofday(tv: ?*timeval, tz: ?*timezone) usize {
|
||||
return syscall2(.gettimeofday, @intFromPtr(tv), @intFromPtr(tz));
|
||||
}
|
||||
|
|
@ -4527,6 +4537,11 @@ pub const clockid_t = enum(u32) {
|
|||
_,
|
||||
};
|
||||
|
||||
pub const TIMER = packed struct(u32) {
|
||||
ABSTIME: bool,
|
||||
_: u31 = 0,
|
||||
};
|
||||
|
||||
pub const CSIGNAL = 0x000000ff;
|
||||
|
||||
pub const CLONE = struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue