diff --git a/mod.zig b/mod.zig index 7b47d580bf20bd7b27f859614f6e42deb7af656b..ec7b34aac52358cf51aafb3e25aa5d6a207be549 100644 --- a/mod.zig +++ b/mod.zig @@ -2210,7 +2210,6 @@ pub const libc = struct { /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_condattr_destroy.html pub extern fn pthread_condattr_destroy(attr: *pthread_condattr_t) c_int; - /// int pthread_condattr_init(pthread_condattr_t *attr); /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_condattr_init.html pub extern fn pthread_condattr_init(attr: *pthread_condattr_t) c_int; @@ -2751,6 +2750,7 @@ pub const libc = struct { pub extern fn sched_getaffinity(pid: pid_t, cpusetsize: usize, mask: *cpu_set_t) c_int; pub extern fn getrandom(buf: [*]u8, size: usize, flags: c_uint) isize; pub extern fn flock(fd: c_int, op: c_int) c_int; + pub extern fn futimens(fd: c_int, times: *const [2]struct_timespec) c_int; }; pub const clock_t = c_long; @@ -3512,3 +3512,8 @@ pub fn flock(fd: c_int, op: c_int) !void { if (rc == -1) return errno.fromInt(errno.fromLibC()); std.debug.assert(rc == 0); } +pub fn futimens(fd: c_int, times: [2]struct_timespec) !void { + const rc = libc.futimens(fd, ×); + if (rc == -1) return errno.fromInt(errno.fromLibC()); + std.debug.assert(rc == 0); +} diff --git a/test.zig b/test.zig index 63a51d0f57fd78244ee29e29e3c8e290a41854d7..676c30be923fac8072626645c9159ab33d066305 100644 --- a/test.zig +++ b/test.zig @@ -61,4 +61,5 @@ test { _ = &linux.mkdtemp; _ = &linux.getrandom; _ = &linux.flock; + _ = &linux.futimens; }