@@ -7,22 +7,22 @@ use ::Error;
7
7
8
8
bitflags ! (
9
9
#[ repr( C ) ]
10
- pub flags EpollFlags : u32 {
11
- const EPOLLIN = libc:: EPOLLIN as u32 ,
12
- const EPOLLPRI = libc:: EPOLLPRI as u32 ,
13
- const EPOLLOUT = libc:: EPOLLOUT as u32 ,
14
- const EPOLLRDNORM = libc:: EPOLLRDNORM as u32 ,
15
- const EPOLLRDBAND = libc:: EPOLLRDBAND as u32 ,
16
- const EPOLLWRNORM = libc:: EPOLLWRNORM as u32 ,
17
- const EPOLLWRBAND = libc:: EPOLLWRBAND as u32 ,
18
- const EPOLLMSG = libc:: EPOLLMSG as u32 ,
19
- const EPOLLERR = libc:: EPOLLERR as u32 ,
20
- const EPOLLHUP = libc:: EPOLLHUP as u32 ,
21
- const EPOLLRDHUP = libc:: EPOLLRDHUP as u32 ,
10
+ pub flags EpollFlags : libc :: c_int {
11
+ const EPOLLIN = libc:: EPOLLIN ,
12
+ const EPOLLPRI = libc:: EPOLLPRI ,
13
+ const EPOLLOUT = libc:: EPOLLOUT ,
14
+ const EPOLLRDNORM = libc:: EPOLLRDNORM ,
15
+ const EPOLLRDBAND = libc:: EPOLLRDBAND ,
16
+ const EPOLLWRNORM = libc:: EPOLLWRNORM ,
17
+ const EPOLLWRBAND = libc:: EPOLLWRBAND ,
18
+ const EPOLLMSG = libc:: EPOLLMSG ,
19
+ const EPOLLERR = libc:: EPOLLERR ,
20
+ const EPOLLHUP = libc:: EPOLLHUP ,
21
+ const EPOLLRDHUP = libc:: EPOLLRDHUP ,
22
22
const EPOLLEXCLUSIVE = 1 << 28 ,
23
- const EPOLLWAKEUP = libc:: EPOLLWAKEUP as u32 ,
24
- const EPOLLONESHOT = libc:: EPOLLONESHOT as u32 ,
25
- const EPOLLET = libc:: EPOLLET as u32 ,
23
+ const EPOLLWAKEUP = libc:: EPOLLWAKEUP ,
24
+ const EPOLLONESHOT = libc:: EPOLLONESHOT ,
25
+ const EPOLLET = libc:: EPOLLET ,
26
26
}
27
27
) ;
28
28
@@ -48,15 +48,15 @@ pub struct EpollEvent {
48
48
49
49
impl EpollEvent {
50
50
pub fn new ( events : EpollFlags , data : u64 ) -> Self {
51
- EpollEvent { event : libc:: epoll_event { events : events. bits ( ) , u64 : data } }
51
+ EpollEvent { event : libc:: epoll_event { events : events. bits ( ) as u32 , u64 : data } }
52
52
}
53
53
54
54
pub fn empty ( ) -> Self {
55
55
unsafe { mem:: zeroed :: < EpollEvent > ( ) }
56
56
}
57
57
58
58
pub fn events ( & self ) -> EpollFlags {
59
- EpollFlags :: from_bits ( self . event . events ) . unwrap ( )
59
+ EpollFlags :: from_bits ( self . event . events as libc :: c_int ) . unwrap ( )
60
60
}
61
61
62
62
pub fn data ( & self ) -> u64 {
0 commit comments