1 //! 32-bit specific definitions for linux-like values
6 pub type c_ulong
= u32;
7 pub type clock_t
= i32;
9 pub type suseconds_t
= i32;
12 pub type blkcnt_t
= i32;
14 pub type fsblkcnt_t
= ::c_ulong
;
15 pub type fsfilcnt_t
= ::c_ulong
;
16 pub type rlim_t
= c_ulong
;
17 pub type shmatt_t
= ::c_ulong
;
18 pub type msgqnum_t
= ::c_ulong
;
19 pub type msglen_t
= ::c_ulong
;
20 pub type blksize_t
= i32;
21 pub type nlink_t
= u32;
22 pub type __u64
= ::c_ulonglong
;
23 pub type __fsword_t
= i32;
27 #[cfg(not(target_arch = "mips"))]
29 #[cfg(target_arch = "mips")]
30 pub st_dev
: ::c_ulong
,
32 #[cfg(not(target_arch = "mips"))]
34 #[cfg(target_arch = "mips")]
35 st_pad1
: [::c_long
; 3],
37 pub st_mode
: ::mode_t
,
38 pub st_nlink
: ::nlink_t
,
41 #[cfg(not(target_arch = "mips"))]
43 #[cfg(target_arch = "mips")]
44 pub st_rdev
: ::c_ulong
,
45 #[cfg(not(target_arch = "mips"))]
47 #[cfg(target_arch = "mips")]
48 st_pad2
: [::c_long
; 2],
50 #[cfg(target_arch = "mips")]
52 #[cfg(not(target_arch = "mips"))]
53 pub st_blksize
: ::blksize_t
,
54 #[cfg(not(target_arch = "mips"))]
55 pub st_blocks
: ::blkcnt_t
,
56 pub st_atime
: ::time_t
,
57 pub st_atime_nsec
: ::c_long
,
58 pub st_mtime
: ::time_t
,
59 pub st_mtime_nsec
: ::c_long
,
60 pub st_ctime
: ::time_t
,
61 pub st_ctime_nsec
: ::c_long
,
62 #[cfg(not(target_arch = "mips"))]
64 #[cfg(not(target_arch = "mips"))]
66 #[cfg(target_arch = "mips")]
67 pub st_blksize
: ::blksize_t
,
68 #[cfg(target_arch = "mips")]
69 pub st_blocks
: ::blkcnt_t
,
70 #[cfg(target_arch = "mips")]
71 st_pad5
: [::c_long
; 14],
75 pub f_bsize
: ::c_ulong
,
76 pub f_frsize
: ::c_ulong
,
77 pub f_blocks
: ::fsblkcnt_t
,
78 pub f_bfree
: ::fsblkcnt_t
,
79 pub f_bavail
: ::fsblkcnt_t
,
80 pub f_files
: ::fsfilcnt_t
,
81 pub f_ffree
: ::fsfilcnt_t
,
82 pub f_favail
: ::fsfilcnt_t
,
83 pub f_fsid
: ::c_ulong
,
85 pub f_flag
: ::c_ulong
,
86 pub f_namemax
: ::c_ulong
,
87 __f_spare
: [::c_int
; 6],
90 pub struct pthread_attr_t
{
95 __val
: [::c_ulong
; 32],
100 pub loads
: [::c_ulong
; 3],
101 pub totalram
: ::c_ulong
,
102 pub freeram
: ::c_ulong
,
103 pub sharedram
: ::c_ulong
,
104 pub bufferram
: ::c_ulong
,
105 pub totalswap
: ::c_ulong
,
106 pub freeswap
: ::c_ulong
,
107 pub procs
: ::c_ushort
,
110 note
= "This padding field might become private in the future"
113 pub totalhigh
: ::c_ulong
,
114 pub freehigh
: ::c_ulong
,
115 pub mem_unit
: ::c_uint
,
116 pub _f
: [::c_char
; 8],
120 pub const O_NOATIME
: ::c_int
= 0o1000000;
121 pub const O_PATH
: ::c_int
= 0o10000000;
122 pub const O_TMPFILE
: ::c_int
= 0o20000000 | O_DIRECTORY
;
124 pub const SO_PRIORITY
: ::c_int
= 12;
125 pub const SO_BSDCOMPAT
: ::c_int
= 14;
126 pub const SO_BINDTODEVICE
: ::c_int
= 25;
127 pub const SO_TIMESTAMP
: ::c_int
= 29;
128 pub const SO_MARK
: ::c_int
= 36;
129 pub const SO_RXQ_OVFL
: ::c_int
= 40;
130 pub const SO_PEEK_OFF
: ::c_int
= 42;
131 pub const SO_BUSY_POLL
: ::c_int
= 46;
133 pub const SA_ONSTACK
: ::c_int
= 0x08000000;
135 pub const PTRACE_DETACH
: ::c_uint
= 17;
136 pub const POSIX_FADV_DONTNEED
: ::c_int
= 4;
137 pub const POSIX_FADV_NOREUSE
: ::c_int
= 5;
139 pub const F_SETLK
: ::c_int
= 6;
140 pub const F_SETLKW
: ::c_int
= 7;
142 pub const F_RDLCK
: ::c_int
= 0;
143 pub const F_WRLCK
: ::c_int
= 1;
144 pub const F_UNLCK
: ::c_int
= 2;
146 pub const SFD_CLOEXEC
: ::c_int
= 0x080000;
148 pub const NCCS
: usize = 32;
150 pub const O_TRUNC
: ::c_int
= 512;
152 pub const O_CLOEXEC
: ::c_int
= 0x80000;
154 pub const EBFONT
: ::c_int
= 59;
155 pub const ENOSTR
: ::c_int
= 60;
156 pub const ENODATA
: ::c_int
= 61;
157 pub const ETIME
: ::c_int
= 62;
158 pub const ENOSR
: ::c_int
= 63;
159 pub const ENONET
: ::c_int
= 64;
160 pub const ENOPKG
: ::c_int
= 65;
161 pub const EREMOTE
: ::c_int
= 66;
162 pub const ENOLINK
: ::c_int
= 67;
163 pub const EADV
: ::c_int
= 68;
164 pub const ESRMNT
: ::c_int
= 69;
165 pub const ECOMM
: ::c_int
= 70;
166 pub const EPROTO
: ::c_int
= 71;
167 pub const EDOTDOT
: ::c_int
= 73;
169 pub const SA_NODEFER
: ::c_int
= 0x40000000;
170 pub const SA_RESETHAND
: ::c_int
= 0x80000000;
171 pub const SA_RESTART
: ::c_int
= 0x10000000;
172 pub const SA_NOCLDSTOP
: ::c_int
= 0x00000001;
174 pub const EPOLL_CLOEXEC
: ::c_int
= 0x80000;
176 pub const EFD_CLOEXEC
: ::c_int
= 0x80000;
178 pub const __SIZEOF_PTHREAD_CONDATTR_T
: usize = 4;
179 pub const __SIZEOF_PTHREAD_MUTEX_T
: usize = 24;
180 pub const __SIZEOF_PTHREAD_RWLOCK_T
: usize = 32;
181 pub const __SIZEOF_PTHREAD_MUTEXATTR_T
: usize = 4;
182 pub const __SIZEOF_PTHREAD_RWLOCKATTR_T
: usize = 8;
185 #[cfg(target_endian = "little")]
186 pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
: ::pthread_mutex_t
=
189 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
193 #[cfg(target_endian = "little")]
194 pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
: ::pthread_mutex_t
=
197 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
201 #[cfg(target_endian = "little")]
202 pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
: ::pthread_mutex_t
=
205 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
209 #[cfg(target_endian = "big")]
210 pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
: ::pthread_mutex_t
=
213 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
217 #[cfg(target_endian = "big")]
218 pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
: ::pthread_mutex_t
=
221 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
225 #[cfg(target_endian = "big")]
226 pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
: ::pthread_mutex_t
=
229 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
235 pub const PTRACE_GETFPREGS
: ::c_uint
= 14;
236 pub const PTRACE_SETFPREGS
: ::c_uint
= 15;
237 pub const PTRACE_GETREGS
: ::c_uint
= 12;
238 pub const PTRACE_SETREGS
: ::c_uint
= 13;
240 #[link(name = "util")]
242 pub fn sysctl(name
: *mut ::c_int
,
245 oldlenp
: *mut ::size_t
,
252 if #[cfg(target_arch = "x86")] {
254 pub use self::x86
::*;
255 } else if #[cfg(target_arch = "arm")] {
257 pub use self::arm
::*;
258 } else if #[cfg(target_arch = "mips")] {
260 pub use self::mips
::*;
261 } else if #[cfg(target_arch = "powerpc")] {
263 pub use self::powerpc
::*;
265 // Unknown target_arch