1 pub type clock_t = ::c_long; 2 pub type c_char = u8; 3 pub type wchar_t = u32; 4 5 pub type c_long = i32; 6 pub type c_ulong = u32; 7 8 s! { 9 pub struct sockaddr { 10 pub sa_family: ::sa_family_t, 11 pub sa_data: [::c_char; 14], 12 } 13 14 pub struct sockaddr_in6 { 15 pub sin6_family: ::sa_family_t, 16 pub sin6_port: ::in_port_t, 17 pub sin6_flowinfo: u32, 18 pub sin6_addr: ::in6_addr, 19 pub sin6_scope_id: u32, 20 } 21 22 pub struct sockaddr_in { 23 pub sin_family: ::sa_family_t, 24 pub sin_port: ::in_port_t, 25 pub sin_addr: ::in_addr, 26 pub sin_zero: [u8; 8], 27 } 28 29 pub struct sockaddr_storage { 30 pub ss_family: ::sa_family_t, 31 pub __ss_padding: [u8; 26], 32 } 33 } 34 35 pub const AF_INET6: ::c_int = 23; 36 37 pub const FIONBIO: ::c_ulong = 1; 38 39 pub const POLLIN: ::c_short = 0x1; 40 pub const POLLPRI: ::c_short = 0x2; 41 pub const POLLHUP: ::c_short = 0x4; 42 pub const POLLERR: ::c_short = 0x8; 43 pub const POLLOUT: ::c_short = 0x10; 44 pub const POLLNVAL: ::c_short = 0x20; 45 46 pub const SOL_SOCKET: ::c_int = 65535; 47 48 pub const MSG_OOB: ::c_int = 1; 49 pub const MSG_PEEK: ::c_int = 2; 50 pub const MSG_DONTWAIT: ::c_int = 4; 51 pub const MSG_DONTROUTE: ::c_int = 0; 52 pub const MSG_WAITALL: ::c_int = 0; 53 pub const MSG_MORE: ::c_int = 0; 54 pub const MSG_NOSIGNAL: ::c_int = 0; 55 56 pub use crate::unix::newlib::generic::{sigset_t, stat}; 57