authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-20 16:45:59 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-20 16:45:59 -07:00
logd3ed3bf1084d8d0e5029a6204188b798b9ff58bf
tree921042e4b7e629dbb3bce14ec9fcf2c6745edbec
parent6c00554bbc2c3b01482a036e2cedcaf7d859e2ca

add inotify_init


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

mod.zig+7-1
......@@ -1299,7 +1299,13 @@ pub const ioprio_get = @compileError("TODO: ioprio_get");
12991299// inotify_init
13001300// int inotify_init(void);
13011301// asmlinkage long sys_inotify_init(void);
1302pub const inotify_init = @compileError("TODO: inotify_init");
1302pub fn inotify_init() errno.Error!c_int {
1303 const r = syscall0(.inotify_init);
1304 return switch (_errno(r)) {
1305 .ok => @intCast(r),
1306 _ => |c| errno.errorFromInt(@intFromEnum(c)),
1307 };
1308}
13031309
13041310// inotify_add_watch
13051311// int inotify_add_watch(int fd, const char *pathname, uint32_t mask);
test.zig+1
......@@ -23,4 +23,5 @@ test {
2323 _ = &linux.vhangup;
2424 _ = &linux.sync;
2525 _ = &linux.gettid;
26 _ = &linux.inotify_init;
2627}