Closed
Description
The current implementation declares all EPOLL* event constants as c_int
, but this isn't very useful given that the accompanying field in struct epoll_event is declared as u32.
pub const EPOLLIN: c_int = 0x1;
pub struct epoll_event {
pub events: u32,
pub u64: u64,
}
This makes using these constants very unergonomic:
error[E0308]: mismatched types
--> src/bin/hld.rs:256:46
|
256 | if event.events & EPOLLIN == EPOLLIN {
| ^^^^^^^ expected `u32`, found `i32`
error[E0277]: no implementation for `u32 & i32`
--> src/bin/hld.rs:256:44
|
256 | if event.events & EPOLLIN == EPOLLIN {
| ^ no implementation for `u32 & i32`
|
The first thing every user of these constants will do is redefine them as u32. Can this be done in the libc crate itself? This applies to all EPOLL* event descriptors and input flags, but not the EPOLL_CTL_* operation constants.