authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-06 03:01:29 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-06 03:01:29 -07:00
logb49fdea61f8a48c7b677a6187b3c3c19e7f2f862
tree37b57403eb037e65eaf288680cc00ced1171c353
parent65fa94b4a49f1d5d31ecebc7130e05ec0c2802bf
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

add futimens


2 files changed, 7 insertions(+), 1 deletions(-)

mod.zig+6-1
......@@ -2210,7 +2210,6 @@ pub const libc = struct {
22102210 /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_condattr_destroy.html
22112211 pub extern fn pthread_condattr_destroy(attr: *pthread_condattr_t) c_int;
22122212
2213
22142213 /// int pthread_condattr_init(pthread_condattr_t *attr);
22152214 /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_condattr_init.html
22162215 pub extern fn pthread_condattr_init(attr: *pthread_condattr_t) c_int;
......@@ -2751,6 +2750,7 @@ pub const libc = struct {
27512750 pub extern fn sched_getaffinity(pid: pid_t, cpusetsize: usize, mask: *cpu_set_t) c_int;
27522751 pub extern fn getrandom(buf: [*]u8, size: usize, flags: c_uint) isize;
27532752 pub extern fn flock(fd: c_int, op: c_int) c_int;
2753 pub extern fn futimens(fd: c_int, times: *const [2]struct_timespec) c_int;
27542754};
27552755
27562756pub const clock_t = c_long;
......@@ -3512,3 +3512,8 @@ pub fn flock(fd: c_int, op: c_int) !void {
35123512 if (rc == -1) return errno.fromInt(errno.fromLibC());
35133513 std.debug.assert(rc == 0);
35143514}
3515pub fn futimens(fd: c_int, times: [2]struct_timespec) !void {
3516 const rc = libc.futimens(fd, &times);
3517 if (rc == -1) return errno.fromInt(errno.fromLibC());
3518 std.debug.assert(rc == 0);
3519}
test.zig+1
......@@ -61,4 +61,5 @@ test {
6161 _ = &linux.mkdtemp;
6262 _ = &linux.getrandom;
6363 _ = &linux.flock;
64 _ = &linux.futimens;
6465}