Os.linux.epoll_create1 compile error

Ok, I will mark this as solution,
but it’s strange to see epoll_create1, epoll_ctl, epoll_wait, timerfd_create inside std.posix. they all should be in std.os.linux or something like this.

Moreover, we have (as an example):

/opt/zig-0.12/lib/std/posix.zig:pub fn timerfd_create(clokid: i32, flags: linux.TFD) TimerFdCreateError!fd_t {
/opt/zig-0.12/lib/std/os/linux.zig:pub fn timerfd_create(clockid: i32, flags: TFD) usize {

The first is a wrapper for the second, ok.

But:

$ grep -rI "const itimerspec" /opt/zig-0.12/
/opt/zig-0.12/lib/std/os/linux.zig:pub const itimerspec = extern struct {
/opt/zig-0.12/lib/std/os/linux.zig:pub fn timerfd_settime(fd: i32, flags: TFD.TIMER, new_value: *const itimerspec, old_value: ?*itimerspec) usize {
/opt/zig-0.12/lib/std/os/linux.zig:pub fn setitimer(which: i32, new_value: *const itimerspec, old_value: ?*itimerspec) usize {
/opt/zig-0.12/lib/std/c/haiku.zig:pub const itimerspec = extern struct {

So some OS facility, specific to Linux (timerfd) is in std.posix, but data structures for this facility are still in std.os.linux… it is confusing, at least.

1 Like