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");...@@ -1299,7 +1299,13 @@ pub const ioprio_get = @compileError("TODO: ioprio_get");
1299// inotify_init1299// inotify_init
1300// int inotify_init(void);1300// int inotify_init(void);
1301// asmlinkage long sys_inotify_init(void);1301// 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
1304// inotify_add_watch1310// inotify_add_watch
1305// int inotify_add_watch(int fd, const char *pathname, uint32_t mask);1311// int inotify_add_watch(int fd, const char *pathname, uint32_t mask);
test.zig+1
...@@ -23,4 +23,5 @@ test {...@@ -23,4 +23,5 @@ test {
23 _ = &linux.vhangup;23 _ = &linux.vhangup;
24 _ = &linux.sync;24 _ = &linux.sync;
25 _ = &linux.gettid;25 _ = &linux.gettid;
26 _ = &linux.inotify_init;
26}27}