1 pub type clock_t = ::c_long; 2 3 pub type c_char = i8; 4 pub type wchar_t = u32; 5 6 pub type c_long = i32; 7 pub type c_ulong = u32; 8 9 pub type sigset_t = ::c_ulong; 10 11 s! { 12 pub struct msghdr { 13 pub msg_name: *mut ::c_void, 14 pub msg_namelen: ::socklen_t, 15 pub msg_iov: *mut ::iovec, 16 pub msg_iovlen: ::c_int, 17 pub msg_control: *mut ::c_void, 18 pub msg_controllen: ::socklen_t, 19 pub msg_flags: ::c_int, 20 } 21 22 pub struct sockaddr { 23 pub sa_len: u8, 24 pub sa_family: ::sa_family_t, 25 pub sa_data: [::c_char; 14], 26 } 27 28 pub struct sockaddr_in6 { 29 pub sin6_len: u8, 30 pub sin6_family: ::sa_family_t, 31 pub sin6_port: ::in_port_t, 32 pub sin6_flowinfo: u32, 33 pub sin6_addr: ::in6_addr, 34 pub sin6_vport: ::in_port_t, 35 pub sin6_scope_id: u32, 36 } 37 38 pub struct sockaddr_in { 39 pub sin_len: u8, 40 pub sin_family: ::sa_family_t, 41 pub sin_port: ::in_port_t, 42 pub sin_addr: ::in_addr, 43 pub sin_vport: ::in_port_t, 44 pub sin_zero: [u8; 6], 45 } 46 47 pub struct sockaddr_un { 48 pub ss_len: u8, 49 pub sun_family: ::sa_family_t, 50 pub sun_path: [::c_char; 108usize], 51 } 52 53 pub struct sockaddr_storage { 54 pub ss_len: u8, 55 pub ss_family: ::sa_family_t, 56 pub __ss_pad1: [u8; 2], 57 pub __ss_align: i64, 58 pub __ss_pad2: [u8; 116], 59 } 60 61 pub struct sched_param { 62 pub sched_priority: ::c_int, 63 } 64 65 pub struct stat { 66 pub st_dev: ::dev_t, 67 pub st_ino: ::ino_t, 68 pub st_mode: ::mode_t, 69 pub st_nlink: ::nlink_t, 70 pub st_uid: ::uid_t, 71 pub st_gid: ::gid_t, 72 pub st_rdev: ::dev_t, 73 pub st_size: ::off_t, 74 pub st_atime: ::time_t, 75 pub st_mtime: ::time_t, 76 pub st_ctime: ::time_t, 77 pub st_blksize: ::blksize_t, 78 pub st_blocks: ::blkcnt_t, 79 pub st_spare4: [::c_long; 2usize], 80 } 81 82 #[repr(align(8))] 83 pub struct dirent { 84 __offset: [u8; 88], 85 pub d_name: [::c_char; 256usize], 86 __pad: [u8; 8], 87 } 88 } 89 90 pub const AF_UNIX: ::c_int = 1; 91 pub const AF_INET6: ::c_int = 24; 92 93 pub const SOCK_RAW: ::c_int = 3; 94 pub const SOCK_RDM: ::c_int = 4; 95 pub const SOCK_SEQPACKET: ::c_int = 5; 96 97 pub const SOMAXCONN: ::c_int = 128; 98 99 pub const FIONBIO: ::c_ulong = 1; 100 101 pub const POLLIN: ::c_short = 0x0001; 102 pub const POLLPRI: ::c_short = POLLIN; 103 pub const POLLOUT: ::c_short = 0x0004; 104 pub const POLLRDNORM: ::c_short = POLLIN; 105 pub const POLLRDBAND: ::c_short = POLLIN; 106 pub const POLLWRNORM: ::c_short = POLLOUT; 107 pub const POLLWRBAND: ::c_short = POLLOUT; 108 pub const POLLERR: ::c_short = 0x0008; 109 pub const POLLHUP: ::c_short = 0x0010; 110 pub const POLLNVAL: ::c_short = 0x0020; 111 112 pub const RTLD_DEFAULT: *mut ::c_void = 0 as *mut ::c_void; 113 114 pub const SOL_SOCKET: ::c_int = 0xffff; 115 pub const SO_NONBLOCK: ::c_int = 0x1100; 116 117 pub const MSG_OOB: ::c_int = 0x1; 118 pub const MSG_PEEK: ::c_int = 0x2; 119 pub const MSG_DONTROUTE: ::c_int = 0x4; 120 pub const MSG_EOR: ::c_int = 0x8; 121 pub const MSG_TRUNC: ::c_int = 0x10; 122 pub const MSG_CTRUNC: ::c_int = 0x20; 123 pub const MSG_WAITALL: ::c_int = 0x40; 124 pub const MSG_DONTWAIT: ::c_int = 0x80; 125 pub const MSG_BCAST: ::c_int = 0x100; 126 pub const MSG_MCAST: ::c_int = 0x200; 127 128 pub const UTIME_OMIT: c_long = -1; 129 pub const AT_FDCWD: ::c_int = -2; 130 131 pub const O_DIRECTORY: ::c_int = 0x200000; 132 pub const O_NOFOLLOW: ::c_int = 0x100000; 133 134 pub const AT_EACCESS: ::c_int = 1; 135 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 2; 136 pub const AT_SYMLINK_FOLLOW: ::c_int = 4; 137 pub const AT_REMOVEDIR: ::c_int = 8; 138 139 pub const SIGHUP: ::c_int = 1; 140 pub const SIGINT: ::c_int = 2; 141 pub const SIGQUIT: ::c_int = 3; 142 pub const SIGILL: ::c_int = 4; 143 pub const SIGTRAP: ::c_int = 5; 144 pub const SIGABRT: ::c_int = 6; 145 pub const SIGEMT: ::c_int = 7; 146 pub const SIGFPE: ::c_int = 8; 147 pub const SIGKILL: ::c_int = 9; 148 pub const SIGBUS: ::c_int = 10; 149 pub const SIGSEGV: ::c_int = 11; 150 pub const SIGSYS: ::c_int = 12; 151 pub const SIGPIPE: ::c_int = 13; 152 pub const SIGALRM: ::c_int = 14; 153 pub const SIGTERM: ::c_int = 15; 154 155 pub const EAI_BADFLAGS: ::c_int = -1; 156 pub const EAI_NONAME: ::c_int = -2; 157 pub const EAI_AGAIN: ::c_int = -3; 158 pub const EAI_FAIL: ::c_int = -4; 159 pub const EAI_NODATA: ::c_int = -5; 160 pub const EAI_FAMILY: ::c_int = -6; 161 pub const EAI_SOCKTYPE: ::c_int = -7; 162 pub const EAI_SERVICE: ::c_int = -8; 163 pub const EAI_ADDRFAMILY: ::c_int = -9; 164 pub const EAI_MEMORY: ::c_int = -10; 165 pub const EAI_SYSTEM: ::c_int = -11; 166 pub const EAI_OVERFLOW: ::c_int = -12; 167 168 pub const _SC_PAGESIZE: ::c_int = 8; 169 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 51; 170 pub const PTHREAD_STACK_MIN: ::size_t = 32 * 1024; 171 172 pub const IP_HDRINCL: ::c_int = 2; 173 174 extern "C" { futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int175 pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t176 pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t177 pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; 178 sendmsg(s: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t179 pub fn sendmsg(s: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t; recvmsg(s: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t180 pub fn recvmsg(s: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; 181 pthread_create( native: *mut ::pthread_t, attr: *const ::pthread_attr_t, f: extern "C" fn(_: *mut ::c_void) -> *mut ::c_void, value: *mut ::c_void, ) -> ::c_int182 pub fn pthread_create( 183 native: *mut ::pthread_t, 184 attr: *const ::pthread_attr_t, 185 f: extern "C" fn(_: *mut ::c_void) -> *mut ::c_void, 186 value: *mut ::c_void, 187 ) -> ::c_int; 188 pthread_attr_getschedparam( attr: *const ::pthread_attr_t, param: *mut sched_param, ) -> ::c_int189 pub fn pthread_attr_getschedparam( 190 attr: *const ::pthread_attr_t, 191 param: *mut sched_param, 192 ) -> ::c_int; 193 pthread_attr_setschedparam( attr: *mut ::pthread_attr_t, param: *const sched_param, ) -> ::c_int194 pub fn pthread_attr_setschedparam( 195 attr: *mut ::pthread_attr_t, 196 param: *const sched_param, 197 ) -> ::c_int; 198 pthread_attr_getprocessorid_np( attr: *const ::pthread_attr_t, processor_id: *mut ::c_int, ) -> ::c_int199 pub fn pthread_attr_getprocessorid_np( 200 attr: *const ::pthread_attr_t, 201 processor_id: *mut ::c_int, 202 ) -> ::c_int; 203 pthread_attr_setprocessorid_np( attr: *mut ::pthread_attr_t, processor_id: ::c_int, ) -> ::c_int204 pub fn pthread_attr_setprocessorid_np( 205 attr: *mut ::pthread_attr_t, 206 processor_id: ::c_int, 207 ) -> ::c_int; 208 pthread_getschedparam( native: ::pthread_t, policy: *mut ::c_int, param: *mut ::sched_param, ) -> ::c_int209 pub fn pthread_getschedparam( 210 native: ::pthread_t, 211 policy: *mut ::c_int, 212 param: *mut ::sched_param, 213 ) -> ::c_int; 214 pthread_setschedparam( native: ::pthread_t, policy: ::c_int, param: *const ::sched_param, ) -> ::c_int215 pub fn pthread_setschedparam( 216 native: ::pthread_t, 217 policy: ::c_int, 218 param: *const ::sched_param, 219 ) -> ::c_int; 220 pthread_condattr_getclock( attr: *const ::pthread_condattr_t, clock_id: *mut ::clockid_t, ) -> ::c_int221 pub fn pthread_condattr_getclock( 222 attr: *const ::pthread_condattr_t, 223 clock_id: *mut ::clockid_t, 224 ) -> ::c_int; 225 pthread_condattr_setclock( attr: *mut ::pthread_condattr_t, clock_id: ::clockid_t, ) -> ::c_int226 pub fn pthread_condattr_setclock( 227 attr: *mut ::pthread_condattr_t, 228 clock_id: ::clockid_t, 229 ) -> ::c_int; 230 pthread_getprocessorid_np() -> ::c_int231 pub fn pthread_getprocessorid_np() -> ::c_int; 232 getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int233 pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; 234 pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int235 pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; 236 } 237