]>
Commit | Line | Data |
---|---|---|
476ff2be SL |
1 | //! x86_64-specific definitions for 64-bit linux-like values |
2 | ||
3 | pub type c_char = i8; | |
4 | pub type wchar_t = i32; | |
5 | pub type nlink_t = u64; | |
6 | pub type blksize_t = i64; | |
7 | pub type greg_t = i64; | |
8bb4bdeb | 8 | pub type suseconds_t = i64; |
041b39d2 | 9 | pub type __u64 = ::c_ulonglong; |
476ff2be SL |
10 | |
11 | s! { | |
12 | pub struct stat { | |
13 | pub st_dev: ::dev_t, | |
14 | pub st_ino: ::ino_t, | |
15 | pub st_nlink: ::nlink_t, | |
16 | pub st_mode: ::mode_t, | |
17 | pub st_uid: ::uid_t, | |
18 | pub st_gid: ::gid_t, | |
19 | __pad0: ::c_int, | |
20 | pub st_rdev: ::dev_t, | |
21 | pub st_size: ::off_t, | |
22 | pub st_blksize: ::blksize_t, | |
23 | pub st_blocks: ::blkcnt_t, | |
24 | pub st_atime: ::time_t, | |
abe05a73 | 25 | pub st_atime_nsec: i64, |
476ff2be | 26 | pub st_mtime: ::time_t, |
abe05a73 | 27 | pub st_mtime_nsec: i64, |
476ff2be | 28 | pub st_ctime: ::time_t, |
abe05a73 XL |
29 | pub st_ctime_nsec: i64, |
30 | __unused: [i64; 3], | |
476ff2be SL |
31 | } |
32 | ||
33 | pub struct stat64 { | |
34 | pub st_dev: ::dev_t, | |
35 | pub st_ino: ::ino64_t, | |
36 | pub st_nlink: ::nlink_t, | |
37 | pub st_mode: ::mode_t, | |
38 | pub st_uid: ::uid_t, | |
39 | pub st_gid: ::gid_t, | |
40 | __pad0: ::c_int, | |
41 | pub st_rdev: ::dev_t, | |
42 | pub st_size: ::off_t, | |
43 | pub st_blksize: ::blksize_t, | |
44 | pub st_blocks: ::blkcnt64_t, | |
45 | pub st_atime: ::time_t, | |
abe05a73 | 46 | pub st_atime_nsec: i64, |
476ff2be | 47 | pub st_mtime: ::time_t, |
abe05a73 | 48 | pub st_mtime_nsec: i64, |
476ff2be | 49 | pub st_ctime: ::time_t, |
abe05a73 XL |
50 | pub st_ctime_nsec: i64, |
51 | __reserved: [i64; 3], | |
476ff2be SL |
52 | } |
53 | ||
ea8adc8c XL |
54 | pub struct statfs64 { |
55 | pub f_type: ::__fsword_t, | |
56 | pub f_bsize: ::__fsword_t, | |
57 | pub f_blocks: u64, | |
58 | pub f_bfree: u64, | |
59 | pub f_bavail: u64, | |
60 | pub f_files: u64, | |
61 | pub f_ffree: u64, | |
62 | pub f_fsid: ::fsid_t, | |
63 | pub f_namelen: ::__fsword_t, | |
64 | pub f_frsize: ::__fsword_t, | |
65 | pub f_flags: ::__fsword_t, | |
66 | pub f_spare: [::__fsword_t; 4], | |
67 | } | |
68 | ||
69 | pub struct statvfs64 { | |
70 | pub f_bsize: ::c_ulong, | |
71 | pub f_frsize: ::c_ulong, | |
72 | pub f_blocks: u64, | |
73 | pub f_bfree: u64, | |
74 | pub f_bavail: u64, | |
75 | pub f_files: u64, | |
76 | pub f_ffree: u64, | |
77 | pub f_favail: u64, | |
78 | pub f_fsid: ::c_ulong, | |
79 | pub f_flag: ::c_ulong, | |
80 | pub f_namemax: ::c_ulong, | |
81 | __f_spare: [::c_int; 6], | |
82 | } | |
83 | ||
476ff2be | 84 | pub struct pthread_attr_t { |
abe05a73 XL |
85 | #[cfg(target_pointer_width = "32")] |
86 | __size: [u32; 8], | |
87 | #[cfg(target_pointer_width = "64")] | |
476ff2be SL |
88 | __size: [u64; 7] |
89 | } | |
90 | ||
91 | pub struct _libc_fpxreg { | |
92 | pub significand: [u16; 4], | |
93 | pub exponent: u16, | |
94 | __private: [u16; 3], | |
95 | } | |
96 | ||
97 | pub struct _libc_xmmreg { | |
98 | pub element: [u32; 4], | |
99 | } | |
100 | ||
101 | pub struct _libc_fpstate { | |
102 | pub cwd: u16, | |
103 | pub swd: u16, | |
104 | pub ftw: u16, | |
105 | pub fop: u16, | |
106 | pub rip: u64, | |
107 | pub rdp: u64, | |
108 | pub mxcsr: u32, | |
109 | pub mxcr_mask: u32, | |
110 | pub _st: [_libc_fpxreg; 8], | |
111 | pub _xmm: [_libc_xmmreg; 16], | |
112 | __private: [u64; 12], | |
113 | } | |
114 | ||
041b39d2 XL |
115 | pub struct user_fpregs_struct { |
116 | pub cwd: ::c_ushort, | |
117 | pub swd: ::c_ushort, | |
118 | pub ftw: ::c_ushort, | |
119 | pub fop: ::c_ushort, | |
120 | pub rip: ::c_ulonglong, | |
121 | pub rdp: ::c_ulonglong, | |
122 | pub mxcsr: ::c_uint, | |
123 | pub mxcr_mask: ::c_uint, | |
124 | pub st_space: [::c_uint; 32], | |
125 | pub xmm_space: [::c_uint; 64], | |
126 | padding: [::c_uint; 24], | |
127 | } | |
128 | ||
129 | pub struct user_regs_struct { | |
130 | pub r15: ::c_ulonglong, | |
131 | pub r14: ::c_ulonglong, | |
132 | pub r13: ::c_ulonglong, | |
133 | pub r12: ::c_ulonglong, | |
134 | pub rbp: ::c_ulonglong, | |
135 | pub rbx: ::c_ulonglong, | |
136 | pub r11: ::c_ulonglong, | |
137 | pub r10: ::c_ulonglong, | |
138 | pub r9: ::c_ulonglong, | |
139 | pub r8: ::c_ulonglong, | |
140 | pub rax: ::c_ulonglong, | |
141 | pub rcx: ::c_ulonglong, | |
142 | pub rdx: ::c_ulonglong, | |
143 | pub rsi: ::c_ulonglong, | |
144 | pub rdi: ::c_ulonglong, | |
145 | pub orig_rax: ::c_ulonglong, | |
146 | pub rip: ::c_ulonglong, | |
147 | pub cs: ::c_ulonglong, | |
148 | pub eflags: ::c_ulonglong, | |
149 | pub rsp: ::c_ulonglong, | |
150 | pub ss: ::c_ulonglong, | |
151 | pub fs_base: ::c_ulonglong, | |
152 | pub gs_base: ::c_ulonglong, | |
153 | pub ds: ::c_ulonglong, | |
154 | pub es: ::c_ulonglong, | |
155 | pub fs: ::c_ulonglong, | |
156 | pub gs: ::c_ulonglong, | |
157 | } | |
158 | ||
159 | pub struct user { | |
160 | pub regs: user_regs_struct, | |
161 | pub u_fpvalid: ::c_int, | |
162 | pub i387: user_fpregs_struct, | |
163 | pub u_tsize: ::c_ulonglong, | |
164 | pub u_dsize: ::c_ulonglong, | |
165 | pub u_ssize: ::c_ulonglong, | |
166 | pub start_code: ::c_ulonglong, | |
167 | pub start_stack: ::c_ulonglong, | |
168 | pub signal: ::c_longlong, | |
169 | __reserved: ::c_int, | |
abe05a73 XL |
170 | #[cfg(target_pointer_width = "32")] |
171 | __pad1: u32, | |
041b39d2 | 172 | pub u_ar0: *mut user_regs_struct, |
abe05a73 XL |
173 | #[cfg(target_pointer_width = "32")] |
174 | __pad2: u32, | |
041b39d2 XL |
175 | pub u_fpstate: *mut user_fpregs_struct, |
176 | pub magic: ::c_ulonglong, | |
177 | pub u_comm: [::c_char; 32], | |
178 | pub u_debugreg: [::c_ulonglong; 8], | |
179 | } | |
180 | ||
476ff2be SL |
181 | pub struct mcontext_t { |
182 | pub gregs: [greg_t; 23], | |
183 | pub fpregs: *mut _libc_fpstate, | |
184 | __private: [u64; 8], | |
185 | } | |
186 | ||
187 | pub struct ucontext_t { | |
188 | pub uc_flags: ::c_ulong, | |
189 | pub uc_link: *mut ucontext_t, | |
190 | pub uc_stack: ::stack_t, | |
191 | pub uc_mcontext: mcontext_t, | |
192 | pub uc_sigmask: ::sigset_t, | |
193 | __private: [u8; 512], | |
194 | } | |
195 | ||
196 | pub struct ipc_perm { | |
197 | pub __key: ::key_t, | |
198 | pub uid: ::uid_t, | |
199 | pub gid: ::gid_t, | |
200 | pub cuid: ::uid_t, | |
201 | pub cgid: ::gid_t, | |
202 | pub mode: ::c_ushort, | |
203 | __pad1: ::c_ushort, | |
204 | pub __seq: ::c_ushort, | |
205 | __pad2: ::c_ushort, | |
abe05a73 XL |
206 | __unused1: u64, |
207 | __unused2: u64 | |
476ff2be SL |
208 | } |
209 | ||
210 | pub struct shmid_ds { | |
211 | pub shm_perm: ::ipc_perm, | |
212 | pub shm_segsz: ::size_t, | |
213 | pub shm_atime: ::time_t, | |
214 | pub shm_dtime: ::time_t, | |
215 | pub shm_ctime: ::time_t, | |
216 | pub shm_cpid: ::pid_t, | |
217 | pub shm_lpid: ::pid_t, | |
218 | pub shm_nattch: ::shmatt_t, | |
abe05a73 XL |
219 | __unused4: u64, |
220 | __unused5: u64 | |
221 | } | |
222 | ||
223 | pub struct termios2 { | |
224 | pub c_iflag: ::tcflag_t, | |
225 | pub c_oflag: ::tcflag_t, | |
226 | pub c_cflag: ::tcflag_t, | |
227 | pub c_lflag: ::tcflag_t, | |
228 | pub c_line: ::cc_t, | |
229 | pub c_cc: [::cc_t; 19], | |
230 | pub c_ispeed: ::speed_t, | |
231 | pub c_ospeed: ::speed_t, | |
476ff2be SL |
232 | } |
233 | } | |
234 | ||
8bb4bdeb XL |
235 | pub const TIOCGSOFTCAR: ::c_ulong = 0x5419; |
236 | pub const TIOCSSOFTCAR: ::c_ulong = 0x541A; | |
237 | ||
238 | pub const RLIMIT_NOFILE: ::c_int = 7; | |
239 | pub const RLIMIT_NPROC: ::c_int = 6; | |
240 | ||
241 | pub const O_APPEND: ::c_int = 1024; | |
242 | pub const O_CREAT: ::c_int = 64; | |
243 | pub const O_EXCL: ::c_int = 128; | |
244 | pub const O_NOCTTY: ::c_int = 256; | |
245 | pub const O_NONBLOCK: ::c_int = 2048; | |
246 | pub const O_SYNC: ::c_int = 1052672; | |
247 | pub const O_RSYNC: ::c_int = 1052672; | |
248 | pub const O_DSYNC: ::c_int = 4096; | |
249 | pub const O_FSYNC: ::c_int = 0x101000; | |
3b2f2976 XL |
250 | pub const O_NOATIME: ::c_int = 0o1000000; |
251 | pub const O_PATH: ::c_int = 0o10000000; | |
8bb4bdeb XL |
252 | |
253 | pub const MAP_GROWSDOWN: ::c_int = 0x0100; | |
254 | ||
255 | pub const EDEADLK: ::c_int = 35; | |
256 | pub const ENAMETOOLONG: ::c_int = 36; | |
257 | pub const ENOLCK: ::c_int = 37; | |
258 | pub const ENOSYS: ::c_int = 38; | |
259 | pub const ENOTEMPTY: ::c_int = 39; | |
260 | pub const ELOOP: ::c_int = 40; | |
261 | pub const ENOMSG: ::c_int = 42; | |
262 | pub const EIDRM: ::c_int = 43; | |
263 | pub const ECHRNG: ::c_int = 44; | |
264 | pub const EL2NSYNC: ::c_int = 45; | |
265 | pub const EL3HLT: ::c_int = 46; | |
266 | pub const EL3RST: ::c_int = 47; | |
267 | pub const ELNRNG: ::c_int = 48; | |
268 | pub const EUNATCH: ::c_int = 49; | |
269 | pub const ENOCSI: ::c_int = 50; | |
270 | pub const EL2HLT: ::c_int = 51; | |
271 | pub const EBADE: ::c_int = 52; | |
272 | pub const EBADR: ::c_int = 53; | |
273 | pub const EXFULL: ::c_int = 54; | |
274 | pub const ENOANO: ::c_int = 55; | |
275 | pub const EBADRQC: ::c_int = 56; | |
276 | pub const EBADSLT: ::c_int = 57; | |
277 | pub const EMULTIHOP: ::c_int = 72; | |
278 | pub const EOVERFLOW: ::c_int = 75; | |
279 | pub const ENOTUNIQ: ::c_int = 76; | |
280 | pub const EBADFD: ::c_int = 77; | |
281 | pub const EBADMSG: ::c_int = 74; | |
282 | pub const EREMCHG: ::c_int = 78; | |
283 | pub const ELIBACC: ::c_int = 79; | |
284 | pub const ELIBBAD: ::c_int = 80; | |
285 | pub const ELIBSCN: ::c_int = 81; | |
286 | pub const ELIBMAX: ::c_int = 82; | |
287 | pub const ELIBEXEC: ::c_int = 83; | |
288 | pub const EILSEQ: ::c_int = 84; | |
289 | pub const ERESTART: ::c_int = 85; | |
290 | pub const ESTRPIPE: ::c_int = 86; | |
291 | pub const EUSERS: ::c_int = 87; | |
292 | pub const ENOTSOCK: ::c_int = 88; | |
293 | pub const EDESTADDRREQ: ::c_int = 89; | |
294 | pub const EMSGSIZE: ::c_int = 90; | |
295 | pub const EPROTOTYPE: ::c_int = 91; | |
296 | pub const ENOPROTOOPT: ::c_int = 92; | |
297 | pub const EPROTONOSUPPORT: ::c_int = 93; | |
298 | pub const ESOCKTNOSUPPORT: ::c_int = 94; | |
299 | pub const EOPNOTSUPP: ::c_int = 95; | |
300 | pub const EPFNOSUPPORT: ::c_int = 96; | |
301 | pub const EAFNOSUPPORT: ::c_int = 97; | |
302 | pub const EADDRINUSE: ::c_int = 98; | |
303 | pub const EADDRNOTAVAIL: ::c_int = 99; | |
304 | pub const ENETDOWN: ::c_int = 100; | |
305 | pub const ENETUNREACH: ::c_int = 101; | |
306 | pub const ENETRESET: ::c_int = 102; | |
307 | pub const ECONNABORTED: ::c_int = 103; | |
308 | pub const ECONNRESET: ::c_int = 104; | |
309 | pub const ENOBUFS: ::c_int = 105; | |
310 | pub const EISCONN: ::c_int = 106; | |
311 | pub const ENOTCONN: ::c_int = 107; | |
312 | pub const ESHUTDOWN: ::c_int = 108; | |
313 | pub const ETOOMANYREFS: ::c_int = 109; | |
314 | pub const ETIMEDOUT: ::c_int = 110; | |
315 | pub const ECONNREFUSED: ::c_int = 111; | |
316 | pub const EHOSTDOWN: ::c_int = 112; | |
317 | pub const EHOSTUNREACH: ::c_int = 113; | |
318 | pub const EALREADY: ::c_int = 114; | |
319 | pub const EINPROGRESS: ::c_int = 115; | |
320 | pub const ESTALE: ::c_int = 116; | |
321 | pub const EDQUOT: ::c_int = 122; | |
322 | pub const ENOMEDIUM: ::c_int = 123; | |
323 | pub const EMEDIUMTYPE: ::c_int = 124; | |
324 | pub const ECANCELED: ::c_int = 125; | |
325 | pub const ENOKEY: ::c_int = 126; | |
326 | pub const EKEYEXPIRED: ::c_int = 127; | |
327 | pub const EKEYREVOKED: ::c_int = 128; | |
328 | pub const EKEYREJECTED: ::c_int = 129; | |
329 | pub const EOWNERDEAD: ::c_int = 130; | |
330 | pub const ENOTRECOVERABLE: ::c_int = 131; | |
331 | pub const EHWPOISON: ::c_int = 133; | |
332 | pub const ERFKILL: ::c_int = 132; | |
333 | ||
334 | pub const SOL_SOCKET: ::c_int = 1; | |
335 | ||
336 | pub const SO_REUSEADDR: ::c_int = 2; | |
337 | pub const SO_TYPE: ::c_int = 3; | |
338 | pub const SO_ERROR: ::c_int = 4; | |
339 | pub const SO_DONTROUTE: ::c_int = 5; | |
340 | pub const SO_BROADCAST: ::c_int = 6; | |
341 | pub const SO_SNDBUF: ::c_int = 7; | |
342 | pub const SO_RCVBUF: ::c_int = 8; | |
343 | pub const SO_SNDBUFFORCE: ::c_int = 32; | |
344 | pub const SO_RCVBUFFORCE: ::c_int = 33; | |
345 | pub const SO_KEEPALIVE: ::c_int = 9; | |
346 | pub const SO_OOBINLINE: ::c_int = 10; | |
347 | pub const SO_NO_CHECK: ::c_int = 11; | |
348 | pub const SO_PRIORITY: ::c_int = 12; | |
349 | pub const SO_LINGER: ::c_int = 13; | |
350 | pub const SO_BSDCOMPAT: ::c_int = 14; | |
351 | pub const SO_REUSEPORT: ::c_int = 15; | |
352 | pub const SO_PASSCRED: ::c_int = 16; | |
353 | pub const SO_PEERCRED: ::c_int = 17; | |
354 | pub const SO_RCVLOWAT: ::c_int = 18; | |
355 | pub const SO_SNDLOWAT: ::c_int = 19; | |
356 | pub const SO_RCVTIMEO: ::c_int = 20; | |
357 | pub const SO_SNDTIMEO: ::c_int = 21; | |
358 | pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22; | |
359 | pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23; | |
360 | pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24; | |
361 | pub const SO_BINDTODEVICE: ::c_int = 25; | |
362 | pub const SO_ATTACH_FILTER: ::c_int = 26; | |
363 | pub const SO_DETACH_FILTER: ::c_int = 27; | |
364 | pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER; | |
365 | pub const SO_PEERNAME: ::c_int = 28; | |
366 | pub const SO_TIMESTAMP: ::c_int = 29; | |
8bb4bdeb XL |
367 | pub const SO_ACCEPTCONN: ::c_int = 30; |
368 | pub const SO_PEERSEC: ::c_int = 31; | |
369 | pub const SO_PASSSEC: ::c_int = 34; | |
370 | pub const SO_TIMESTAMPNS: ::c_int = 35; | |
371 | pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS; | |
372 | pub const SO_MARK: ::c_int = 36; | |
373 | pub const SO_TIMESTAMPING: ::c_int = 37; | |
374 | pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING; | |
375 | pub const SO_PROTOCOL: ::c_int = 38; | |
376 | pub const SO_DOMAIN: ::c_int = 39; | |
377 | pub const SO_RXQ_OVFL: ::c_int = 40; | |
378 | pub const SO_WIFI_STATUS: ::c_int = 41; | |
379 | pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS; | |
380 | pub const SO_PEEK_OFF: ::c_int = 42; | |
381 | pub const SO_NOFCS: ::c_int = 43; | |
382 | pub const SO_LOCK_FILTER: ::c_int = 44; | |
383 | pub const SO_SELECT_ERR_QUEUE: ::c_int = 45; | |
384 | pub const SO_BUSY_POLL: ::c_int = 46; | |
385 | pub const SO_MAX_PACING_RATE: ::c_int = 47; | |
386 | pub const SO_BPF_EXTENSIONS: ::c_int = 48; | |
387 | pub const SO_INCOMING_CPU: ::c_int = 49; | |
388 | pub const SO_ATTACH_BPF: ::c_int = 50; | |
389 | pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER; | |
390 | ||
391 | pub const SA_ONSTACK: ::c_int = 0x08000000; | |
392 | pub const SA_SIGINFO: ::c_int = 0x00000004; | |
393 | pub const SA_NOCLDWAIT: ::c_int = 0x00000002; | |
394 | ||
395 | pub const SIGCHLD: ::c_int = 17; | |
396 | pub const SIGBUS: ::c_int = 7; | |
397 | pub const SIGUSR1: ::c_int = 10; | |
398 | pub const SIGUSR2: ::c_int = 12; | |
399 | pub const SIGCONT: ::c_int = 18; | |
400 | pub const SIGSTOP: ::c_int = 19; | |
401 | pub const SIGTSTP: ::c_int = 20; | |
402 | pub const SIGURG: ::c_int = 23; | |
403 | pub const SIGIO: ::c_int = 29; | |
404 | pub const SIGSYS: ::c_int = 31; | |
405 | pub const SIGSTKFLT: ::c_int = 16; | |
406 | pub const SIGUNUSED: ::c_int = 31; | |
407 | pub const SIGPOLL: ::c_int = 29; | |
408 | pub const SIGPWR: ::c_int = 30; | |
409 | pub const SIG_SETMASK: ::c_int = 2; | |
410 | pub const SIG_BLOCK: ::c_int = 0x000000; | |
411 | pub const SIG_UNBLOCK: ::c_int = 0x01; | |
412 | ||
413 | pub const POLLWRNORM: ::c_short = 0x100; | |
414 | pub const POLLWRBAND: ::c_short = 0x200; | |
415 | ||
416 | pub const O_ASYNC: ::c_int = 0x2000; | |
417 | pub const O_NDELAY: ::c_int = 0x800; | |
418 | ||
419 | pub const PTRACE_DETACH: ::c_uint = 17; | |
420 | ||
421 | pub const EFD_NONBLOCK: ::c_int = 0x800; | |
422 | ||
423 | pub const F_GETLK: ::c_int = 5; | |
424 | pub const F_GETOWN: ::c_int = 9; | |
425 | pub const F_SETOWN: ::c_int = 8; | |
426 | pub const F_SETLK: ::c_int = 6; | |
427 | pub const F_SETLKW: ::c_int = 7; | |
428 | ||
429 | pub const SFD_NONBLOCK: ::c_int = 0x0800; | |
430 | ||
431 | pub const TIOCEXCL: ::c_ulong = 0x540C; | |
432 | pub const TIOCNXCL: ::c_ulong = 0x540D; | |
433 | pub const TIOCSCTTY: ::c_ulong = 0x540E; | |
434 | pub const TIOCSTI: ::c_ulong = 0x5412; | |
435 | pub const TIOCMGET: ::c_ulong = 0x5415; | |
436 | pub const TIOCMBIS: ::c_ulong = 0x5416; | |
437 | pub const TIOCMBIC: ::c_ulong = 0x5417; | |
438 | pub const TIOCMSET: ::c_ulong = 0x5418; | |
439 | pub const TIOCCONS: ::c_ulong = 0x541D; | |
440 | ||
8bb4bdeb XL |
441 | pub const SFD_CLOEXEC: ::c_int = 0x080000; |
442 | ||
443 | pub const NCCS: usize = 32; | |
444 | ||
445 | pub const O_TRUNC: ::c_int = 512; | |
446 | ||
447 | pub const O_CLOEXEC: ::c_int = 0x80000; | |
448 | ||
449 | pub const EBFONT: ::c_int = 59; | |
450 | pub const ENOSTR: ::c_int = 60; | |
451 | pub const ENODATA: ::c_int = 61; | |
452 | pub const ETIME: ::c_int = 62; | |
453 | pub const ENOSR: ::c_int = 63; | |
454 | pub const ENONET: ::c_int = 64; | |
455 | pub const ENOPKG: ::c_int = 65; | |
456 | pub const EREMOTE: ::c_int = 66; | |
457 | pub const ENOLINK: ::c_int = 67; | |
458 | pub const EADV: ::c_int = 68; | |
459 | pub const ESRMNT: ::c_int = 69; | |
460 | pub const ECOMM: ::c_int = 70; | |
461 | pub const EPROTO: ::c_int = 71; | |
462 | pub const EDOTDOT: ::c_int = 73; | |
463 | ||
464 | pub const SA_NODEFER: ::c_int = 0x40000000; | |
465 | pub const SA_RESETHAND: ::c_int = 0x80000000; | |
466 | pub const SA_RESTART: ::c_int = 0x10000000; | |
467 | pub const SA_NOCLDSTOP: ::c_int = 0x00000001; | |
468 | ||
469 | pub const EPOLL_CLOEXEC: ::c_int = 0x80000; | |
470 | ||
471 | pub const EFD_CLOEXEC: ::c_int = 0x80000; | |
472 | ||
476ff2be | 473 | pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; |
476ff2be SL |
474 | pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; |
475 | ||
476 | pub const O_DIRECT: ::c_int = 0x4000; | |
477 | pub const O_DIRECTORY: ::c_int = 0x10000; | |
478 | pub const O_NOFOLLOW: ::c_int = 0x20000; | |
479 | ||
480 | pub const MAP_LOCKED: ::c_int = 0x02000; | |
481 | pub const MAP_NORESERVE: ::c_int = 0x04000; | |
482 | pub const MAP_32BIT: ::c_int = 0x0040; | |
483 | ||
484 | pub const EDEADLOCK: ::c_int = 35; | |
485 | ||
476ff2be SL |
486 | pub const FIOCLEX: ::c_ulong = 0x5451; |
487 | pub const FIONBIO: ::c_ulong = 0x5421; | |
488 | ||
489 | pub const PTRACE_GETFPREGS: ::c_uint = 14; | |
490 | pub const PTRACE_SETFPREGS: ::c_uint = 15; | |
491 | pub const PTRACE_GETFPXREGS: ::c_uint = 18; | |
492 | pub const PTRACE_SETFPXREGS: ::c_uint = 19; | |
493 | pub const PTRACE_GETREGS: ::c_uint = 12; | |
494 | pub const PTRACE_SETREGS: ::c_uint = 13; | |
476ff2be SL |
495 | pub const PTRACE_PEEKSIGINFO_SHARED: ::c_uint = 1; |
496 | ||
476ff2be SL |
497 | pub const MCL_CURRENT: ::c_int = 0x0001; |
498 | pub const MCL_FUTURE: ::c_int = 0x0002; | |
499 | ||
500 | pub const SIGSTKSZ: ::size_t = 8192; | |
7cac9316 | 501 | pub const MINSIGSTKSZ: ::size_t = 2048; |
476ff2be SL |
502 | pub const CBAUD: ::tcflag_t = 0o0010017; |
503 | pub const TAB1: ::c_int = 0x00000800; | |
504 | pub const TAB2: ::c_int = 0x00001000; | |
505 | pub const TAB3: ::c_int = 0x00001800; | |
506 | pub const CR1: ::c_int = 0x00000200; | |
507 | pub const CR2: ::c_int = 0x00000400; | |
508 | pub const CR3: ::c_int = 0x00000600; | |
509 | pub const FF1: ::c_int = 0x00008000; | |
510 | pub const BS1: ::c_int = 0x00002000; | |
511 | pub const VT1: ::c_int = 0x00004000; | |
512 | pub const VWERASE: usize = 14; | |
513 | pub const VREPRINT: usize = 12; | |
514 | pub const VSUSP: usize = 10; | |
515 | pub const VSTART: usize = 8; | |
516 | pub const VSTOP: usize = 9; | |
517 | pub const VDISCARD: usize = 13; | |
518 | pub const VTIME: usize = 5; | |
519 | pub const IXON: ::tcflag_t = 0x00000400; | |
520 | pub const IXOFF: ::tcflag_t = 0x00001000; | |
521 | pub const ONLCR: ::tcflag_t = 0x4; | |
522 | pub const CSIZE: ::tcflag_t = 0x00000030; | |
523 | pub const CS6: ::tcflag_t = 0x00000010; | |
524 | pub const CS7: ::tcflag_t = 0x00000020; | |
525 | pub const CS8: ::tcflag_t = 0x00000030; | |
526 | pub const CSTOPB: ::tcflag_t = 0x00000040; | |
527 | pub const CREAD: ::tcflag_t = 0x00000080; | |
528 | pub const PARENB: ::tcflag_t = 0x00000100; | |
529 | pub const PARODD: ::tcflag_t = 0x00000200; | |
530 | pub const HUPCL: ::tcflag_t = 0x00000400; | |
531 | pub const CLOCAL: ::tcflag_t = 0x00000800; | |
532 | pub const ECHOKE: ::tcflag_t = 0x00000800; | |
533 | pub const ECHOE: ::tcflag_t = 0x00000010; | |
534 | pub const ECHOK: ::tcflag_t = 0x00000020; | |
535 | pub const ECHONL: ::tcflag_t = 0x00000040; | |
536 | pub const ECHOPRT: ::tcflag_t = 0x00000400; | |
537 | pub const ECHOCTL: ::tcflag_t = 0x00000200; | |
538 | pub const ISIG: ::tcflag_t = 0x00000001; | |
539 | pub const ICANON: ::tcflag_t = 0x00000002; | |
540 | pub const PENDIN: ::tcflag_t = 0x00004000; | |
541 | pub const NOFLSH: ::tcflag_t = 0x00000080; | |
041b39d2 XL |
542 | pub const CIBAUD: ::tcflag_t = 0o02003600000; |
543 | pub const CBAUDEX: ::tcflag_t = 0o010000; | |
544 | pub const VSWTC: usize = 7; | |
545 | pub const OLCUC: ::tcflag_t = 0o000002; | |
546 | pub const NLDLY: ::tcflag_t = 0o000400; | |
547 | pub const CRDLY: ::tcflag_t = 0o003000; | |
548 | pub const TABDLY: ::tcflag_t = 0o014000; | |
549 | pub const BSDLY: ::tcflag_t = 0o020000; | |
550 | pub const FFDLY: ::tcflag_t = 0o100000; | |
551 | pub const VTDLY: ::tcflag_t = 0o040000; | |
552 | pub const XTABS: ::tcflag_t = 0o014000; | |
476ff2be | 553 | |
8bb4bdeb XL |
554 | pub const B0: ::speed_t = 0o000000; |
555 | pub const B50: ::speed_t = 0o000001; | |
556 | pub const B75: ::speed_t = 0o000002; | |
557 | pub const B110: ::speed_t = 0o000003; | |
558 | pub const B134: ::speed_t = 0o000004; | |
559 | pub const B150: ::speed_t = 0o000005; | |
560 | pub const B200: ::speed_t = 0o000006; | |
561 | pub const B300: ::speed_t = 0o000007; | |
562 | pub const B600: ::speed_t = 0o000010; | |
563 | pub const B1200: ::speed_t = 0o000011; | |
564 | pub const B1800: ::speed_t = 0o000012; | |
565 | pub const B2400: ::speed_t = 0o000013; | |
566 | pub const B4800: ::speed_t = 0o000014; | |
567 | pub const B9600: ::speed_t = 0o000015; | |
568 | pub const B19200: ::speed_t = 0o000016; | |
569 | pub const B38400: ::speed_t = 0o000017; | |
570 | pub const EXTA: ::speed_t = B19200; | |
571 | pub const EXTB: ::speed_t = B38400; | |
abe05a73 | 572 | pub const BOTHER: ::speed_t = 0o010000; |
8bb4bdeb XL |
573 | pub const B57600: ::speed_t = 0o010001; |
574 | pub const B115200: ::speed_t = 0o010002; | |
575 | pub const B230400: ::speed_t = 0o010003; | |
576 | pub const B460800: ::speed_t = 0o010004; | |
577 | pub const B500000: ::speed_t = 0o010005; | |
578 | pub const B576000: ::speed_t = 0o010006; | |
579 | pub const B921600: ::speed_t = 0o010007; | |
580 | pub const B1000000: ::speed_t = 0o010010; | |
581 | pub const B1152000: ::speed_t = 0o010011; | |
582 | pub const B1500000: ::speed_t = 0o010012; | |
583 | pub const B2000000: ::speed_t = 0o010013; | |
584 | pub const B2500000: ::speed_t = 0o010014; | |
585 | pub const B3000000: ::speed_t = 0o010015; | |
586 | pub const B3500000: ::speed_t = 0o010016; | |
587 | pub const B4000000: ::speed_t = 0o010017; | |
588 | ||
476ff2be SL |
589 | pub const VEOL: usize = 11; |
590 | pub const VEOL2: usize = 16; | |
591 | pub const VMIN: usize = 6; | |
592 | pub const IEXTEN: ::tcflag_t = 0x00008000; | |
593 | pub const TOSTOP: ::tcflag_t = 0x00000100; | |
594 | pub const FLUSHO: ::tcflag_t = 0x00001000; | |
595 | pub const EXTPROC: ::tcflag_t = 0x00010000; | |
596 | pub const TCGETS: ::c_ulong = 0x5401; | |
597 | pub const TCSETS: ::c_ulong = 0x5402; | |
598 | pub const TCSETSW: ::c_ulong = 0x5403; | |
599 | pub const TCSETSF: ::c_ulong = 0x5404; | |
600 | pub const TCGETA: ::c_ulong = 0x5405; | |
601 | pub const TCSETA: ::c_ulong = 0x5406; | |
602 | pub const TCSETAW: ::c_ulong = 0x5407; | |
603 | pub const TCSETAF: ::c_ulong = 0x5408; | |
604 | pub const TCSBRK: ::c_ulong = 0x5409; | |
605 | pub const TCXONC: ::c_ulong = 0x540A; | |
606 | pub const TCFLSH: ::c_ulong = 0x540B; | |
607 | pub const TIOCINQ: ::c_ulong = 0x541B; | |
608 | pub const TIOCGPGRP: ::c_ulong = 0x540F; | |
609 | pub const TIOCSPGRP: ::c_ulong = 0x5410; | |
610 | pub const TIOCOUTQ: ::c_ulong = 0x5411; | |
611 | pub const TIOCGWINSZ: ::c_ulong = 0x5413; | |
612 | pub const TIOCSWINSZ: ::c_ulong = 0x5414; | |
613 | pub const FIONREAD: ::c_ulong = 0x541B; | |
614 | ||
3b2f2976 XL |
615 | // offsets in user_regs_structs, from sys/reg.h |
616 | pub const R15: ::c_int = 0; | |
617 | pub const R14: ::c_int = 1; | |
618 | pub const R13: ::c_int = 2; | |
619 | pub const R12: ::c_int = 3; | |
620 | pub const RBP: ::c_int = 4; | |
621 | pub const RBX: ::c_int = 5; | |
622 | pub const R11: ::c_int = 6; | |
623 | pub const R10: ::c_int = 7; | |
624 | pub const R9: ::c_int = 8; | |
625 | pub const R8: ::c_int = 9; | |
626 | pub const RAX: ::c_int = 10; | |
627 | pub const RCX: ::c_int = 11; | |
628 | pub const RDX: ::c_int = 12; | |
629 | pub const RSI: ::c_int = 13; | |
630 | pub const RDI: ::c_int = 14; | |
631 | pub const ORIG_RAX: ::c_int = 15; | |
632 | pub const RIP: ::c_int = 16; | |
633 | pub const CS: ::c_int = 17; | |
634 | pub const EFLAGS: ::c_int = 18; | |
635 | pub const RSP: ::c_int = 19; | |
636 | pub const SS: ::c_int = 20; | |
637 | pub const FS_BASE: ::c_int = 21; | |
638 | pub const GS_BASE: ::c_int = 22; | |
639 | pub const DS: ::c_int = 23; | |
640 | pub const ES: ::c_int = 24; | |
641 | pub const FS: ::c_int = 25; | |
642 | pub const GS: ::c_int = 26; | |
643 | ||
476ff2be SL |
644 | extern { |
645 | pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; | |
646 | pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; | |
647 | pub fn makecontext(ucp: *mut ucontext_t, | |
648 | func: extern fn (), | |
649 | argc: ::c_int, ...); | |
650 | pub fn swapcontext(uocp: *mut ucontext_t, | |
651 | ucp: *const ucontext_t) -> ::c_int; | |
041b39d2 XL |
652 | pub fn iopl(level: ::c_int) -> ::c_int; |
653 | pub fn ioperm(from: ::c_ulong, num: ::c_ulong, | |
654 | turn_on: ::c_int) -> ::c_int; | |
476ff2be | 655 | } |