Skip to content

Commit 04989f4

Browse files
authored
Solaris: Add support for ports
1 parent 9e9a325 commit 04989f4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/unix/solaris/mod.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,14 @@ s! {
340340
pub if_index: ::c_uint,
341341
pub if_name: *mut ::c_char,
342342
}
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+
}
343351
}
344352

345353
pub const LC_CTYPE: ::c_int = 0;
@@ -1004,6 +1012,16 @@ pub const RTLD_NODELETE: ::c_int = 0x1000;
10041012
pub const RTLD_FIRST: ::c_int = 0x2000;
10051013
pub const RTLD_CONFGEN: ::c_int = 0x10000;
10061014

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+
10071025
f! {
10081026
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
10091027
let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8;
@@ -1162,4 +1180,15 @@ extern {
11621180
flags: ::c_int) -> ::ssize_t;
11631181
pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
11641182
-> ::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;
11651194
}

0 commit comments

Comments
 (0)