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 {...@@ -2210,7 +2210,6 @@ pub const libc = struct {
2210 /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_condattr_destroy.html2210 /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_condattr_destroy.html
2211 pub extern fn pthread_condattr_destroy(attr: *pthread_condattr_t) c_int;2211 pub extern fn pthread_condattr_destroy(attr: *pthread_condattr_t) c_int;
22122212
2213
2214 /// int pthread_condattr_init(pthread_condattr_t *attr);2213 /// int pthread_condattr_init(pthread_condattr_t *attr);
2215 /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_condattr_init.html2214 /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_condattr_init.html
2216 pub extern fn pthread_condattr_init(attr: *pthread_condattr_t) c_int;2215 pub extern fn pthread_condattr_init(attr: *pthread_condattr_t) c_int;
...@@ -2751,6 +2750,7 @@ pub const libc = struct {...@@ -2751,6 +2750,7 @@ pub const libc = struct {
2751 pub extern fn sched_getaffinity(pid: pid_t, cpusetsize: usize, mask: *cpu_set_t) c_int;2750 pub extern fn sched_getaffinity(pid: pid_t, cpusetsize: usize, mask: *cpu_set_t) c_int;
2752 pub extern fn getrandom(buf: [*]u8, size: usize, flags: c_uint) isize;2751 pub extern fn getrandom(buf: [*]u8, size: usize, flags: c_uint) isize;
2753 pub extern fn flock(fd: c_int, op: c_int) c_int;2752 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;
2754};2754};
27552755
2756pub const clock_t = c_long;2756pub const clock_t = c_long;
...@@ -3512,3 +3512,8 @@ pub fn flock(fd: c_int, op: c_int) !void {...@@ -3512,3 +3512,8 @@ pub fn flock(fd: c_int, op: c_int) !void {
3512 if (rc == -1) return errno.fromInt(errno.fromLibC());3512 if (rc == -1) return errno.fromInt(errno.fromLibC());
3513 std.debug.assert(rc == 0);3513 std.debug.assert(rc == 0);
3514}3514}
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 {...@@ -61,4 +61,5 @@ test {
61 _ = &linux.mkdtemp;61 _ = &linux.mkdtemp;
62 _ = &linux.getrandom;62 _ = &linux.getrandom;
63 _ = &linux.flock;63 _ = &linux.flock;
64 _ = &linux.futimens;
64}65}