1 //! x86_64-specific definitions for 64-bit linux-like values
4 pub type wchar_t
= i32;
5 pub type nlink_t
= u64;
6 pub type blksize_t
= i64;
8 pub type suseconds_t
= i64;
9 pub type __u64
= ::c_ulonglong
;
12 pub struct sigaction
{
13 pub sa_sigaction
: ::sighandler_t
,
14 pub sa_mask
: ::sigset_t
,
15 #[cfg(target_arch = "sparc64")]
17 pub sa_flags
: ::c_int
,
18 pub sa_restorer
: ::Option
<extern fn()>,
22 pub f_type
: ::__fsword_t
,
23 pub f_bsize
: ::__fsword_t
,
24 pub f_blocks
: ::fsblkcnt_t
,
25 pub f_bfree
: ::fsblkcnt_t
,
26 pub f_bavail
: ::fsblkcnt_t
,
28 pub f_files
: ::fsfilcnt_t
,
29 pub f_ffree
: ::fsfilcnt_t
,
32 pub f_namelen
: ::__fsword_t
,
33 pub f_frsize
: ::__fsword_t
,
34 f_spare
: [::__fsword_t
; 5],
38 pub l_type
: ::c_short
,
39 pub l_whence
: ::c_short
,
45 pub struct siginfo_t
{
46 pub si_signo
: ::c_int
,
47 pub si_errno
: ::c_int
,
52 note
="Please leave a comment on \
53 https://github.com/rust-lang/libc/pull/1316 if you're using \
56 pub _pad
: [::c_int
; 29],
61 pub ss_sp
: *mut ::c_void
,
62 pub ss_flags
: ::c_int
,
69 pub st_nlink
: ::nlink_t
,
70 pub st_mode
: ::mode_t
,
76 pub st_blksize
: ::blksize_t
,
77 pub st_blocks
: ::blkcnt_t
,
78 pub st_atime
: ::time_t
,
79 pub st_atime_nsec
: i64,
80 pub st_mtime
: ::time_t
,
81 pub st_mtime_nsec
: i64,
82 pub st_ctime
: ::time_t
,
83 pub st_ctime_nsec
: i64,
89 pub st_ino
: ::ino64_t
,
90 pub st_nlink
: ::nlink_t
,
91 pub st_mode
: ::mode_t
,
97 pub st_blksize
: ::blksize_t
,
98 pub st_blocks
: ::blkcnt64_t
,
99 pub st_atime
: ::time_t
,
100 pub st_atime_nsec
: i64,
101 pub st_mtime
: ::time_t
,
102 pub st_mtime_nsec
: i64,
103 pub st_ctime
: ::time_t
,
104 pub st_ctime_nsec
: i64,
105 __reserved
: [i64; 3],
108 pub struct statfs64
{
109 pub f_type
: ::__fsword_t
,
110 pub f_bsize
: ::__fsword_t
,
116 pub f_fsid
: ::fsid_t
,
117 pub f_namelen
: ::__fsword_t
,
118 pub f_frsize
: ::__fsword_t
,
119 pub f_flags
: ::__fsword_t
,
120 pub f_spare
: [::__fsword_t
; 4],
123 pub struct statvfs64
{
124 pub f_bsize
: ::c_ulong
,
125 pub f_frsize
: ::c_ulong
,
132 pub f_fsid
: ::c_ulong
,
133 pub f_flag
: ::c_ulong
,
134 pub f_namemax
: ::c_ulong
,
135 __f_spare
: [::c_int
; 6],
138 pub struct pthread_attr_t
{
139 #[cfg(target_pointer_width = "32")]
141 #[cfg(target_pointer_width = "64")]
145 pub struct _libc_fpxreg
{
146 pub significand
: [u16; 4],
151 pub struct _libc_xmmreg
{
152 pub element
: [u32; 4],
155 pub struct _libc_fpstate
{
164 pub _st
: [_libc_fpxreg
; 8],
165 pub _xmm
: [_libc_xmmreg
; 16],
166 __private
: [u64; 12],
169 pub struct user_regs_struct
{
170 pub r15
: ::c_ulonglong
,
171 pub r14
: ::c_ulonglong
,
172 pub r13
: ::c_ulonglong
,
173 pub r12
: ::c_ulonglong
,
174 pub rbp
: ::c_ulonglong
,
175 pub rbx
: ::c_ulonglong
,
176 pub r11
: ::c_ulonglong
,
177 pub r10
: ::c_ulonglong
,
178 pub r9
: ::c_ulonglong
,
179 pub r8
: ::c_ulonglong
,
180 pub rax
: ::c_ulonglong
,
181 pub rcx
: ::c_ulonglong
,
182 pub rdx
: ::c_ulonglong
,
183 pub rsi
: ::c_ulonglong
,
184 pub rdi
: ::c_ulonglong
,
185 pub orig_rax
: ::c_ulonglong
,
186 pub rip
: ::c_ulonglong
,
187 pub cs
: ::c_ulonglong
,
188 pub eflags
: ::c_ulonglong
,
189 pub rsp
: ::c_ulonglong
,
190 pub ss
: ::c_ulonglong
,
191 pub fs_base
: ::c_ulonglong
,
192 pub gs_base
: ::c_ulonglong
,
193 pub ds
: ::c_ulonglong
,
194 pub es
: ::c_ulonglong
,
195 pub fs
: ::c_ulonglong
,
196 pub gs
: ::c_ulonglong
,
200 pub regs
: user_regs_struct
,
201 pub u_fpvalid
: ::c_int
,
202 pub i387
: user_fpregs_struct
,
203 pub u_tsize
: ::c_ulonglong
,
204 pub u_dsize
: ::c_ulonglong
,
205 pub u_ssize
: ::c_ulonglong
,
206 pub start_code
: ::c_ulonglong
,
207 pub start_stack
: ::c_ulonglong
,
208 pub signal
: ::c_longlong
,
210 #[cfg(target_pointer_width = "32")]
212 pub u_ar0
: *mut user_regs_struct
,
213 #[cfg(target_pointer_width = "32")]
215 pub u_fpstate
: *mut user_fpregs_struct
,
216 pub magic
: ::c_ulonglong
,
217 pub u_comm
: [::c_char
; 32],
218 pub u_debugreg
: [::c_ulonglong
; 8],
221 pub struct mcontext_t
{
222 pub gregs
: [greg_t
; 23],
223 pub fpregs
: *mut _libc_fpstate
,
227 pub struct ipc_perm
{
233 pub mode
: ::c_ushort
,
235 pub __seq
: ::c_ushort
,
241 pub struct shmid_ds
{
242 pub shm_perm
: ::ipc_perm
,
243 pub shm_segsz
: ::size_t
,
244 pub shm_atime
: ::time_t
,
245 pub shm_dtime
: ::time_t
,
246 pub shm_ctime
: ::time_t
,
247 pub shm_cpid
: ::pid_t
,
248 pub shm_lpid
: ::pid_t
,
249 pub shm_nattch
: ::shmatt_t
,
254 pub struct termios2
{
255 pub c_iflag
: ::tcflag_t
,
256 pub c_oflag
: ::tcflag_t
,
257 pub c_cflag
: ::tcflag_t
,
258 pub c_lflag
: ::tcflag_t
,
260 pub c_cc
: [::cc_t
; 19],
261 pub c_ispeed
: ::speed_t
,
262 pub c_ospeed
: ::speed_t
,
267 pub struct user_fpregs_struct
{
272 pub rip
: ::c_ulonglong
,
273 pub rdp
: ::c_ulonglong
,
275 pub mxcr_mask
: ::c_uint
,
276 pub st_space
: [::c_uint
; 32],
277 pub xmm_space
: [::c_uint
; 64],
278 padding
: [::c_uint
; 24],
281 pub struct ucontext_t
{
282 pub uc_flags
: ::c_ulong
,
283 pub uc_link
: *mut ucontext_t
,
284 pub uc_stack
: ::stack_t
,
285 pub uc_mcontext
: mcontext_t
,
286 pub uc_sigmask
: ::sigset_t
,
287 __private
: [u8; 512],
288 // FIXME: the shadow stack field requires glibc >= 2.28.
289 // Re-add once we drop compatibility with glibc versions older than
292 // __ssp: [::c_ulonglong; 4],
297 if #[cfg(feature = "extra_traits")] {
298 impl PartialEq
for user_fpregs_struct
{
299 fn eq(&self, other
: &user_fpregs_struct
) -> bool
{
300 self.cwd
== other
.cwd
301 && self.swd
== other
.swd
302 && self.ftw
== other
.ftw
303 && self.fop
== other
.fop
304 && self.rip
== other
.rip
305 && self.rdp
== other
.rdp
306 && self.mxcsr
== other
.mxcsr
307 && self.mxcr_mask
== other
.mxcr_mask
308 && self.st_space
== other
.st_space
312 .zip(other
.xmm_space
.iter())
314 // Ignore padding field
318 impl Eq
for user_fpregs_struct {}
320 impl ::fmt
::Debug
for user_fpregs_struct
{
321 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
322 f
.debug_struct("user_fpregs_struct")
323 .field("cwd", &self.cwd
)
324 .field("ftw", &self.ftw
)
325 .field("fop", &self.fop
)
326 .field("rip", &self.rip
)
327 .field("rdp", &self.rdp
)
328 .field("mxcsr", &self.mxcsr
)
329 .field("mxcr_mask", &self.mxcr_mask
)
330 .field("st_space", &self.st_space
)
331 // FIXME: .field("xmm_space", &self.xmm_space)
332 // Ignore padding field
337 impl ::hash
::Hash
for user_fpregs_struct
{
338 fn hash
<H
: ::hash
::Hasher
>(&self, state
: &mut H
) {
339 self.cwd
.hash(state
);
340 self.ftw
.hash(state
);
341 self.fop
.hash(state
);
342 self.rip
.hash(state
);
343 self.rdp
.hash(state
);
344 self.mxcsr
.hash(state
);
345 self.mxcr_mask
.hash(state
);
346 self.st_space
.hash(state
);
347 self.xmm_space
.hash(state
);
348 // Ignore padding field
352 impl PartialEq
for ucontext_t
{
353 fn eq(&self, other
: &ucontext_t
) -> bool
{
354 self.uc_flags
== other
.uc_flags
355 && self.uc_link
== other
.uc_link
356 && self.uc_stack
== other
.uc_stack
357 && self.uc_mcontext
== other
.uc_mcontext
358 && self.uc_sigmask
== other
.uc_sigmask
359 // Ignore __private field
363 impl Eq
for ucontext_t {}
365 impl ::fmt
::Debug
for ucontext_t
{
366 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
367 f
.debug_struct("ucontext_t")
368 .field("uc_flags", &self.uc_flags
)
369 .field("uc_link", &self.uc_link
)
370 .field("uc_stack", &self.uc_stack
)
371 .field("uc_mcontext", &self.uc_mcontext
)
372 .field("uc_sigmask", &self.uc_sigmask
)
373 // Ignore __private field
378 impl ::hash
::Hash
for ucontext_t
{
379 fn hash
<H
: ::hash
::Hasher
>(&self, state
: &mut H
) {
380 self.uc_flags
.hash(state
);
381 self.uc_link
.hash(state
);
382 self.uc_stack
.hash(state
);
383 self.uc_mcontext
.hash(state
);
384 self.uc_sigmask
.hash(state
);
385 // Ignore __private field
391 pub const POSIX_FADV_DONTNEED
: ::c_int
= 4;
392 pub const POSIX_FADV_NOREUSE
: ::c_int
= 5;
394 pub const VEOF
: usize = 4;
395 pub const RTLD_DEEPBIND
: ::c_int
= 0x8;
396 pub const RTLD_GLOBAL
: ::c_int
= 0x100;
397 pub const RTLD_NOLOAD
: ::c_int
= 0x4;
398 pub const TIOCGSOFTCAR
: ::c_ulong
= 0x5419;
399 pub const TIOCSSOFTCAR
: ::c_ulong
= 0x541A;
400 pub const TIOCGRS485
: ::c_int
= 0x542E;
401 pub const TIOCSRS485
: ::c_int
= 0x542F;
403 pub const RLIMIT_RSS
: ::__rlimit_resource_t
= 5;
404 pub const RLIMIT_AS
: ::__rlimit_resource_t
= 9;
405 pub const RLIMIT_MEMLOCK
: ::__rlimit_resource_t
= 8;
406 pub const RLIMIT_NOFILE
: ::__rlimit_resource_t
= 7;
407 pub const RLIMIT_NPROC
: ::__rlimit_resource_t
= 6;
409 pub const O_APPEND
: ::c_int
= 1024;
410 pub const O_CREAT
: ::c_int
= 64;
411 pub const O_EXCL
: ::c_int
= 128;
412 pub const O_NOCTTY
: ::c_int
= 256;
413 pub const O_NONBLOCK
: ::c_int
= 2048;
414 pub const O_SYNC
: ::c_int
= 1052672;
415 pub const O_RSYNC
: ::c_int
= 1052672;
416 pub const O_DSYNC
: ::c_int
= 4096;
417 pub const O_FSYNC
: ::c_int
= 0x101000;
418 pub const O_NOATIME
: ::c_int
= 0o1000000;
419 pub const O_PATH
: ::c_int
= 0o10000000;
420 pub const O_TMPFILE
: ::c_int
= 0o20000000 | O_DIRECTORY
;
422 pub const MADV_SOFT_OFFLINE
: ::c_int
= 101;
423 pub const MAP_GROWSDOWN
: ::c_int
= 0x0100;
425 pub const EDEADLK
: ::c_int
= 35;
426 pub const ENAMETOOLONG
: ::c_int
= 36;
427 pub const ENOLCK
: ::c_int
= 37;
428 pub const ENOSYS
: ::c_int
= 38;
429 pub const ENOTEMPTY
: ::c_int
= 39;
430 pub const ELOOP
: ::c_int
= 40;
431 pub const ENOMSG
: ::c_int
= 42;
432 pub const EIDRM
: ::c_int
= 43;
433 pub const ECHRNG
: ::c_int
= 44;
434 pub const EL2NSYNC
: ::c_int
= 45;
435 pub const EL3HLT
: ::c_int
= 46;
436 pub const EL3RST
: ::c_int
= 47;
437 pub const ELNRNG
: ::c_int
= 48;
438 pub const EUNATCH
: ::c_int
= 49;
439 pub const ENOCSI
: ::c_int
= 50;
440 pub const EL2HLT
: ::c_int
= 51;
441 pub const EBADE
: ::c_int
= 52;
442 pub const EBADR
: ::c_int
= 53;
443 pub const EXFULL
: ::c_int
= 54;
444 pub const ENOANO
: ::c_int
= 55;
445 pub const EBADRQC
: ::c_int
= 56;
446 pub const EBADSLT
: ::c_int
= 57;
447 pub const EMULTIHOP
: ::c_int
= 72;
448 pub const EOVERFLOW
: ::c_int
= 75;
449 pub const ENOTUNIQ
: ::c_int
= 76;
450 pub const EBADFD
: ::c_int
= 77;
451 pub const EBADMSG
: ::c_int
= 74;
452 pub const EREMCHG
: ::c_int
= 78;
453 pub const ELIBACC
: ::c_int
= 79;
454 pub const ELIBBAD
: ::c_int
= 80;
455 pub const ELIBSCN
: ::c_int
= 81;
456 pub const ELIBMAX
: ::c_int
= 82;
457 pub const ELIBEXEC
: ::c_int
= 83;
458 pub const EILSEQ
: ::c_int
= 84;
459 pub const ERESTART
: ::c_int
= 85;
460 pub const ESTRPIPE
: ::c_int
= 86;
461 pub const EUSERS
: ::c_int
= 87;
462 pub const ENOTSOCK
: ::c_int
= 88;
463 pub const EDESTADDRREQ
: ::c_int
= 89;
464 pub const EMSGSIZE
: ::c_int
= 90;
465 pub const EPROTOTYPE
: ::c_int
= 91;
466 pub const ENOPROTOOPT
: ::c_int
= 92;
467 pub const EPROTONOSUPPORT
: ::c_int
= 93;
468 pub const ESOCKTNOSUPPORT
: ::c_int
= 94;
469 pub const EOPNOTSUPP
: ::c_int
= 95;
470 pub const EPFNOSUPPORT
: ::c_int
= 96;
471 pub const EAFNOSUPPORT
: ::c_int
= 97;
472 pub const EADDRINUSE
: ::c_int
= 98;
473 pub const EADDRNOTAVAIL
: ::c_int
= 99;
474 pub const ENETDOWN
: ::c_int
= 100;
475 pub const ENETUNREACH
: ::c_int
= 101;
476 pub const ENETRESET
: ::c_int
= 102;
477 pub const ECONNABORTED
: ::c_int
= 103;
478 pub const ECONNRESET
: ::c_int
= 104;
479 pub const ENOBUFS
: ::c_int
= 105;
480 pub const EISCONN
: ::c_int
= 106;
481 pub const ENOTCONN
: ::c_int
= 107;
482 pub const ESHUTDOWN
: ::c_int
= 108;
483 pub const ETOOMANYREFS
: ::c_int
= 109;
484 pub const ETIMEDOUT
: ::c_int
= 110;
485 pub const ECONNREFUSED
: ::c_int
= 111;
486 pub const EHOSTDOWN
: ::c_int
= 112;
487 pub const EHOSTUNREACH
: ::c_int
= 113;
488 pub const EALREADY
: ::c_int
= 114;
489 pub const EINPROGRESS
: ::c_int
= 115;
490 pub const ESTALE
: ::c_int
= 116;
491 pub const EDQUOT
: ::c_int
= 122;
492 pub const ENOMEDIUM
: ::c_int
= 123;
493 pub const EMEDIUMTYPE
: ::c_int
= 124;
494 pub const ECANCELED
: ::c_int
= 125;
495 pub const ENOKEY
: ::c_int
= 126;
496 pub const EKEYEXPIRED
: ::c_int
= 127;
497 pub const EKEYREVOKED
: ::c_int
= 128;
498 pub const EKEYREJECTED
: ::c_int
= 129;
499 pub const EOWNERDEAD
: ::c_int
= 130;
500 pub const ENOTRECOVERABLE
: ::c_int
= 131;
501 pub const EHWPOISON
: ::c_int
= 133;
502 pub const ERFKILL
: ::c_int
= 132;
504 pub const SOL_SOCKET
: ::c_int
= 1;
506 pub const SO_REUSEADDR
: ::c_int
= 2;
507 pub const SO_TYPE
: ::c_int
= 3;
508 pub const SO_ERROR
: ::c_int
= 4;
509 pub const SO_DONTROUTE
: ::c_int
= 5;
510 pub const SO_BROADCAST
: ::c_int
= 6;
511 pub const SO_SNDBUF
: ::c_int
= 7;
512 pub const SO_RCVBUF
: ::c_int
= 8;
513 pub const SO_SNDBUFFORCE
: ::c_int
= 32;
514 pub const SO_RCVBUFFORCE
: ::c_int
= 33;
515 pub const SO_KEEPALIVE
: ::c_int
= 9;
516 pub const SO_OOBINLINE
: ::c_int
= 10;
517 pub const SO_NO_CHECK
: ::c_int
= 11;
518 pub const SO_PRIORITY
: ::c_int
= 12;
519 pub const SO_LINGER
: ::c_int
= 13;
520 pub const SO_BSDCOMPAT
: ::c_int
= 14;
521 pub const SO_REUSEPORT
: ::c_int
= 15;
522 pub const SO_PASSCRED
: ::c_int
= 16;
523 pub const SO_PEERCRED
: ::c_int
= 17;
524 pub const SO_RCVLOWAT
: ::c_int
= 18;
525 pub const SO_SNDLOWAT
: ::c_int
= 19;
526 pub const SO_RCVTIMEO
: ::c_int
= 20;
527 pub const SO_SNDTIMEO
: ::c_int
= 21;
528 pub const SO_SECURITY_AUTHENTICATION
: ::c_int
= 22;
529 pub const SO_SECURITY_ENCRYPTION_TRANSPORT
: ::c_int
= 23;
530 pub const SO_SECURITY_ENCRYPTION_NETWORK
: ::c_int
= 24;
531 pub const SO_BINDTODEVICE
: ::c_int
= 25;
532 pub const SO_ATTACH_FILTER
: ::c_int
= 26;
533 pub const SO_DETACH_FILTER
: ::c_int
= 27;
534 pub const SO_GET_FILTER
: ::c_int
= SO_ATTACH_FILTER
;
535 pub const SO_PEERNAME
: ::c_int
= 28;
536 pub const SO_TIMESTAMP
: ::c_int
= 29;
537 pub const SO_ACCEPTCONN
: ::c_int
= 30;
538 pub const SO_PEERSEC
: ::c_int
= 31;
539 pub const SO_PASSSEC
: ::c_int
= 34;
540 pub const SO_TIMESTAMPNS
: ::c_int
= 35;
541 pub const SCM_TIMESTAMPNS
: ::c_int
= SO_TIMESTAMPNS
;
542 pub const SO_MARK
: ::c_int
= 36;
543 pub const SO_PROTOCOL
: ::c_int
= 38;
544 pub const SO_DOMAIN
: ::c_int
= 39;
545 pub const SO_RXQ_OVFL
: ::c_int
= 40;
546 pub const SO_WIFI_STATUS
: ::c_int
= 41;
547 pub const SCM_WIFI_STATUS
: ::c_int
= SO_WIFI_STATUS
;
548 pub const SO_PEEK_OFF
: ::c_int
= 42;
549 pub const SO_NOFCS
: ::c_int
= 43;
550 pub const SO_LOCK_FILTER
: ::c_int
= 44;
551 pub const SO_SELECT_ERR_QUEUE
: ::c_int
= 45;
552 pub const SO_BUSY_POLL
: ::c_int
= 46;
553 pub const SO_MAX_PACING_RATE
: ::c_int
= 47;
554 pub const SO_BPF_EXTENSIONS
: ::c_int
= 48;
555 pub const SO_INCOMING_CPU
: ::c_int
= 49;
556 pub const SO_ATTACH_BPF
: ::c_int
= 50;
557 pub const SO_DETACH_BPF
: ::c_int
= SO_DETACH_FILTER
;
559 pub const SOCK_STREAM
: ::c_int
= 1;
560 pub const SOCK_DGRAM
: ::c_int
= 2;
562 pub const SA_ONSTACK
: ::c_int
= 0x08000000;
563 pub const SA_SIGINFO
: ::c_int
= 0x00000004;
564 pub const SA_NOCLDWAIT
: ::c_int
= 0x00000002;
566 pub const SIGTTIN
: ::c_int
= 21;
567 pub const SIGTTOU
: ::c_int
= 22;
568 pub const SIGXCPU
: ::c_int
= 24;
569 pub const SIGXFSZ
: ::c_int
= 25;
570 pub const SIGVTALRM
: ::c_int
= 26;
571 pub const SIGPROF
: ::c_int
= 27;
572 pub const SIGWINCH
: ::c_int
= 28;
573 pub const SIGCHLD
: ::c_int
= 17;
574 pub const SIGBUS
: ::c_int
= 7;
575 pub const SIGUSR1
: ::c_int
= 10;
576 pub const SIGUSR2
: ::c_int
= 12;
577 pub const SIGCONT
: ::c_int
= 18;
578 pub const SIGSTOP
: ::c_int
= 19;
579 pub const SIGTSTP
: ::c_int
= 20;
580 pub const SIGURG
: ::c_int
= 23;
581 pub const SIGIO
: ::c_int
= 29;
582 pub const SIGSYS
: ::c_int
= 31;
583 pub const SIGSTKFLT
: ::c_int
= 16;
586 note
= "Use SIGSYS instead"
588 pub const SIGUNUSED
: ::c_int
= 31;
589 pub const SIGPOLL
: ::c_int
= 29;
590 pub const SIGPWR
: ::c_int
= 30;
591 pub const SIG_SETMASK
: ::c_int
= 2;
592 pub const SIG_BLOCK
: ::c_int
= 0x000000;
593 pub const SIG_UNBLOCK
: ::c_int
= 0x01;
595 pub const POLLWRNORM
: ::c_short
= 0x100;
596 pub const POLLWRBAND
: ::c_short
= 0x200;
598 pub const O_ASYNC
: ::c_int
= 0x2000;
599 pub const O_NDELAY
: ::c_int
= 0x800;
601 pub const PTRACE_DETACH
: ::c_uint
= 17;
603 pub const EFD_NONBLOCK
: ::c_int
= 0x800;
605 pub const F_GETLK
: ::c_int
= 5;
606 pub const F_GETOWN
: ::c_int
= 9;
607 pub const F_SETOWN
: ::c_int
= 8;
608 pub const F_SETLK
: ::c_int
= 6;
609 pub const F_SETLKW
: ::c_int
= 7;
611 pub const F_RDLCK
: ::c_int
= 0;
612 pub const F_WRLCK
: ::c_int
= 1;
613 pub const F_UNLCK
: ::c_int
= 2;
615 pub const SFD_NONBLOCK
: ::c_int
= 0x0800;
617 pub const TCSANOW
: ::c_int
= 0;
618 pub const TCSADRAIN
: ::c_int
= 1;
619 pub const TCSAFLUSH
: ::c_int
= 2;
621 pub const TIOCLINUX
: ::c_ulong
= 0x541C;
622 pub const TIOCGSERIAL
: ::c_ulong
= 0x541E;
623 pub const TIOCEXCL
: ::c_ulong
= 0x540C;
624 pub const TIOCNXCL
: ::c_ulong
= 0x540D;
625 pub const TIOCSCTTY
: ::c_ulong
= 0x540E;
626 pub const TIOCSTI
: ::c_ulong
= 0x5412;
627 pub const TIOCMGET
: ::c_ulong
= 0x5415;
628 pub const TIOCMBIS
: ::c_ulong
= 0x5416;
629 pub const TIOCMBIC
: ::c_ulong
= 0x5417;
630 pub const TIOCMSET
: ::c_ulong
= 0x5418;
631 pub const TIOCCONS
: ::c_ulong
= 0x541D;
633 pub const TIOCM_ST
: ::c_int
= 0x008;
634 pub const TIOCM_SR
: ::c_int
= 0x010;
635 pub const TIOCM_CTS
: ::c_int
= 0x020;
636 pub const TIOCM_CAR
: ::c_int
= 0x040;
637 pub const TIOCM_RNG
: ::c_int
= 0x080;
638 pub const TIOCM_DSR
: ::c_int
= 0x100;
640 pub const SFD_CLOEXEC
: ::c_int
= 0x080000;
642 pub const NCCS
: usize = 32;
644 pub const O_TRUNC
: ::c_int
= 512;
646 pub const O_CLOEXEC
: ::c_int
= 0x80000;
648 pub const EBFONT
: ::c_int
= 59;
649 pub const ENOSTR
: ::c_int
= 60;
650 pub const ENODATA
: ::c_int
= 61;
651 pub const ETIME
: ::c_int
= 62;
652 pub const ENOSR
: ::c_int
= 63;
653 pub const ENONET
: ::c_int
= 64;
654 pub const ENOPKG
: ::c_int
= 65;
655 pub const EREMOTE
: ::c_int
= 66;
656 pub const ENOLINK
: ::c_int
= 67;
657 pub const EADV
: ::c_int
= 68;
658 pub const ESRMNT
: ::c_int
= 69;
659 pub const ECOMM
: ::c_int
= 70;
660 pub const EPROTO
: ::c_int
= 71;
661 pub const EDOTDOT
: ::c_int
= 73;
663 pub const SA_NODEFER
: ::c_int
= 0x40000000;
664 pub const SA_RESETHAND
: ::c_int
= 0x80000000;
665 pub const SA_RESTART
: ::c_int
= 0x10000000;
666 pub const SA_NOCLDSTOP
: ::c_int
= 0x00000001;
668 pub const EPOLL_CLOEXEC
: ::c_int
= 0x80000;
670 pub const EFD_CLOEXEC
: ::c_int
= 0x80000;
672 pub const __SIZEOF_PTHREAD_CONDATTR_T
: usize = 4;
673 pub const __SIZEOF_PTHREAD_MUTEXATTR_T
: usize = 4;
675 pub const O_DIRECT
: ::c_int
= 0x4000;
676 pub const O_DIRECTORY
: ::c_int
= 0x10000;
677 pub const O_NOFOLLOW
: ::c_int
= 0x20000;
679 pub const MAP_HUGETLB
: ::c_int
= 0x040000;
680 pub const MAP_LOCKED
: ::c_int
= 0x02000;
681 pub const MAP_NORESERVE
: ::c_int
= 0x04000;
682 pub const MAP_32BIT
: ::c_int
= 0x0040;
683 pub const MAP_ANON
: ::c_int
= 0x0020;
684 pub const MAP_ANONYMOUS
: ::c_int
= 0x0020;
685 pub const MAP_DENYWRITE
: ::c_int
= 0x0800;
686 pub const MAP_EXECUTABLE
: ::c_int
= 0x01000;
687 pub const MAP_POPULATE
: ::c_int
= 0x08000;
688 pub const MAP_NONBLOCK
: ::c_int
= 0x010000;
689 pub const MAP_STACK
: ::c_int
= 0x020000;
691 pub const EDEADLOCK
: ::c_int
= 35;
692 pub const EUCLEAN
: ::c_int
= 117;
693 pub const ENOTNAM
: ::c_int
= 118;
694 pub const ENAVAIL
: ::c_int
= 119;
695 pub const EISNAM
: ::c_int
= 120;
696 pub const EREMOTEIO
: ::c_int
= 121;
698 pub const FIOCLEX
: ::c_ulong
= 0x5451;
699 pub const FIONCLEX
: ::c_ulong
= 0x5450;
700 pub const FIONBIO
: ::c_ulong
= 0x5421;
702 pub const PTRACE_GETFPREGS
: ::c_uint
= 14;
703 pub const PTRACE_SETFPREGS
: ::c_uint
= 15;
704 pub const PTRACE_GETFPXREGS
: ::c_uint
= 18;
705 pub const PTRACE_SETFPXREGS
: ::c_uint
= 19;
706 pub const PTRACE_GETREGS
: ::c_uint
= 12;
707 pub const PTRACE_SETREGS
: ::c_uint
= 13;
708 pub const PTRACE_PEEKSIGINFO_SHARED
: ::c_uint
= 1;
710 pub const MCL_CURRENT
: ::c_int
= 0x0001;
711 pub const MCL_FUTURE
: ::c_int
= 0x0002;
713 pub const SIGSTKSZ
: ::size_t
= 8192;
714 pub const MINSIGSTKSZ
: ::size_t
= 2048;
715 pub const CBAUD
: ::tcflag_t
= 0o0010017;
716 pub const TAB1
: ::tcflag_t
= 0x00000800;
717 pub const TAB2
: ::tcflag_t
= 0x00001000;
718 pub const TAB3
: ::tcflag_t
= 0x00001800;
719 pub const CR1
: ::tcflag_t
= 0x00000200;
720 pub const CR2
: ::tcflag_t
= 0x00000400;
721 pub const CR3
: ::tcflag_t
= 0x00000600;
722 pub const FF1
: ::tcflag_t
= 0x00008000;
723 pub const BS1
: ::tcflag_t
= 0x00002000;
724 pub const VT1
: ::tcflag_t
= 0x00004000;
725 pub const VWERASE
: usize = 14;
726 pub const VREPRINT
: usize = 12;
727 pub const VSUSP
: usize = 10;
728 pub const VSTART
: usize = 8;
729 pub const VSTOP
: usize = 9;
730 pub const VDISCARD
: usize = 13;
731 pub const VTIME
: usize = 5;
732 pub const IXON
: ::tcflag_t
= 0x00000400;
733 pub const IXOFF
: ::tcflag_t
= 0x00001000;
734 pub const ONLCR
: ::tcflag_t
= 0x4;
735 pub const CSIZE
: ::tcflag_t
= 0x00000030;
736 pub const CS6
: ::tcflag_t
= 0x00000010;
737 pub const CS7
: ::tcflag_t
= 0x00000020;
738 pub const CS8
: ::tcflag_t
= 0x00000030;
739 pub const CSTOPB
: ::tcflag_t
= 0x00000040;
740 pub const CREAD
: ::tcflag_t
= 0x00000080;
741 pub const PARENB
: ::tcflag_t
= 0x00000100;
742 pub const PARODD
: ::tcflag_t
= 0x00000200;
743 pub const HUPCL
: ::tcflag_t
= 0x00000400;
744 pub const CLOCAL
: ::tcflag_t
= 0x00000800;
745 pub const ECHOKE
: ::tcflag_t
= 0x00000800;
746 pub const ECHOE
: ::tcflag_t
= 0x00000010;
747 pub const ECHOK
: ::tcflag_t
= 0x00000020;
748 pub const ECHONL
: ::tcflag_t
= 0x00000040;
749 pub const ECHOPRT
: ::tcflag_t
= 0x00000400;
750 pub const ECHOCTL
: ::tcflag_t
= 0x00000200;
751 pub const ISIG
: ::tcflag_t
= 0x00000001;
752 pub const ICANON
: ::tcflag_t
= 0x00000002;
753 pub const PENDIN
: ::tcflag_t
= 0x00004000;
754 pub const NOFLSH
: ::tcflag_t
= 0x00000080;
755 pub const CIBAUD
: ::tcflag_t
= 0o02003600000;
756 pub const CBAUDEX
: ::tcflag_t
= 0o010000;
757 pub const VSWTC
: usize = 7;
758 pub const OLCUC
: ::tcflag_t
= 0o000002;
759 pub const NLDLY
: ::tcflag_t
= 0o000400;
760 pub const CRDLY
: ::tcflag_t
= 0o003000;
761 pub const TABDLY
: ::tcflag_t
= 0o014000;
762 pub const BSDLY
: ::tcflag_t
= 0o020000;
763 pub const FFDLY
: ::tcflag_t
= 0o100000;
764 pub const VTDLY
: ::tcflag_t
= 0o040000;
765 pub const XTABS
: ::tcflag_t
= 0o014000;
767 pub const B0
: ::speed_t
= 0o000000;
768 pub const B50
: ::speed_t
= 0o000001;
769 pub const B75
: ::speed_t
= 0o000002;
770 pub const B110
: ::speed_t
= 0o000003;
771 pub const B134
: ::speed_t
= 0o000004;
772 pub const B150
: ::speed_t
= 0o000005;
773 pub const B200
: ::speed_t
= 0o000006;
774 pub const B300
: ::speed_t
= 0o000007;
775 pub const B600
: ::speed_t
= 0o000010;
776 pub const B1200
: ::speed_t
= 0o000011;
777 pub const B1800
: ::speed_t
= 0o000012;
778 pub const B2400
: ::speed_t
= 0o000013;
779 pub const B4800
: ::speed_t
= 0o000014;
780 pub const B9600
: ::speed_t
= 0o000015;
781 pub const B19200
: ::speed_t
= 0o000016;
782 pub const B38400
: ::speed_t
= 0o000017;
783 pub const EXTA
: ::speed_t
= B19200
;
784 pub const EXTB
: ::speed_t
= B38400
;
785 pub const BOTHER
: ::speed_t
= 0o010000;
786 pub const B57600
: ::speed_t
= 0o010001;
787 pub const B115200
: ::speed_t
= 0o010002;
788 pub const B230400
: ::speed_t
= 0o010003;
789 pub const B460800
: ::speed_t
= 0o010004;
790 pub const B500000
: ::speed_t
= 0o010005;
791 pub const B576000
: ::speed_t
= 0o010006;
792 pub const B921600
: ::speed_t
= 0o010007;
793 pub const B1000000
: ::speed_t
= 0o010010;
794 pub const B1152000
: ::speed_t
= 0o010011;
795 pub const B1500000
: ::speed_t
= 0o010012;
796 pub const B2000000
: ::speed_t
= 0o010013;
797 pub const B2500000
: ::speed_t
= 0o010014;
798 pub const B3000000
: ::speed_t
= 0o010015;
799 pub const B3500000
: ::speed_t
= 0o010016;
800 pub const B4000000
: ::speed_t
= 0o010017;
802 pub const VEOL
: usize = 11;
803 pub const VEOL2
: usize = 16;
804 pub const VMIN
: usize = 6;
805 pub const IEXTEN
: ::tcflag_t
= 0x00008000;
806 pub const TOSTOP
: ::tcflag_t
= 0x00000100;
807 pub const FLUSHO
: ::tcflag_t
= 0x00001000;
808 pub const EXTPROC
: ::tcflag_t
= 0x00010000;
809 pub const TCGETS
: ::c_ulong
= 0x5401;
810 pub const TCSETS
: ::c_ulong
= 0x5402;
811 pub const TCSETSW
: ::c_ulong
= 0x5403;
812 pub const TCSETSF
: ::c_ulong
= 0x5404;
813 pub const TCGETA
: ::c_ulong
= 0x5405;
814 pub const TCSETA
: ::c_ulong
= 0x5406;
815 pub const TCSETAW
: ::c_ulong
= 0x5407;
816 pub const TCSETAF
: ::c_ulong
= 0x5408;
817 pub const TCSBRK
: ::c_ulong
= 0x5409;
818 pub const TCXONC
: ::c_ulong
= 0x540A;
819 pub const TCFLSH
: ::c_ulong
= 0x540B;
820 pub const TIOCINQ
: ::c_ulong
= 0x541B;
821 pub const TIOCGPGRP
: ::c_ulong
= 0x540F;
822 pub const TIOCSPGRP
: ::c_ulong
= 0x5410;
823 pub const TIOCOUTQ
: ::c_ulong
= 0x5411;
824 pub const TIOCGWINSZ
: ::c_ulong
= 0x5413;
825 pub const TIOCSWINSZ
: ::c_ulong
= 0x5414;
826 pub const FIONREAD
: ::c_ulong
= 0x541B;
828 // offsets in user_regs_structs, from sys/reg.h
829 pub const R15
: ::c_int
= 0;
830 pub const R14
: ::c_int
= 1;
831 pub const R13
: ::c_int
= 2;
832 pub const R12
: ::c_int
= 3;
833 pub const RBP
: ::c_int
= 4;
834 pub const RBX
: ::c_int
= 5;
835 pub const R11
: ::c_int
= 6;
836 pub const R10
: ::c_int
= 7;
837 pub const R9
: ::c_int
= 8;
838 pub const R8
: ::c_int
= 9;
839 pub const RAX
: ::c_int
= 10;
840 pub const RCX
: ::c_int
= 11;
841 pub const RDX
: ::c_int
= 12;
842 pub const RSI
: ::c_int
= 13;
843 pub const RDI
: ::c_int
= 14;
844 pub const ORIG_RAX
: ::c_int
= 15;
845 pub const RIP
: ::c_int
= 16;
846 pub const CS
: ::c_int
= 17;
847 pub const EFLAGS
: ::c_int
= 18;
848 pub const RSP
: ::c_int
= 19;
849 pub const SS
: ::c_int
= 20;
850 pub const FS_BASE
: ::c_int
= 21;
851 pub const GS_BASE
: ::c_int
= 22;
852 pub const DS
: ::c_int
= 23;
853 pub const ES
: ::c_int
= 24;
854 pub const FS
: ::c_int
= 25;
855 pub const GS
: ::c_int
= 26;
857 // offsets in mcontext_t.gregs from sys/ucontext.h
858 pub const REG_R8
: ::c_int
= 0;
859 pub const REG_R9
: ::c_int
= 1;
860 pub const REG_R10
: ::c_int
= 2;
861 pub const REG_R11
: ::c_int
= 3;
862 pub const REG_R12
: ::c_int
= 4;
863 pub const REG_R13
: ::c_int
= 5;
864 pub const REG_R14
: ::c_int
= 6;
865 pub const REG_R15
: ::c_int
= 7;
866 pub const REG_RDI
: ::c_int
= 8;
867 pub const REG_RSI
: ::c_int
= 9;
868 pub const REG_RBP
: ::c_int
= 10;
869 pub const REG_RBX
: ::c_int
= 11;
870 pub const REG_RDX
: ::c_int
= 12;
871 pub const REG_RAX
: ::c_int
= 13;
872 pub const REG_RCX
: ::c_int
= 14;
873 pub const REG_RSP
: ::c_int
= 15;
874 pub const REG_RIP
: ::c_int
= 16;
875 pub const REG_EFL
: ::c_int
= 17;
876 pub const REG_CSGSFS
: ::c_int
= 18;
877 pub const REG_ERR
: ::c_int
= 19;
878 pub const REG_TRAPNO
: ::c_int
= 20;
879 pub const REG_OLDMASK
: ::c_int
= 21;
880 pub const REG_CR2
: ::c_int
= 22;
883 pub fn getcontext(ucp
: *mut ucontext_t
) -> ::c_int
;
884 pub fn setcontext(ucp
: *const ucontext_t
) -> ::c_int
;
885 pub fn makecontext(ucp
: *mut ucontext_t
,
888 pub fn swapcontext(uocp
: *mut ucontext_t
,
889 ucp
: *const ucontext_t
) -> ::c_int
;
890 pub fn iopl(level
: ::c_int
) -> ::c_int
;
891 pub fn ioperm(from
: ::c_ulong
, num
: ::c_ulong
,
892 turn_on
: ::c_int
) -> ::c_int
;
896 if #[cfg(target_pointer_width = "32")] {
898 pub use self::x32
::*;
901 pub use self::not_x32
::*;