@@ -10,6 +10,7 @@ pub type in_addr_t = u32;
10
10
pub type in_port_t = u16 ;
11
11
pub type sighandler_t = :: size_t ;
12
12
pub type cc_t = :: c_uchar ;
13
+ pub type nfds_t = :: c_ulong ;
13
14
14
15
pub enum DIR { }
15
16
91
92
pub iov_base: * mut :: c_void,
92
93
pub iov_len: :: size_t,
93
94
}
95
+
96
+ pub struct pollfd {
97
+ pub fd: :: c_int,
98
+ pub events: :: c_short,
99
+ pub revents: :: c_short,
100
+ }
94
101
}
95
102
96
103
pub const WNOHANG : :: c_int = 1 ;
@@ -117,6 +124,13 @@ pub const S_ISUID: ::c_int = 0x800;
117
124
pub const S_ISGID : :: c_int = 0x400 ;
118
125
pub const S_ISVTX : :: c_int = 0x200 ;
119
126
127
+ pub const POLLIN : :: c_short = 0x1 ;
128
+ pub const POLLPRI : :: c_short = 0x2 ;
129
+ pub const POLLOUT : :: c_short = 0x4 ;
130
+ pub const POLLERR : :: c_short = 0x8 ;
131
+ pub const POLLHUP : :: c_short = 0x10 ;
132
+ pub const POLLNVAL : :: c_short = 0x20 ;
133
+
120
134
cfg_if ! {
121
135
if #[ cfg( feature = "default" ) ] {
122
136
// cargo build, don't pull in anything extra as the libstd dep
@@ -548,6 +562,7 @@ extern {
548
562
#[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
549
563
link_name = "recvmsg$UNIX2003" ) ]
550
564
pub fn recvmsg ( fd : :: c_int , msg : * mut msghdr , flags : :: c_int ) -> :: ssize_t ;
565
+ pub fn poll ( fds : * mut pollfd , nfds : nfds_t , timeout : :: c_int ) -> :: c_int ;
551
566
}
552
567
553
568
// TODO: get rid of this #[cfg(not(...))]
0 commit comments