Skip to content

Commit 4c9e42f

Browse files
committed
Auto merge of #524 - kamalmarhubi:epoll-flags-libc_bitflags, r=fiveop
epoll: Use libc_bitflags for EpollFlags This is possible now that EPOLLEXCLUSIVE was added to libc in rust-lang/libc#526
2 parents c3905ee + ac9f291 commit 4c9e42f

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/sys/epoll.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ use std::ptr;
55
use std::mem;
66
use ::Error;
77

8-
bitflags!(
9-
#[repr(C)]
8+
libc_bitflags!(
109
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-
const EPOLLEXCLUSIVE = 1 << 28,
23-
const EPOLLWAKEUP = libc::EPOLLWAKEUP,
24-
const EPOLLONESHOT = libc::EPOLLONESHOT,
25-
const EPOLLET = libc::EPOLLET,
10+
EPOLLIN,
11+
EPOLLPRI,
12+
EPOLLOUT,
13+
EPOLLRDNORM,
14+
EPOLLRDBAND,
15+
EPOLLWRNORM,
16+
EPOLLWRBAND,
17+
EPOLLMSG,
18+
EPOLLERR,
19+
EPOLLHUP,
20+
EPOLLRDHUP,
21+
#[cfg(target_os = "linux")] // Added in 4.5; not in Android.
22+
EPOLLEXCLUSIVE,
23+
EPOLLWAKEUP,
24+
EPOLLONESHOT,
25+
EPOLLET,
2626
}
2727
);
2828

0 commit comments

Comments
 (0)