@@ -340,6 +340,14 @@ s! {
340
340
pub if_index: :: c_uint,
341
341
pub if_name: * mut :: c_char,
342
342
}
343
+
344
+ pub struct port_event {
345
+ pub portev_events: :: c_int,
346
+ pub portev_source: :: c_ushort,
347
+ pub portev_pad: :: c_ushort,
348
+ pub portev_object: :: uintptr_t,
349
+ pub portev_user: :: uintptr_t,
350
+ }
343
351
}
344
352
345
353
pub const LC_CTYPE : :: c_int = 0 ;
@@ -1004,6 +1012,16 @@ pub const RTLD_NODELETE: ::c_int = 0x1000;
1004
1012
pub const RTLD_FIRST : :: c_int = 0x2000 ;
1005
1013
pub const RTLD_CONFGEN : :: c_int = 0x10000 ;
1006
1014
1015
+ pub const PORT_SOURCE_AIO : :: c_int = 1 ;
1016
+ pub const PORT_SOURCE_TIMER : :: c_int = 2 ;
1017
+ pub const PORT_SOURCE_USER : :: c_int = 3 ;
1018
+ pub const PORT_SOURCE_FD : :: c_int = 4 ;
1019
+ pub const PORT_SOURCE_ALERT : :: c_int = 5 ;
1020
+ pub const PORT_SOURCE_MQ : :: c_int = 6 ;
1021
+ pub const PORT_SOURCE_FILE : :: c_int = 7 ;
1022
+ pub const PORT_SOURCE_POSTWAIT : :: c_int = 8 ;
1023
+ pub const PORT_SOURCE_SIGNAL : :: c_int = 9 ;
1024
+
1007
1025
f ! {
1008
1026
pub fn FD_CLR ( fd: :: c_int, set: * mut fd_set) -> ( ) {
1009
1027
let bits = mem:: size_of_val( & ( * set) . fds_bits[ 0 ] ) * 8 ;
@@ -1162,4 +1180,15 @@ extern {
1162
1180
flags : :: c_int ) -> :: ssize_t ;
1163
1181
pub fn recvmsg ( fd : :: c_int , msg : * mut :: msghdr , flags : :: c_int )
1164
1182
-> :: ssize_t ;
1183
+
1184
+ pub fn port_create ( ) -> :: c_int ;
1185
+ pub fn port_associate ( port : :: c_int , source : :: c_int , object : :: uintptr_t ,
1186
+ events : :: c_int , user : :: uintptr_t ) -> :: c_int ;
1187
+ pub fn port_dissociate ( port : :: c_int , source : :: c_int , object : :: uintptr_t )
1188
+ -> :: c_int ;
1189
+ pub fn port_get ( port : :: c_int , pe : * mut port_event ,
1190
+ timeout : * const :: timespec ) -> :: c_int ;
1191
+ pub fn port_getn ( port : :: c_int , pe_list : * mut port_event , max : :: c_uint ,
1192
+ nget : * mut :: c_uint , timeout : * const :: timespec )
1193
+ -> :: c_int ;
1165
1194
}
0 commit comments