| 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 FIONBIO: ::c_ulong = 1; |
| 98 |
|
| 99 |
pub const POLLIN: ::c_short = 0x0001; |
| 100 |
pub const POLLPRI: ::c_short = POLLIN; |
| 101 |
pub const POLLOUT: ::c_short = 0x0004; |
| 102 |
pub const POLLRDNORM: ::c_short = POLLIN; |
| 103 |
pub const POLLRDBAND: ::c_short = POLLIN; |
| 104 |
pub const POLLWRNORM: ::c_short = POLLOUT; |
| 105 |
pub const POLLWRBAND: ::c_short = POLLOUT; |
| 106 |
pub const POLLERR: ::c_short = 0x0008; |
| 107 |
pub const POLLHUP: ::c_short = 0x0010; |
| 108 |
pub const POLLNVAL: ::c_short = 0x0020; |
| 109 |
|
| 110 |
pub const RTLD_DEFAULT: *mut ::c_void = 0 as *mut ::c_void; |
| 111 |
|
| 112 |
pub const SOL_SOCKET: ::c_int = 0xffff; |
| 113 |
pub const SO_NONBLOCK: ::c_int = 0x1100; |
| 114 |
|
| 115 |
pub const MSG_OOB: ::c_int = 0x1; |
| 116 |
pub const MSG_PEEK: ::c_int = 0x2; |
| 117 |
pub const MSG_DONTROUTE: ::c_int = 0x4; |
| 118 |
pub const MSG_EOR: ::c_int = 0x8; |
| 119 |
pub const MSG_TRUNC: ::c_int = 0x10; |
| 120 |
pub const MSG_CTRUNC: ::c_int = 0x20; |
| 121 |
pub const MSG_WAITALL: ::c_int = 0x40; |
| 122 |
pub const MSG_DONTWAIT: ::c_int = 0x80; |
| 123 |
pub const MSG_BCAST: ::c_int = 0x100; |
| 124 |
pub const MSG_MCAST: ::c_int = 0x200; |
| 125 |
|
| 126 |
pub const UTIME_OMIT: c_long = -1; |
| 127 |
pub const AT_FDCWD: ::c_int = -2; |
| 128 |
|
| 129 |
pub const O_DIRECTORY: ::c_int = 0x200000; |
| 130 |
pub const O_NOFOLLOW: ::c_int = 0x100000; |
| 131 |
|
| 132 |
pub const AT_EACCESS: ::c_int = 1; |
| 133 |
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 2; |
| 134 |
pub const AT_SYMLINK_FOLLOW: ::c_int = 4; |
| 135 |
pub const AT_REMOVEDIR: ::c_int = 8; |
| 136 |
|
| 137 |
pub const SIGHUP: ::c_int = 1; |
| 138 |
pub const SIGINT: ::c_int = 2; |
| 139 |
pub const SIGQUIT: ::c_int = 3; |
| 140 |
pub const SIGILL: ::c_int = 4; |
| 141 |
pub const SIGTRAP: ::c_int = 5; |
| 142 |
pub const SIGABRT: ::c_int = 6; |
| 143 |
pub const SIGEMT: ::c_int = 7; |
| 144 |
pub const SIGFPE: ::c_int = 8; |
| 145 |
pub const SIGKILL: ::c_int = 9; |
| 146 |
pub const SIGBUS: ::c_int = 10; |
| 147 |
pub const SIGSEGV: ::c_int = 11; |
| 148 |
pub const SIGSYS: ::c_int = 12; |
| 149 |
pub const SIGPIPE: ::c_int = 13; |
| 150 |
pub const SIGALRM: ::c_int = 14; |
| 151 |
pub const SIGTERM: ::c_int = 15; |
| 152 |
|
| 153 |
pub const EAI_BADFLAGS: ::c_int = -1; |
| 154 |
pub const EAI_NONAME: ::c_int = -2; |
| 155 |
pub const EAI_AGAIN: ::c_int = -3; |
| 156 |
pub const EAI_FAIL: ::c_int = -4; |
| 157 |
pub const EAI_NODATA: ::c_int = -5; |
| 158 |
pub const EAI_FAMILY: ::c_int = -6; |
| 159 |
pub const EAI_SOCKTYPE: ::c_int = -7; |
| 160 |
pub const EAI_SERVICE: ::c_int = -8; |
| 161 |
pub const EAI_ADDRFAMILY: ::c_int = -9; |
| 162 |
pub const EAI_MEMORY: ::c_int = -10; |
| 163 |
pub const EAI_SYSTEM: ::c_int = -11; |
| 164 |
pub const EAI_OVERFLOW: ::c_int = -12; |
| 165 |
|
| 166 |
pub const _SC_PAGESIZE: ::c_int = 8; |
| 167 |
pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 51; |
| 168 |
pub const PTHREAD_STACK_MIN: ::size_t = 32 * 1024; |
| 169 |
|
| 170 |
pub const IP_HDRINCL: ::c_int = 2; |
| 171 |
|
| 172 |
extern "C" { |
| 173 |
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; |
| 174 |
pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; |
| 175 |
pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; |
| 176 |
|
| 177 |
pub fn sendmsg(s: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t; |
| 178 |
pub fn recvmsg(s: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; |
| 179 |
|
| 180 |
pub fn pthread_create( |
| 181 |
native: *mut ::pthread_t, |
| 182 |
attr: *const ::pthread_attr_t, |
| 183 |
f: extern "C" fn(_: *mut ::c_void) -> *mut ::c_void, |
| 184 |
value: *mut ::c_void, |
| 185 |
) -> ::c_int; |
| 186 |
|
| 187 |
pub fn pthread_attr_getschedparam( |
| 188 |
attr: *const ::pthread_attr_t, |
| 189 |
param: *mut sched_param, |
| 190 |
) -> ::c_int; |
| 191 |
|
| 192 |
pub fn pthread_attr_setschedparam( |
| 193 |
attr: *mut ::pthread_attr_t, |
| 194 |
param: *const sched_param, |
| 195 |
) -> ::c_int; |
| 196 |
|
| 197 |
pub fn pthread_attr_getprocessorid_np( |
| 198 |
attr: *const ::pthread_attr_t, |
| 199 |
processor_id: *mut ::c_int, |
| 200 |
) -> ::c_int; |
| 201 |
|
| 202 |
pub fn pthread_attr_setprocessorid_np( |
| 203 |
attr: *mut ::pthread_attr_t, |
| 204 |
processor_id: ::c_int, |
| 205 |
) -> ::c_int; |
| 206 |
|
| 207 |
pub fn pthread_getschedparam( |
| 208 |
native: ::pthread_t, |
| 209 |
policy: *mut ::c_int, |
| 210 |
param: *mut ::sched_param, |
| 211 |
) -> ::c_int; |
| 212 |
|
| 213 |
pub fn pthread_setschedparam( |
| 214 |
native: ::pthread_t, |
| 215 |
policy: ::c_int, |
| 216 |
param: *const ::sched_param, |
| 217 |
) -> ::c_int; |
| 218 |
|
| 219 |
pub fn pthread_condattr_getclock( |
| 220 |
attr: *const ::pthread_condattr_t, |
| 221 |
clock_id: *mut ::clockid_t, |
| 222 |
) -> ::c_int; |
| 223 |
|
| 224 |
pub fn pthread_condattr_setclock( |
| 225 |
attr: *mut ::pthread_condattr_t, |
| 226 |
clock_id: ::clockid_t, |
| 227 |
) -> ::c_int; |
| 228 |
|
| 229 |
pub fn pthread_getprocessorid_np() -> ::c_int; |
| 230 |
|
| 231 |
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; |
| 232 |
|
| 233 |
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; |
| 234 |
} |