authorgravatar for devnexen@gmail.comDavid Carlier <devnexen@gmail.com> 2023-05-19 12:44:08+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-06-18 08:09:42-07:00
log54ea0bbcdddc9e13ed98415d8883f03d59392509
treeae48405c208166e66aee184cd8225ee1a829bc1d
parentc17a8df2fad6e0297bc8151d76090f55d5f17c95

std.c: exposing timer api


6 files changed, 14 insertions(+), 0 deletions(-)

lib/std/c.zig+5
...@@ -408,6 +408,11 @@ pub extern "c" fn setlogmask(maskpri: c_int) c_int;...@@ -408,6 +408,11 @@ pub extern "c" fn setlogmask(maskpri: c_int) c_int;
408408
409pub extern "c" fn if_nametoindex([*:0]const u8) c_int;409pub extern "c" fn if_nametoindex([*:0]const u8) c_int;
410410
411pub extern "c" fn timer_create(clockid: c.clockid_t, sevp: *c.sigevent, timerid: *c.timer_t) c_int;
412pub extern "c" fn timer_delete(timerid: c.timer_t) c_int;
413pub extern "c" fn timer_settime(timerid: c.timer_t, flags: c_int, new_value: *const c.itimerspec, old_value: *c.itimerspec) c_int;
414pub extern "c" fn timer_gettime(timerid: c.timer_t, flags: c_int, curr_value: *c.itimerspec) c_int;
415
411pub const max_align_t = if (builtin.abi == .msvc)416pub const max_align_t = if (builtin.abi == .msvc)
412 f64417 f64
413else if (builtin.target.isDarwin())418else if (builtin.target.isDarwin())
lib/std/c/dragonfly.zig+2
...@@ -1162,3 +1162,5 @@ pub const sigevent = extern struct {...@@ -1162,3 +1162,5 @@ pub const sigevent = extern struct {
1162};1162};
11631163
1164pub const PTHREAD_STACK_MIN = 16 * 1024;1164pub const PTHREAD_STACK_MIN = 16 * 1024;
1165
1166pub const timer_t = *opaque {};
lib/std/c/freebsd.zig+2
...@@ -2586,6 +2586,8 @@ pub const sigevent = extern struct {...@@ -2586,6 +2586,8 @@ pub const sigevent = extern struct {
2586 },2586 },
2587};2587};
25882588
2589pub const timer_t = *opaque {};
2590
2589pub const MIN = struct {2591pub const MIN = struct {
2590 pub const INCORE = 0x1;2592 pub const INCORE = 0x1;
2591 pub const REFERENCED = 0x2;2593 pub const REFERENCED = 0x2;
lib/std/c/linux.zig+1
...@@ -100,6 +100,7 @@ pub const stack_t = linux.stack_t;...@@ -100,6 +100,7 @@ pub const stack_t = linux.stack_t;
100pub const tcflag_t = linux.tcflag_t;100pub const tcflag_t = linux.tcflag_t;
101pub const termios = linux.termios;101pub const termios = linux.termios;
102pub const time_t = linux.time_t;102pub const time_t = linux.time_t;
103pub const timer_t = linux.timer_t;
103pub const timespec = linux.timespec;104pub const timespec = linux.timespec;
104pub const timeval = linux.timeval;105pub const timeval = linux.timeval;
105pub const timezone = linux.timezone;106pub const timezone = linux.timezone;
lib/std/c/netbsd.zig+2
...@@ -1723,3 +1723,5 @@ pub extern "c" fn ptrace(request: c_int, pid: pid_t, addr: ?*anyopaque, data: c_...@@ -1723,3 +1723,5 @@ pub extern "c" fn ptrace(request: c_int, pid: pid_t, addr: ?*anyopaque, data: c_
17231723
1724/// TODO refines if necessary1724/// TODO refines if necessary
1725pub const PTHREAD_STACK_MIN = 16 * 1024;1725pub const PTHREAD_STACK_MIN = 16 * 1024;
1726
1727pub const timer_t = *opaque {};
lib/std/c/solaris.zig+2
...@@ -1948,3 +1948,5 @@ pub const sigevent = extern struct {...@@ -1948,3 +1948,5 @@ pub const sigevent = extern struct {
1948};1948};
19491949
1950pub const PTHREAD_STACK_MIN = if (@sizeOf(usize) == 8) 8 * 1024 else 4 * 1024;1950pub const PTHREAD_STACK_MIN = if (@sizeOf(usize) == 8) 8 * 1024 else 4 * 1024;
1951
1952pub const timer_t = *opaque {};