-
Notifications
You must be signed in to change notification settings - Fork 12
/
poll.rs
37 lines (30 loc) · 1019 Bytes
/
poll.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) 2020 Xu Shaohua <shaohua@biofan.org>. All rights reserved.
// Use of this source is governed by Apache-2.0 License that can be found
// in the LICENSE file.
//! From `include/uapi/asm-generic/poll.h`
use crate::poll_t;
/// These are specified by `iBCS2`
pub const POLLIN: i32 = 0x0001;
pub const POLLPRI: i32 = 0x0002;
pub const POLLOUT: i32 = 0x0004;
pub const POLLERR: i32 = 0x0008;
pub const POLLHUP: i32 = 0x0010;
pub const POLLNVAL: i32 = 0x0020;
/// The rest seem to be more-or-less nonstandard. Check them!
pub const POLLRDNORM: i32 = 0x0040;
pub const POLLRDBAND: i32 = 0x0080;
pub const POLLWRNORM: i32 = 0x0100;
pub const POLLWRBAND: i32 = 0x0200;
pub const POLLMSG: i32 = 0x0400;
pub const POLLREMOVE: i32 = 0x1000;
pub const POLLRDHUP: i32 = 0x2000;
/// currently only for epoll
pub const POLLFREE: poll_t = 0x4000;
pub const POLL_BUSY_LOOP: poll_t = 0x8000;
#[repr(C)]
#[derive(Debug, Default, Clone)]
pub struct pollfd_t {
pub fd: i32,
pub events: i16,
revents: i16,
}