@@ -353,6 +353,11 @@ s! {
353
353
pub portev_object: :: uintptr_t,
354
354
pub portev_user: * mut :: c_void,
355
355
}
356
+
357
+ pub struct epoll_event {
358
+ pub events: :: uint32_t,
359
+ pub u64 : :: uint64_t,
360
+ }
356
361
}
357
362
358
363
pub const LC_CTYPE : :: c_int = 0 ;
@@ -1127,6 +1132,9 @@ pub const NCCS: usize = 19;
1127
1132
1128
1133
pub const LOG_CRON : :: c_int = 15 << 3 ;
1129
1134
1135
+ pub const SYS_epoll_create : :: c_long = 213 ;
1136
+ pub const SYS_epoll_create1 : :: c_long = 291 ;
1137
+
1130
1138
pub const PTHREAD_MUTEX_INITIALIZER : pthread_mutex_t = pthread_mutex_t {
1131
1139
__pthread_mutex_flag1 : 0 ,
1132
1140
__pthread_mutex_flag2 : 0 ,
@@ -1182,6 +1190,25 @@ pub const PORT_SOURCE_FILE: ::c_int = 7;
1182
1190
pub const PORT_SOURCE_POSTWAIT : :: c_int = 8 ;
1183
1191
pub const PORT_SOURCE_SIGNAL : :: c_int = 9 ;
1184
1192
1193
+ pub const EPOLLIN : :: c_int = 0x1 ;
1194
+ pub const EPOLLPRI : :: c_int = 0x2 ;
1195
+ pub const EPOLLOUT : :: c_int = 0x4 ;
1196
+ pub const EPOLLRDNORM : :: c_int = 0x40 ;
1197
+ pub const EPOLLRDBAND : :: c_int = 0x80 ;
1198
+ pub const EPOLLWRNORM : :: c_int = 0x100 ;
1199
+ pub const EPOLLWRBAND : :: c_int = 0x200 ;
1200
+ pub const EPOLLMSG : :: c_int = 0x400 ;
1201
+ pub const EPOLLERR : :: c_int = 0x8 ;
1202
+ pub const EPOLLHUP : :: c_int = 0x10 ;
1203
+ pub const EPOLLET : :: c_int = 0x80000000 ;
1204
+ pub const EPOLLRDHUP : :: c_int = 0x2000 ;
1205
+ pub const EPOLLEXCLUSIVE : :: c_int = 0x10000000 ;
1206
+ pub const EPOLLONESHOT : :: c_int = 0x40000000 ;
1207
+ pub const EPOLL_CLOEXEC : :: c_int = 0x02000000 ;
1208
+ pub const EPOLL_CTL_ADD : :: c_int = 1 ;
1209
+ pub const EPOLL_CTL_MOD : :: c_int = 3 ;
1210
+ pub const EPOLL_CTL_DEL : :: c_int = 2 ;
1211
+
1185
1212
f ! {
1186
1213
pub fn FD_CLR ( fd: :: c_int, set: * mut fd_set) -> ( ) {
1187
1214
let bits = mem:: size_of_val( & ( * set) . fds_bits[ 0 ] ) * 8 ;
@@ -1361,6 +1388,23 @@ extern {
1361
1388
oss : * mut stack_t ) -> :: c_int ;
1362
1389
pub fn sem_close ( sem : * mut sem_t ) -> :: c_int ;
1363
1390
pub fn getdtablesize ( ) -> :: c_int ;
1391
+
1392
+ pub fn epoll_pwait ( epfd : :: c_int ,
1393
+ events : * mut :: epoll_event ,
1394
+ maxevents : :: c_int ,
1395
+ timeout : :: c_int ,
1396
+ sigmask : * const :: sigset_t ) -> :: c_int ;
1397
+ pub fn epoll_create ( size : :: c_int ) -> :: c_int ;
1398
+ pub fn epoll_create1 ( flags : :: c_int ) -> :: c_int ;
1399
+ pub fn epoll_wait ( epfd : :: c_int ,
1400
+ events : * mut :: epoll_event ,
1401
+ maxevents : :: c_int ,
1402
+ timeout : :: c_int ) -> :: c_int ;
1403
+ pub fn epoll_ctl ( epfd : :: c_int ,
1404
+ op : :: c_int ,
1405
+ fd : :: c_int ,
1406
+ event : * mut :: epoll_event ) -> :: c_int ;
1407
+
1364
1408
#[ cfg_attr( target_os = "solaris" , link_name = "__posix_getgrnam_r" ) ]
1365
1409
pub fn getgrnam_r ( name : * const :: c_char ,
1366
1410
grp : * mut :: group ,
0 commit comments