]>
Commit | Line | Data |
---|---|---|
7453a54e SL |
1 | pub type clock_t = c_long; |
2 | pub type time_t = c_long; | |
3 | pub type suseconds_t = c_long; | |
4 | pub type ino_t = u64; | |
5 | pub type off_t = i64; | |
6 | pub type blkcnt_t = i64; | |
7 | ||
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; | |
12 | ||
13 | s! { | |
476ff2be SL |
14 | pub struct aiocb { |
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, | |
21 | __td: *mut ::c_void, | |
22 | __lock: [::c_int; 2], | |
23 | __err: ::c_int, | |
24 | __ret: ::ssize_t, | |
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], | |
32 | } | |
33 | ||
7453a54e SL |
34 | pub struct sigaction { |
35 | pub sa_sigaction: ::sighandler_t, | |
36 | pub sa_mask: ::sigset_t, | |
37 | pub sa_flags: ::c_int, | |
7cac9316 | 38 | pub sa_restorer: ::dox::Option<extern fn()>, |
7453a54e SL |
39 | } |
40 | ||
7453a54e SL |
41 | pub struct ipc_perm { |
42 | pub __ipc_perm_key: ::key_t, | |
43 | pub uid: ::uid_t, | |
44 | pub gid: ::gid_t, | |
45 | pub cuid: ::uid_t, | |
46 | pub cgid: ::gid_t, | |
47 | pub mode: ::mode_t, | |
48 | pub __seq: ::c_int, | |
49 | __unused1: ::c_long, | |
50 | __unused2: ::c_long | |
51 | } | |
52 | ||
53 | pub struct termios { | |
54 | pub c_iflag: ::tcflag_t, | |
55 | pub c_oflag: ::tcflag_t, | |
56 | pub c_cflag: ::tcflag_t, | |
57 | pub c_lflag: ::tcflag_t, | |
58 | pub c_line: ::cc_t, | |
59 | pub c_cc: [::cc_t; ::NCCS], | |
60 | pub __c_ispeed: ::speed_t, | |
61 | pub __c_ospeed: ::speed_t, | |
62 | } | |
63 | ||
64 | pub struct flock { | |
65 | pub l_type: ::c_short, | |
66 | pub l_whence: ::c_short, | |
67 | pub l_start: ::off_t, | |
68 | pub l_len: ::off_t, | |
69 | pub l_pid: ::pid_t, | |
70 | } | |
3157f602 XL |
71 | |
72 | pub struct sysinfo { | |
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, | |
82 | pub pad: ::c_ushort, | |
83 | pub totalhigh: ::c_ulong, | |
84 | pub freehigh: ::c_ulong, | |
85 | pub mem_unit: ::c_uint, | |
86 | pub __reserved: [::c_char; 256], | |
87 | } | |
7453a54e SL |
88 | } |
89 | ||
32a655c1 SL |
90 | pub const CLONE_NEWCGROUP: ::c_int = 0x02000000; |
91 | ||
92 | pub const SFD_CLOEXEC: ::c_int = 0x080000; | |
93 | ||
94 | pub const NCCS: usize = 32; | |
95 | ||
96 | pub const O_TRUNC: ::c_int = 512; | |
97 | ||
98 | pub const O_CLOEXEC: ::c_int = 0x80000; | |
99 | ||
100 | pub const EBFONT: ::c_int = 59; | |
101 | pub const ENOSTR: ::c_int = 60; | |
102 | pub const ENODATA: ::c_int = 61; | |
103 | pub const ETIME: ::c_int = 62; | |
104 | pub const ENOSR: ::c_int = 63; | |
105 | pub const ENONET: ::c_int = 64; | |
106 | pub const ENOPKG: ::c_int = 65; | |
107 | pub const EREMOTE: ::c_int = 66; | |
108 | pub const ENOLINK: ::c_int = 67; | |
109 | pub const EADV: ::c_int = 68; | |
110 | pub const ESRMNT: ::c_int = 69; | |
111 | pub const ECOMM: ::c_int = 70; | |
112 | pub const EPROTO: ::c_int = 71; | |
113 | pub const EDOTDOT: ::c_int = 73; | |
114 | ||
115 | pub const SA_NODEFER: ::c_int = 0x40000000; | |
116 | pub const SA_RESETHAND: ::c_int = 0x80000000; | |
117 | pub const SA_RESTART: ::c_int = 0x10000000; | |
118 | pub const SA_NOCLDSTOP: ::c_int = 0x00000001; | |
119 | ||
120 | pub const EPOLL_CLOEXEC: ::c_int = 0x80000; | |
121 | ||
122 | pub const EFD_CLOEXEC: ::c_int = 0x80000; | |
123 | ||
7453a54e SL |
124 | pub const BUFSIZ: ::c_uint = 1024; |
125 | pub const TMP_MAX: ::c_uint = 10000; | |
126 | pub const FOPEN_MAX: ::c_uint = 1000; | |
cc61c64b XL |
127 | pub const O_PATH: ::c_int = 0o10000000; |
128 | pub const O_EXEC: ::c_int = 0o10000000; | |
129 | pub const O_SEARCH: ::c_int = 0o10000000; | |
7453a54e SL |
130 | pub const O_ACCMODE: ::c_int = 0o10000003; |
131 | pub const O_NDELAY: ::c_int = O_NONBLOCK; | |
7453a54e SL |
132 | pub const NI_MAXHOST: ::socklen_t = 255; |
133 | pub const PTHREAD_STACK_MIN: ::size_t = 2048; | |
9e0c209e SL |
134 | pub const POSIX_FADV_DONTNEED: ::c_int = 4; |
135 | pub const POSIX_FADV_NOREUSE: ::c_int = 5; | |
136 | ||
137 | pub const POSIX_MADV_DONTNEED: ::c_int = 4; | |
7453a54e SL |
138 | |
139 | pub const RLIM_INFINITY: ::rlim_t = !0; | |
140 | pub const RLIMIT_RTTIME: ::c_int = 15; | |
141 | pub const RLIMIT_NLIMITS: ::c_int = 16; | |
142 | ||
143 | pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; | |
144 | ||
145 | pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15; | |
146 | pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16; | |
147 | pub const TCP_THIN_DUPACK: ::c_int = 17; | |
148 | pub const TCP_USER_TIMEOUT: ::c_int = 18; | |
149 | pub const TCP_REPAIR: ::c_int = 19; | |
150 | pub const TCP_REPAIR_QUEUE: ::c_int = 20; | |
151 | pub const TCP_QUEUE_SEQ: ::c_int = 21; | |
152 | pub const TCP_REPAIR_OPTIONS: ::c_int = 22; | |
153 | pub const TCP_FASTOPEN: ::c_int = 23; | |
154 | pub const TCP_TIMESTAMP: ::c_int = 24; | |
155 | ||
156 | pub const SIGUNUSED: ::c_int = ::SIGSYS; | |
157 | ||
158 | pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01; | |
159 | pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02; | |
160 | ||
5bcae85e | 161 | pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; |
7453a54e SL |
162 | pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; |
163 | ||
164 | pub const CPU_SETSIZE: ::c_int = 128; | |
165 | ||
166 | pub const QFMT_VFS_V1: ::c_int = 4; | |
167 | ||
168 | pub const PTRACE_TRACEME: ::c_int = 0; | |
169 | pub const PTRACE_PEEKTEXT: ::c_int = 1; | |
170 | pub const PTRACE_PEEKDATA: ::c_int = 2; | |
171 | pub const PTRACE_PEEKUSER: ::c_int = 3; | |
172 | pub const PTRACE_POKETEXT: ::c_int = 4; | |
173 | pub const PTRACE_POKEDATA: ::c_int = 5; | |
174 | pub const PTRACE_POKEUSER: ::c_int = 6; | |
175 | pub const PTRACE_CONT: ::c_int = 7; | |
176 | pub const PTRACE_KILL: ::c_int = 8; | |
177 | pub const PTRACE_SINGLESTEP: ::c_int = 9; | |
178 | pub const PTRACE_ATTACH: ::c_int = 16; | |
179 | pub const PTRACE_DETACH: ::c_int = 17; | |
180 | pub const PTRACE_SYSCALL: ::c_int = 24; | |
181 | pub const PTRACE_SETOPTIONS: ::c_int = 0x4200; | |
182 | pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201; | |
183 | pub const PTRACE_GETSIGINFO: ::c_int = 0x4202; | |
184 | pub const PTRACE_SETSIGINFO: ::c_int = 0x4203; | |
185 | pub const PTRACE_GETREGSET: ::c_int = 0x4204; | |
186 | pub const PTRACE_SETREGSET: ::c_int = 0x4205; | |
187 | pub const PTRACE_SEIZE: ::c_int = 0x4206; | |
188 | pub const PTRACE_INTERRUPT: ::c_int = 0x4207; | |
189 | pub const PTRACE_LISTEN: ::c_int = 0x4208; | |
190 | pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209; | |
191 | ||
9e0c209e SL |
192 | pub const PTRACE_O_EXITKILL: ::c_int = 1048576; |
193 | pub const PTRACE_O_TRACECLONE: ::c_int = 8; | |
194 | pub const PTRACE_O_TRACEEXEC: ::c_int = 16; | |
195 | pub const PTRACE_O_TRACEEXIT: ::c_int = 64; | |
196 | pub const PTRACE_O_TRACEFORK: ::c_int = 2; | |
197 | pub const PTRACE_O_TRACESYSGOOD: ::c_int = 1; | |
198 | pub const PTRACE_O_TRACEVFORK: ::c_int = 4; | |
199 | pub const PTRACE_O_TRACEVFORKDONE: ::c_int = 32; | |
200 | pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 2097152; | |
201 | ||
7453a54e SL |
202 | pub const MADV_DODUMP: ::c_int = 17; |
203 | pub const MADV_DONTDUMP: ::c_int = 16; | |
204 | ||
205 | pub const EPOLLWAKEUP: ::c_int = 0x20000000; | |
206 | ||
9e0c209e SL |
207 | pub const POLLRDNORM: ::c_short = 0x040; |
208 | pub const POLLRDBAND: ::c_short = 0x080; | |
209 | ||
7453a54e SL |
210 | pub const MADV_HUGEPAGE: ::c_int = 14; |
211 | pub const MADV_NOHUGEPAGE: ::c_int = 15; | |
212 | ||
213 | pub const PTRACE_GETFPREGS: ::c_uint = 14; | |
214 | pub const PTRACE_SETFPREGS: ::c_uint = 15; | |
215 | pub const PTRACE_GETFPXREGS: ::c_uint = 18; | |
216 | pub const PTRACE_SETFPXREGS: ::c_uint = 19; | |
217 | pub const PTRACE_GETREGS: ::c_uint = 12; | |
218 | pub const PTRACE_SETREGS: ::c_uint = 13; | |
219 | ||
220 | pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK; | |
221 | ||
222 | pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK; | |
223 | ||
224 | pub const TCSANOW: ::c_int = 0; | |
225 | pub const TCSADRAIN: ::c_int = 1; | |
226 | pub const TCSAFLUSH: ::c_int = 2; | |
227 | ||
3157f602 | 228 | pub const TIOCINQ: ::c_int = ::FIONREAD; |
7453a54e SL |
229 | |
230 | pub const RTLD_GLOBAL: ::c_int = 0x100; | |
231 | pub const RTLD_NOLOAD: ::c_int = 0x4; | |
232 | ||
54a0048b SL |
233 | // TODO(#247) Temporarily musl-specific (available since musl 0.9.12 / Linux |
234 | // kernel 3.10). See also notbsd/mod.rs | |
235 | pub const CLOCK_SGI_CYCLE: ::clockid_t = 10; | |
236 | pub const CLOCK_TAI: ::clockid_t = 11; | |
237 | ||
9e0c209e SL |
238 | pub const MCL_CURRENT: ::c_int = 0x0001; |
239 | pub const MCL_FUTURE: ::c_int = 0x0002; | |
240 | ||
241 | pub const SIGSTKSZ: ::size_t = 8192; | |
7cac9316 | 242 | pub const MINSIGSTKSZ: ::size_t = 2048; |
9e0c209e SL |
243 | pub const CBAUD: ::tcflag_t = 0o0010017; |
244 | pub const TAB1: ::c_int = 0x00000800; | |
245 | pub const TAB2: ::c_int = 0x00001000; | |
246 | pub const TAB3: ::c_int = 0x00001800; | |
247 | pub const CR1: ::c_int = 0x00000200; | |
248 | pub const CR2: ::c_int = 0x00000400; | |
249 | pub const CR3: ::c_int = 0x00000600; | |
250 | pub const FF1: ::c_int = 0x00008000; | |
251 | pub const BS1: ::c_int = 0x00002000; | |
252 | pub const VT1: ::c_int = 0x00004000; | |
253 | pub const VWERASE: usize = 14; | |
254 | pub const VREPRINT: usize = 12; | |
255 | pub const VSUSP: usize = 10; | |
256 | pub const VSTART: usize = 8; | |
257 | pub const VSTOP: usize = 9; | |
258 | pub const VDISCARD: usize = 13; | |
259 | pub const VTIME: usize = 5; | |
260 | pub const IXON: ::tcflag_t = 0x00000400; | |
261 | pub const IXOFF: ::tcflag_t = 0x00001000; | |
262 | pub const ONLCR: ::tcflag_t = 0x4; | |
263 | pub const CSIZE: ::tcflag_t = 0x00000030; | |
264 | pub const CS6: ::tcflag_t = 0x00000010; | |
265 | pub const CS7: ::tcflag_t = 0x00000020; | |
266 | pub const CS8: ::tcflag_t = 0x00000030; | |
267 | pub const CSTOPB: ::tcflag_t = 0x00000040; | |
268 | pub const CREAD: ::tcflag_t = 0x00000080; | |
269 | pub const PARENB: ::tcflag_t = 0x00000100; | |
270 | pub const PARODD: ::tcflag_t = 0x00000200; | |
271 | pub const HUPCL: ::tcflag_t = 0x00000400; | |
272 | pub const CLOCAL: ::tcflag_t = 0x00000800; | |
273 | pub const ECHOKE: ::tcflag_t = 0x00000800; | |
274 | pub const ECHOE: ::tcflag_t = 0x00000010; | |
275 | pub const ECHOK: ::tcflag_t = 0x00000020; | |
276 | pub const ECHONL: ::tcflag_t = 0x00000040; | |
277 | pub const ECHOPRT: ::tcflag_t = 0x00000400; | |
278 | pub const ECHOCTL: ::tcflag_t = 0x00000200; | |
279 | pub const ISIG: ::tcflag_t = 0x00000001; | |
280 | pub const ICANON: ::tcflag_t = 0x00000002; | |
281 | pub const PENDIN: ::tcflag_t = 0x00004000; | |
282 | pub const NOFLSH: ::tcflag_t = 0x00000080; | |
283 | ||
cc61c64b XL |
284 | pub const B0: ::speed_t = 0o000000; |
285 | pub const B50: ::speed_t = 0o000001; | |
286 | pub const B75: ::speed_t = 0o000002; | |
287 | pub const B110: ::speed_t = 0o000003; | |
288 | pub const B134: ::speed_t = 0o000004; | |
289 | pub const B150: ::speed_t = 0o000005; | |
290 | pub const B200: ::speed_t = 0o000006; | |
291 | pub const B300: ::speed_t = 0o000007; | |
292 | pub const B600: ::speed_t = 0o000010; | |
293 | pub const B1200: ::speed_t = 0o000011; | |
294 | pub const B1800: ::speed_t = 0o000012; | |
295 | pub const B2400: ::speed_t = 0o000013; | |
296 | pub const B4800: ::speed_t = 0o000014; | |
297 | pub const B9600: ::speed_t = 0o000015; | |
298 | pub const B19200: ::speed_t = 0o000016; | |
299 | pub const B38400: ::speed_t = 0o000017; | |
300 | pub const EXTA: ::speed_t = B19200; | |
301 | pub const EXTB: ::speed_t = B38400; | |
302 | pub const B57600: ::speed_t = 0o010001; | |
303 | pub const B115200: ::speed_t = 0o010002; | |
304 | pub const B230400: ::speed_t = 0o010003; | |
305 | pub const B460800: ::speed_t = 0o010004; | |
306 | pub const B500000: ::speed_t = 0o010005; | |
307 | pub const B576000: ::speed_t = 0o010006; | |
308 | pub const B921600: ::speed_t = 0o010007; | |
309 | pub const B1000000: ::speed_t = 0o010010; | |
310 | pub const B1152000: ::speed_t = 0o010011; | |
311 | pub const B1500000: ::speed_t = 0o010012; | |
312 | pub const B2000000: ::speed_t = 0o010013; | |
313 | pub const B2500000: ::speed_t = 0o010014; | |
314 | pub const B3000000: ::speed_t = 0o010015; | |
315 | pub const B3500000: ::speed_t = 0o010016; | |
316 | pub const B4000000: ::speed_t = 0o010017; | |
317 | ||
7453a54e | 318 | extern { |
7453a54e | 319 | pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; |
7453a54e | 320 | pub fn ptrace(request: ::c_int, ...) -> ::c_long; |
3157f602 XL |
321 | pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; |
322 | pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; | |
7453a54e SL |
323 | } |
324 | ||
325 | cfg_if! { | |
c30ab7b3 | 326 | if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] { |
7453a54e SL |
327 | mod b64; |
328 | pub use self::b64::*; | |
329 | } else if #[cfg(any(target_arch = "x86", | |
330 | target_arch = "mips", | |
331 | target_arch = "arm", | |
9e0c209e SL |
332 | target_arch = "asmjs", |
333 | target_arch = "wasm32"))] { | |
7453a54e SL |
334 | mod b32; |
335 | pub use self::b32::*; | |
336 | } else { } | |
337 | } |