3 pub type c_ulong
= u32;
4 pub type clock_t
= i32;
6 pub type suseconds_t
= i32;
7 pub type wchar_t
= i32;
10 pub type blkcnt_t
= i32;
11 pub type blksize_t
= i32;
12 pub type nlink_t
= u32;
13 pub type fsblkcnt_t
= ::c_ulong
;
14 pub type fsfilcnt_t
= ::c_ulong
;
15 pub type rlim_t
= c_ulong
;
19 pub aio_fildes
: ::c_int
,
20 pub aio_lio_opcode
: ::c_int
,
21 pub aio_reqprio
: ::c_int
,
22 pub aio_buf
: *mut ::c_void
,
23 pub aio_nbytes
: ::size_t
,
24 pub aio_sigevent
: ::sigevent
,
25 __next_prio
: *mut aiocb
,
28 __error_code
: ::c_int
,
29 __return_value
: ::ssize_t
,
30 pub aio_offset
: off_t
,
31 __unused1
: [::c_char
; 4],
32 __glibc_reserved
: [::c_char
; 32]
36 pub st_dev
: ::c_ulong
,
37 st_pad1
: [::c_long
; 3],
39 pub st_mode
: ::mode_t
,
40 pub st_nlink
: ::nlink_t
,
43 pub st_rdev
: ::c_ulong
,
44 pub st_pad2
: [::c_long
; 2],
47 pub st_atime
: ::time_t
,
48 pub st_atime_nsec
: ::c_long
,
49 pub st_mtime
: ::time_t
,
50 pub st_mtime_nsec
: ::c_long
,
51 pub st_ctime
: ::time_t
,
52 pub st_ctime_nsec
: ::c_long
,
53 pub st_blksize
: ::blksize_t
,
54 pub st_blocks
: ::blkcnt_t
,
55 st_pad5
: [::c_long
; 14],
59 pub st_dev
: ::c_ulong
,
60 st_pad1
: [::c_long
; 3],
61 pub st_ino
: ::ino64_t
,
62 pub st_mode
: ::mode_t
,
63 pub st_nlink
: ::nlink_t
,
66 pub st_rdev
: ::c_ulong
,
67 st_pad2
: [::c_long
; 2],
68 pub st_size
: ::off64_t
,
69 pub st_atime
: ::time_t
,
70 pub st_atime_nsec
: ::c_long
,
71 pub st_mtime
: ::time_t
,
72 pub st_mtime_nsec
: ::c_long
,
73 pub st_ctime
: ::time_t
,
74 pub st_ctime_nsec
: ::c_long
,
75 pub st_blksize
: ::blksize_t
,
77 pub st_blocks
: ::blkcnt64_t
,
78 st_pad5
: [::c_long
; 14],
81 pub struct pthread_attr_t
{
85 pub struct sigaction
{
86 pub sa_flags
: ::c_int
,
87 pub sa_sigaction
: ::sighandler_t
,
88 pub sa_mask
: sigset_t
,
89 pub sa_restorer
: ::dox
::Option
<extern fn()>,
94 pub ss_sp
: *mut ::c_void
,
95 pub ss_size
: ::size_t
,
96 pub ss_flags
: ::c_int
,
100 __val
: [::c_ulong
; 32],
103 pub struct siginfo_t
{
104 pub si_signo
: ::c_int
,
105 pub si_code
: ::c_int
,
106 pub si_errno
: ::c_int
,
107 pub _pad
: [::c_int
; 29],
110 pub struct glob64_t
{
111 pub gl_pathc
: ::size_t
,
112 pub gl_pathv
: *mut *mut ::c_char
,
113 pub gl_offs
: ::size_t
,
114 pub gl_flags
: ::c_int
,
116 __unused1
: *mut ::c_void
,
117 __unused2
: *mut ::c_void
,
118 __unused3
: *mut ::c_void
,
119 __unused4
: *mut ::c_void
,
120 __unused5
: *mut ::c_void
,
123 pub struct ipc_perm
{
130 pub __seq
: ::c_ushort
,
132 __unused1
: ::c_ulong
,
136 pub struct shmid_ds
{
137 pub shm_perm
: ::ipc_perm
,
138 pub shm_segsz
: ::size_t
,
139 pub shm_atime
: ::time_t
,
140 pub shm_dtime
: ::time_t
,
141 pub shm_ctime
: ::time_t
,
142 pub shm_cpid
: ::pid_t
,
143 pub shm_lpid
: ::pid_t
,
144 pub shm_nattch
: ::shmatt_t
,
145 __unused4
: ::c_ulong
,
149 pub struct msqid_ds
{
150 pub msg_perm
: ::ipc_perm
,
151 #[cfg(target_endian = "big")]
152 __glibc_reserved1
: ::c_ulong
,
153 pub msg_stime
: ::time_t
,
154 #[cfg(target_endian = "little")]
155 __glibc_reserved1
: ::c_ulong
,
156 #[cfg(target_endian = "big")]
157 __glibc_reserved2
: ::c_ulong
,
158 pub msg_rtime
: ::time_t
,
159 #[cfg(target_endian = "little")]
160 __glibc_reserved2
: ::c_ulong
,
161 #[cfg(target_endian = "big")]
162 __glibc_reserved3
: ::c_ulong
,
163 pub msg_ctime
: ::time_t
,
164 #[cfg(target_endian = "little")]
165 __glibc_reserved3
: ::c_ulong
,
166 __msg_cbytes
: ::c_ulong
,
167 pub msg_qnum
: ::msgqnum_t
,
168 pub msg_qbytes
: ::msglen_t
,
169 pub msg_lspid
: ::pid_t
,
170 pub msg_lrpid
: ::pid_t
,
171 __glibc_reserved4
: ::c_ulong
,
172 __glibc_reserved5
: ::c_ulong
,
176 pub f_type
: ::c_long
,
177 pub f_bsize
: ::c_long
,
178 pub f_frsize
: ::c_long
,
179 pub f_blocks
: ::fsblkcnt_t
,
180 pub f_bfree
: ::fsblkcnt_t
,
181 pub f_files
: ::fsblkcnt_t
,
182 pub f_ffree
: ::fsblkcnt_t
,
183 pub f_bavail
: ::fsblkcnt_t
,
184 pub f_fsid
: ::fsid_t
,
186 pub f_namelen
: ::c_long
,
187 f_spare
: [::c_long
; 6],
191 pub msg_name
: *mut ::c_void
,
192 pub msg_namelen
: ::socklen_t
,
193 pub msg_iov
: *mut ::iovec
,
194 pub msg_iovlen
: ::size_t
,
195 pub msg_control
: *mut ::c_void
,
196 pub msg_controllen
: ::size_t
,
197 pub msg_flags
: ::c_int
,
201 pub cmsg_len
: ::size_t
,
202 pub cmsg_level
: ::c_int
,
203 pub cmsg_type
: ::c_int
,
207 pub c_iflag
: ::tcflag_t
,
208 pub c_oflag
: ::tcflag_t
,
209 pub c_cflag
: ::tcflag_t
,
210 pub c_lflag
: ::tcflag_t
,
212 pub c_cc
: [::cc_t
; ::NCCS
],
216 pub l_type
: ::c_short
,
217 pub l_whence
: ::c_short
,
218 pub l_start
: ::off_t
,
220 pub l_sysid
: ::c_long
,
226 pub uptime
: ::c_long
,
227 pub loads
: [::c_ulong
; 3],
228 pub totalram
: ::c_ulong
,
229 pub freeram
: ::c_ulong
,
230 pub sharedram
: ::c_ulong
,
231 pub bufferram
: ::c_ulong
,
232 pub totalswap
: ::c_ulong
,
233 pub freeswap
: ::c_ulong
,
234 pub procs
: ::c_ushort
,
236 pub totalhigh
: ::c_ulong
,
237 pub freehigh
: ::c_ulong
,
238 pub mem_unit
: ::c_uint
,
239 pub _f
: [::c_char
; 8],
242 // FIXME this is actually a union
244 #[cfg(target_pointer_width = "32")]
245 __size
: [::c_char
; 16],
246 #[cfg(target_pointer_width = "64")]
247 __size
: [::c_char
; 32],
248 __align
: [::c_long
; 0],
252 pub const __SIZEOF_PTHREAD_CONDATTR_T
: usize = 4;
253 pub const __SIZEOF_PTHREAD_MUTEX_T
: usize = 24;
254 pub const __SIZEOF_PTHREAD_RWLOCK_T
: usize = 32;
255 pub const __SIZEOF_PTHREAD_MUTEXATTR_T
: usize = 4;
257 pub const RLIM_INFINITY
: ::rlim_t
= 0x7fffffff;
259 pub const SYS_gettid
: ::c_long
= 4222; // Valid for O32
261 #[link(name = "util")]
263 pub fn sysctl(name
: *mut ::c_int
,
266 oldlenp
: *mut ::size_t
,
270 pub fn ioctl(fd
: ::c_int
, request
: ::c_ulong
, ...) -> ::c_int
;
271 pub fn backtrace(buf
: *mut *mut ::c_void
,
272 sz
: ::c_int
) -> ::c_int
;
273 pub fn glob64(pattern
: *const ::c_char
,
275 errfunc
: ::dox
::Option
<extern fn(epath
: *const ::c_char
,
278 pglob
: *mut glob64_t
) -> ::c_int
;
279 pub fn globfree64(pglob
: *mut glob64_t
);
280 pub fn ptrace(request
: ::c_uint
, ...) -> ::c_long
;
281 pub fn pthread_attr_getaffinity_np(attr
: *const ::pthread_attr_t
,
282 cpusetsize
: ::size_t
,
283 cpuset
: *mut ::cpu_set_t
) -> ::c_int
;
284 pub fn pthread_attr_setaffinity_np(attr
: *mut ::pthread_attr_t
,
285 cpusetsize
: ::size_t
,
286 cpuset
: *const ::cpu_set_t
) -> ::c_int
;