1 pub type clock_t
= c_long
;
2 pub type time_t
= c_long
;
3 pub type suseconds_t
= c_long
;
6 pub type blkcnt_t
= i64;
8 pub type blksize_t
= c_long
;
9 pub type fsblkcnt_t
= ::c_ulonglong
;
10 pub type fsfilcnt_t
= ::c_ulonglong
;
11 pub type rlim_t
= ::c_ulonglong
;
15 pub aio_fildes
: ::c_int
,
16 pub aio_lio_opcode
: ::c_int
,
17 pub aio_reqprio
: ::c_int
,
18 pub aio_buf
: *mut ::c_void
,
19 pub aio_nbytes
: ::size_t
,
20 pub aio_sigevent
: ::sigevent
,
25 pub aio_offset
: off_t
,
26 __next
: *mut ::c_void
,
27 __prev
: *mut ::c_void
,
28 #[cfg(target_pointer_width = "32")]
29 __dummy4
: [::c_char
; 24],
30 #[cfg(target_pointer_width = "64")]
31 __dummy4
: [::c_char
; 16],
34 pub struct sigaction
{
35 pub sa_sigaction
: ::sighandler_t
,
36 pub sa_mask
: ::sigset_t
,
37 pub sa_flags
: ::c_int
,
38 pub sa_restorer
: ::dox
::Option
<extern fn()>,
42 pub __ipc_perm_key
: ::key_t
,
54 pub c_iflag
: ::tcflag_t
,
55 pub c_oflag
: ::tcflag_t
,
56 pub c_cflag
: ::tcflag_t
,
57 pub c_lflag
: ::tcflag_t
,
59 pub c_cc
: [::cc_t
; ::NCCS
],
60 pub __c_ispeed
: ::speed_t
,
61 pub __c_ospeed
: ::speed_t
,
65 pub l_type
: ::c_short
,
66 pub l_whence
: ::c_short
,
73 pub uptime
: ::c_ulong
,
74 pub loads
: [::c_ulong
; 3],
75 pub totalram
: ::c_ulong
,
76 pub freeram
: ::c_ulong
,
77 pub sharedram
: ::c_ulong
,
78 pub bufferram
: ::c_ulong
,
79 pub totalswap
: ::c_ulong
,
80 pub freeswap
: ::c_ulong
,
81 pub procs
: ::c_ushort
,
83 pub totalhigh
: ::c_ulong
,
84 pub freehigh
: ::c_ulong
,
85 pub mem_unit
: ::c_uint
,
86 pub __reserved
: [::c_char
; 256],
90 pub const SFD_CLOEXEC
: ::c_int
= 0x080000;
92 pub const NCCS
: usize = 32;
94 pub const O_TRUNC
: ::c_int
= 512;
95 pub const O_NOATIME
: ::c_int
= 0o1000000;
96 pub const O_CLOEXEC
: ::c_int
= 0x80000;
98 pub const EBFONT
: ::c_int
= 59;
99 pub const ENOSTR
: ::c_int
= 60;
100 pub const ENODATA
: ::c_int
= 61;
101 pub const ETIME
: ::c_int
= 62;
102 pub const ENOSR
: ::c_int
= 63;
103 pub const ENONET
: ::c_int
= 64;
104 pub const ENOPKG
: ::c_int
= 65;
105 pub const EREMOTE
: ::c_int
= 66;
106 pub const ENOLINK
: ::c_int
= 67;
107 pub const EADV
: ::c_int
= 68;
108 pub const ESRMNT
: ::c_int
= 69;
109 pub const ECOMM
: ::c_int
= 70;
110 pub const EPROTO
: ::c_int
= 71;
111 pub const EDOTDOT
: ::c_int
= 73;
113 pub const SA_NODEFER
: ::c_int
= 0x40000000;
114 pub const SA_RESETHAND
: ::c_int
= 0x80000000;
115 pub const SA_RESTART
: ::c_int
= 0x10000000;
116 pub const SA_NOCLDSTOP
: ::c_int
= 0x00000001;
118 pub const EPOLL_CLOEXEC
: ::c_int
= 0x80000;
120 pub const EFD_CLOEXEC
: ::c_int
= 0x80000;
122 pub const BUFSIZ
: ::c_uint
= 1024;
123 pub const TMP_MAX
: ::c_uint
= 10000;
124 pub const FOPEN_MAX
: ::c_uint
= 1000;
125 pub const O_PATH
: ::c_int
= 0o10000000;
126 pub const O_EXEC
: ::c_int
= 0o10000000;
127 pub const O_SEARCH
: ::c_int
= 0o10000000;
128 pub const O_ACCMODE
: ::c_int
= 0o10000003;
129 pub const O_NDELAY
: ::c_int
= O_NONBLOCK
;
130 pub const NI_MAXHOST
: ::socklen_t
= 255;
131 pub const PTHREAD_STACK_MIN
: ::size_t
= 2048;
132 pub const POSIX_FADV_DONTNEED
: ::c_int
= 4;
133 pub const POSIX_FADV_NOREUSE
: ::c_int
= 5;
135 pub const POSIX_MADV_DONTNEED
: ::c_int
= 4;
137 pub const RLIM_INFINITY
: ::rlim_t
= !0;
138 pub const RLIMIT_RTTIME
: ::c_int
= 15;
139 pub const RLIMIT_NLIMITS
: ::c_int
= 16;
141 pub const MAP_ANONYMOUS
: ::c_int
= MAP_ANON
;
143 pub const TCP_COOKIE_TRANSACTIONS
: ::c_int
= 15;
144 pub const TCP_THIN_LINEAR_TIMEOUTS
: ::c_int
= 16;
145 pub const TCP_THIN_DUPACK
: ::c_int
= 17;
146 pub const TCP_USER_TIMEOUT
: ::c_int
= 18;
147 pub const TCP_REPAIR
: ::c_int
= 19;
148 pub const TCP_REPAIR_QUEUE
: ::c_int
= 20;
149 pub const TCP_QUEUE_SEQ
: ::c_int
= 21;
150 pub const TCP_REPAIR_OPTIONS
: ::c_int
= 22;
151 pub const TCP_FASTOPEN
: ::c_int
= 23;
152 pub const TCP_TIMESTAMP
: ::c_int
= 24;
154 pub const SIGUNUSED
: ::c_int
= ::SIGSYS
;
156 pub const __SIZEOF_PTHREAD_CONDATTR_T
: usize = 4;
157 pub const __SIZEOF_PTHREAD_MUTEXATTR_T
: usize = 4;
158 pub const __SIZEOF_PTHREAD_RWLOCKATTR_T
: usize = 8;
160 pub const CPU_SETSIZE
: ::c_int
= 128;
162 pub const QFMT_VFS_V1
: ::c_int
= 4;
164 pub const PTRACE_TRACEME
: ::c_int
= 0;
165 pub const PTRACE_PEEKTEXT
: ::c_int
= 1;
166 pub const PTRACE_PEEKDATA
: ::c_int
= 2;
167 pub const PTRACE_PEEKUSER
: ::c_int
= 3;
168 pub const PTRACE_POKETEXT
: ::c_int
= 4;
169 pub const PTRACE_POKEDATA
: ::c_int
= 5;
170 pub const PTRACE_POKEUSER
: ::c_int
= 6;
171 pub const PTRACE_CONT
: ::c_int
= 7;
172 pub const PTRACE_KILL
: ::c_int
= 8;
173 pub const PTRACE_SINGLESTEP
: ::c_int
= 9;
174 pub const PTRACE_ATTACH
: ::c_int
= 16;
175 pub const PTRACE_DETACH
: ::c_int
= 17;
176 pub const PTRACE_SYSCALL
: ::c_int
= 24;
177 pub const PTRACE_SETOPTIONS
: ::c_int
= 0x4200;
178 pub const PTRACE_GETEVENTMSG
: ::c_int
= 0x4201;
179 pub const PTRACE_GETSIGINFO
: ::c_int
= 0x4202;
180 pub const PTRACE_SETSIGINFO
: ::c_int
= 0x4203;
181 pub const PTRACE_GETREGSET
: ::c_int
= 0x4204;
182 pub const PTRACE_SETREGSET
: ::c_int
= 0x4205;
183 pub const PTRACE_SEIZE
: ::c_int
= 0x4206;
184 pub const PTRACE_INTERRUPT
: ::c_int
= 0x4207;
185 pub const PTRACE_LISTEN
: ::c_int
= 0x4208;
186 pub const PTRACE_PEEKSIGINFO
: ::c_int
= 0x4209;
188 pub const PTRACE_O_EXITKILL
: ::c_int
= 1048576;
189 pub const PTRACE_O_TRACECLONE
: ::c_int
= 8;
190 pub const PTRACE_O_TRACEEXEC
: ::c_int
= 16;
191 pub const PTRACE_O_TRACEEXIT
: ::c_int
= 64;
192 pub const PTRACE_O_TRACEFORK
: ::c_int
= 2;
193 pub const PTRACE_O_TRACESYSGOOD
: ::c_int
= 1;
194 pub const PTRACE_O_TRACEVFORK
: ::c_int
= 4;
195 pub const PTRACE_O_TRACEVFORKDONE
: ::c_int
= 32;
196 pub const PTRACE_O_SUSPEND_SECCOMP
: ::c_int
= 2097152;
198 pub const MADV_DODUMP
: ::c_int
= 17;
199 pub const MADV_DONTDUMP
: ::c_int
= 16;
201 pub const EPOLLWAKEUP
: ::c_int
= 0x20000000;
203 pub const MADV_HUGEPAGE
: ::c_int
= 14;
204 pub const MADV_NOHUGEPAGE
: ::c_int
= 15;
206 pub const PTRACE_GETFPREGS
: ::c_uint
= 14;
207 pub const PTRACE_SETFPREGS
: ::c_uint
= 15;
208 pub const PTRACE_GETFPXREGS
: ::c_uint
= 18;
209 pub const PTRACE_SETFPXREGS
: ::c_uint
= 19;
210 pub const PTRACE_GETREGS
: ::c_uint
= 12;
211 pub const PTRACE_SETREGS
: ::c_uint
= 13;
213 pub const EFD_NONBLOCK
: ::c_int
= ::O_NONBLOCK
;
215 pub const SFD_NONBLOCK
: ::c_int
= ::O_NONBLOCK
;
217 pub const TCSANOW
: ::c_int
= 0;
218 pub const TCSADRAIN
: ::c_int
= 1;
219 pub const TCSAFLUSH
: ::c_int
= 2;
221 pub const TIOCINQ
: ::c_int
= ::FIONREAD
;
223 pub const RTLD_GLOBAL
: ::c_int
= 0x100;
224 pub const RTLD_NOLOAD
: ::c_int
= 0x4;
226 // TODO(#247) Temporarily musl-specific (available since musl 0.9.12 / Linux
227 // kernel 3.10). See also notbsd/mod.rs
228 pub const CLOCK_SGI_CYCLE
: ::clockid_t
= 10;
229 pub const CLOCK_TAI
: ::clockid_t
= 11;
231 pub const MCL_CURRENT
: ::c_int
= 0x0001;
232 pub const MCL_FUTURE
: ::c_int
= 0x0002;
234 pub const SIGSTKSZ
: ::size_t
= 8192;
235 pub const MINSIGSTKSZ
: ::size_t
= 2048;
236 pub const CBAUD
: ::tcflag_t
= 0o0010017;
237 pub const TAB1
: ::c_int
= 0x00000800;
238 pub const TAB2
: ::c_int
= 0x00001000;
239 pub const TAB3
: ::c_int
= 0x00001800;
240 pub const CR1
: ::c_int
= 0x00000200;
241 pub const CR2
: ::c_int
= 0x00000400;
242 pub const CR3
: ::c_int
= 0x00000600;
243 pub const FF1
: ::c_int
= 0x00008000;
244 pub const BS1
: ::c_int
= 0x00002000;
245 pub const VT1
: ::c_int
= 0x00004000;
246 pub const VWERASE
: usize = 14;
247 pub const VREPRINT
: usize = 12;
248 pub const VSUSP
: usize = 10;
249 pub const VSTART
: usize = 8;
250 pub const VSTOP
: usize = 9;
251 pub const VDISCARD
: usize = 13;
252 pub const VTIME
: usize = 5;
253 pub const IXON
: ::tcflag_t
= 0x00000400;
254 pub const IXOFF
: ::tcflag_t
= 0x00001000;
255 pub const ONLCR
: ::tcflag_t
= 0x4;
256 pub const CSIZE
: ::tcflag_t
= 0x00000030;
257 pub const CS6
: ::tcflag_t
= 0x00000010;
258 pub const CS7
: ::tcflag_t
= 0x00000020;
259 pub const CS8
: ::tcflag_t
= 0x00000030;
260 pub const CSTOPB
: ::tcflag_t
= 0x00000040;
261 pub const CREAD
: ::tcflag_t
= 0x00000080;
262 pub const PARENB
: ::tcflag_t
= 0x00000100;
263 pub const PARODD
: ::tcflag_t
= 0x00000200;
264 pub const HUPCL
: ::tcflag_t
= 0x00000400;
265 pub const CLOCAL
: ::tcflag_t
= 0x00000800;
266 pub const ECHOKE
: ::tcflag_t
= 0x00000800;
267 pub const ECHOE
: ::tcflag_t
= 0x00000010;
268 pub const ECHOK
: ::tcflag_t
= 0x00000020;
269 pub const ECHONL
: ::tcflag_t
= 0x00000040;
270 pub const ECHOPRT
: ::tcflag_t
= 0x00000400;
271 pub const ECHOCTL
: ::tcflag_t
= 0x00000200;
272 pub const ISIG
: ::tcflag_t
= 0x00000001;
273 pub const ICANON
: ::tcflag_t
= 0x00000002;
274 pub const PENDIN
: ::tcflag_t
= 0x00004000;
275 pub const NOFLSH
: ::tcflag_t
= 0x00000080;
276 pub const CIBAUD
: ::tcflag_t
= 0o02003600000;
277 pub const CBAUDEX
: ::tcflag_t
= 0o010000;
278 pub const VSWTC
: usize = 7;
279 pub const OLCUC
: ::tcflag_t
= 0o000002;
280 pub const NLDLY
: ::tcflag_t
= 0o000400;
281 pub const CRDLY
: ::tcflag_t
= 0o003000;
282 pub const TABDLY
: ::tcflag_t
= 0o014000;
283 pub const BSDLY
: ::tcflag_t
= 0o020000;
284 pub const FFDLY
: ::tcflag_t
= 0o100000;
285 pub const VTDLY
: ::tcflag_t
= 0o040000;
286 pub const XTABS
: ::tcflag_t
= 0o014000;
288 pub const B0
: ::speed_t
= 0o000000;
289 pub const B50
: ::speed_t
= 0o000001;
290 pub const B75
: ::speed_t
= 0o000002;
291 pub const B110
: ::speed_t
= 0o000003;
292 pub const B134
: ::speed_t
= 0o000004;
293 pub const B150
: ::speed_t
= 0o000005;
294 pub const B200
: ::speed_t
= 0o000006;
295 pub const B300
: ::speed_t
= 0o000007;
296 pub const B600
: ::speed_t
= 0o000010;
297 pub const B1200
: ::speed_t
= 0o000011;
298 pub const B1800
: ::speed_t
= 0o000012;
299 pub const B2400
: ::speed_t
= 0o000013;
300 pub const B4800
: ::speed_t
= 0o000014;
301 pub const B9600
: ::speed_t
= 0o000015;
302 pub const B19200
: ::speed_t
= 0o000016;
303 pub const B38400
: ::speed_t
= 0o000017;
304 pub const EXTA
: ::speed_t
= B19200
;
305 pub const EXTB
: ::speed_t
= B38400
;
306 pub const B57600
: ::speed_t
= 0o010001;
307 pub const B115200
: ::speed_t
= 0o010002;
308 pub const B230400
: ::speed_t
= 0o010003;
309 pub const B460800
: ::speed_t
= 0o010004;
310 pub const B500000
: ::speed_t
= 0o010005;
311 pub const B576000
: ::speed_t
= 0o010006;
312 pub const B921600
: ::speed_t
= 0o010007;
313 pub const B1000000
: ::speed_t
= 0o010010;
314 pub const B1152000
: ::speed_t
= 0o010011;
315 pub const B1500000
: ::speed_t
= 0o010012;
316 pub const B2000000
: ::speed_t
= 0o010013;
317 pub const B2500000
: ::speed_t
= 0o010014;
318 pub const B3000000
: ::speed_t
= 0o010015;
319 pub const B3500000
: ::speed_t
= 0o010016;
320 pub const B4000000
: ::speed_t
= 0o010017;
322 pub const SO_BINDTODEVICE
: ::c_int
= 25;
323 pub const SO_TIMESTAMP
: ::c_int
= 29;
324 pub const SO_MARK
: ::c_int
= 36;
325 pub const SO_RXQ_OVFL
: ::c_int
= 40;
326 pub const SO_PEEK_OFF
: ::c_int
= 42;
327 pub const SO_BUSY_POLL
: ::c_int
= 46;
330 pub fn ioctl(fd
: ::c_int
, request
: ::c_int
, ...) -> ::c_int
;
331 pub fn ptrace(request
: ::c_int
, ...) -> ::c_long
;
332 pub fn getpriority(which
: ::c_int
, who
: ::id_t
) -> ::c_int
;
333 pub fn setpriority(which
: ::c_int
, who
: ::id_t
, prio
: ::c_int
) -> ::c_int
;
337 if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] {
339 pub use self::b64
::*;
340 } else if #[cfg(any(target_arch = "x86",
341 target_arch
= "mips",
343 target_arch
= "asmjs",
344 target_arch
= "wasm32"))] {
346 pub use self::b32
::*;