-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aio: add aio.Poll #14
base: master
Are you sure you want to change the base?
Conversation
Poll events should be bit map pub const Poll = struct {
pub const Events = packed struct(u32) {
in: bool = false,
out: bool = false,
pri: bool = false,
_: u29 = 0,
};
pub const Error = std.posix.PollError || SharedError;
fd: std.posix.fd_t,
events: Events = .{ .in = true },
out_id: ?*Id = null,
out_error: ?*Error = null,
link: Link = .unlinked,
userdata: usize = 0,
};
aio.Single(aio.Poll{ .fd = fd, .events = .{ .out = true } }); In addition, I don't like the implementation of Readiness.mode which makes it difficult to simply check mode pub const Readiness = struct {
fd: std.posix.fd_t = invalid_fd,
mode: packed struct(i16) {
in: bool = false,
out: bool = false,
pri: bool = false,
kludge: bool = false,
_: u12 = 0,
},
}; I made a draft |
The readiness originally was not meant to implement poll. Your changes make sense. The I'd also be grateful if you can add more tests. |
Add of the poll op described at https://unixism.net/loti/ref-iouring/io_uring_enter.html