Enabling evented I/O on macOS causes an error in the networking code of the standard library.
Code sample:
const std = @import("std");
const os = std.os;
pub const io_mode = .evented;
pub fn main() !void {
const addr = "127.0.0.1";
const port = 6379;
var fd = try os.socket(os.AF_INET, os.SOCK_STREAM, 0);
errdefer os.close(fd);
var sock_addr = (try std.net.Address.parseIp4(addr, port)).any;
try os.connect(fd, &sock_addr, @sizeOf(os.sockaddr_in));
var sock = std.fs.File.openHandle(fd);
}
Current output:
/Users/kristoff/zig/build/lib/zig/std/event/loop.zig:506:39: error: container 'std.os' has no member called 'EPOLLET'
return self.linuxWaitFd(fd, os.EPOLLET | os.EPOLLONESHOT | os.EPOLLIN);
^
/Users/kristoff/zig/build/lib/zig/std/event/loop.zig:455:26: error: container 'std.os' has no member called 'EPOLLET'
assert(flags & os.EPOLLET == os.EPOLLET);
^
Yep, only epoll integration is done so far - but kqueue & Windows I/O Completion Ports are planned for this release cycle.
Most helpful comment
Yep, only epoll integration is done so far - but kqueue & Windows I/O Completion Ports are planned for this release cycle.