-
Notifications
You must be signed in to change notification settings - Fork 166
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
Weird epoll comment around close #1100
Comments
Hmmm, also confused about why |
Actually the fn wait<I: Into<SliceOrVec>>(..., event_buf: I) -> io::Result<&mut [Event]>
enum SliceOrVec<'a> {
Slice(&'a mut [MaybeUninit<Event>]),
Vec(&'a mut Vec<Event>),
}
impl From slice/vec for SliceOrVec
// Usage
for event in wait(..., &mut stack OR vec.spare_capacity_mut()) {}
let mut vec = ...;
wait(..., vec.spare_capacity_mut());
do_stuff(&vec) Thoughts? This seems way more flexible and less code than the current version. |
Also I don't think the API should clear/set_len(0) the vec at all, that's the caller's problem (use drain) and they might want to only partially process events for some reason. I guess maybe it's fine? But seems weird to kill stuff in your buffer. |
Ooo, pretty sure this is backwards compatible with a from impl for EventVec! So we could do all this in 0.38 with a deprecation and only drop EventVec later. |
https://docs.rs/rustix/latest/rustix/event/epoll/fn.add.html says that closing a FD doesn't do anything which directly contradicts the man pages: https://man7.org/linux/man-pages/man7/epoll.7.html#:~:text=Will%20closing%20a%20file%20descriptor%20cause%20it%20to%20be%20removed%20from%20all%0A%20%20%20%20%20%20%20%20%20%20epoll%20interest%20lists%3F
@notgull is there context I'm missing or can we just remove that comment in favor of the man pages?
The text was updated successfully, but these errors were encountered: