]> git.proxmox.com Git - rustc.git/blob - src/liblibc/src/unix/notbsd/linux/mips/mips32.rs
New upstream version 1.19.0+dfsg1
[rustc.git] / src / liblibc / src / unix / notbsd / linux / mips / mips32.rs
1 pub type c_char = i8;
2 pub type c_long = i32;
3 pub type c_ulong = u32;
4 pub type clock_t = i32;
5 pub type time_t = i32;
6 pub type suseconds_t = i32;
7 pub type wchar_t = i32;
8 pub type off_t = i32;
9 pub type ino_t = u32;
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;
16
17 s! {
18 pub struct aiocb {
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,
26 __abs_prio: ::c_int,
27 __policy: ::c_int,
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]
33 }
34
35 pub struct stat {
36 pub st_dev: ::c_ulong,
37 st_pad1: [::c_long; 3],
38 pub st_ino: ::ino_t,
39 pub st_mode: ::mode_t,
40 pub st_nlink: ::nlink_t,
41 pub st_uid: ::uid_t,
42 pub st_gid: ::gid_t,
43 pub st_rdev: ::c_ulong,
44 pub st_pad2: [::c_long; 2],
45 pub st_size: ::off_t,
46 st_pad3: ::c_long,
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],
56 }
57
58 pub struct stat64 {
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,
64 pub st_uid: ::uid_t,
65 pub st_gid: ::gid_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,
76 st_pad3: ::c_long,
77 pub st_blocks: ::blkcnt64_t,
78 st_pad5: [::c_long; 14],
79 }
80
81 pub struct pthread_attr_t {
82 __size: [u32; 9]
83 }
84
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()>,
90 _resv: [::c_int; 1],
91 }
92
93 pub struct stack_t {
94 pub ss_sp: *mut ::c_void,
95 pub ss_size: ::size_t,
96 pub ss_flags: ::c_int,
97 }
98
99 pub struct sigset_t {
100 __val: [::c_ulong; 32],
101 }
102
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],
108 }
109
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,
115
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,
121 }
122
123 pub struct ipc_perm {
124 pub __key: ::key_t,
125 pub uid: ::uid_t,
126 pub gid: ::gid_t,
127 pub cuid: ::uid_t,
128 pub cgid: ::gid_t,
129 pub mode: ::c_uint,
130 pub __seq: ::c_ushort,
131 __pad1: ::c_ushort,
132 __unused1: ::c_ulong,
133 __unused2: ::c_ulong
134 }
135
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,
146 __unused5: ::c_ulong
147 }
148
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,
173 }
174
175 pub struct statfs {
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,
185
186 pub f_namelen: ::c_long,
187 f_spare: [::c_long; 6],
188 }
189
190 pub struct msghdr {
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,
198 }
199
200 pub struct cmsghdr {
201 pub cmsg_len: ::size_t,
202 pub cmsg_level: ::c_int,
203 pub cmsg_type: ::c_int,
204 }
205
206 pub struct termios {
207 pub c_iflag: ::tcflag_t,
208 pub c_oflag: ::tcflag_t,
209 pub c_cflag: ::tcflag_t,
210 pub c_lflag: ::tcflag_t,
211 pub c_line: ::cc_t,
212 pub c_cc: [::cc_t; ::NCCS],
213 }
214
215 pub struct flock {
216 pub l_type: ::c_short,
217 pub l_whence: ::c_short,
218 pub l_start: ::off_t,
219 pub l_len: ::off_t,
220 pub l_sysid: ::c_long,
221 pub l_pid: ::pid_t,
222 pad: [::c_long; 4],
223 }
224
225 pub struct sysinfo {
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,
235 pub pad: ::c_ushort,
236 pub totalhigh: ::c_ulong,
237 pub freehigh: ::c_ulong,
238 pub mem_unit: ::c_uint,
239 pub _f: [::c_char; 8],
240 }
241
242 // FIXME this is actually a union
243 pub struct sem_t {
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],
249 }
250 }
251
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;
256
257 pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
258
259 pub const SYS_gettid: ::c_long = 4222; // Valid for O32
260
261 #[link(name = "util")]
262 extern {
263 pub fn sysctl(name: *mut ::c_int,
264 namelen: ::c_int,
265 oldp: *mut ::c_void,
266 oldlenp: *mut ::size_t,
267 newp: *mut ::c_void,
268 newlen: ::size_t)
269 -> ::c_int;
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,
274 flags: ::c_int,
275 errfunc: ::dox::Option<extern fn(epath: *const ::c_char,
276 errno: ::c_int)
277 -> ::c_int>,
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;
287 }