]> git.proxmox.com Git - rustc.git/blame - vendor/libc/src/unix/aix/powerpc64.rs
Update upstream source from tag 'upstream/1.70.0+dfsg1'
[rustc.git] / vendor / libc / src / unix / aix / powerpc64.rs
CommitLineData
353b0b11
FG
1pub type c_long = i64;
2pub type c_ulong = u64;
3
4s! {
5 pub struct sigset_t {
6 pub ss_set: [c_ulong; 4],
7 }
8
9 pub struct fd_set {
10 pub fds_bits: [c_long; 1024],
11 }
12
13 pub struct flock {
14 pub l_type: ::c_short,
15 pub l_whence: ::c_short,
16 pub l_sysid: ::c_uint,
17 pub l_pid: ::pid_t,
18 pub l_vfs: ::c_int,
19 pub l_start: ::off_t,
20 pub l_len: ::off_t,
21 }
22
23 pub struct statvfs {
24 pub f_bsize: ::c_ulong,
25 pub f_frsize: ::c_ulong,
26 pub f_blocks: ::fsblkcnt_t,
27 pub f_bfree: ::fsblkcnt_t,
28 pub f_bavail: ::fsblkcnt_t,
29 pub f_files: ::fsfilcnt_t,
30 pub f_ffree: ::fsfilcnt_t,
31 pub f_favail: ::fsfilcnt_t,
32 pub f_fsid: ::c_ulong,
33 pub f_basetype: [::c_char; 16],
34 pub f_flag: ::c_ulong,
35 pub f_namemax: ::c_ulong,
36 pub f_fstr: [::c_char; 32],
37 pub f_filler: [::c_ulong; 16]
38 }
39
40 pub struct pthread_rwlock_t {
41 __rw_word: [::c_long; 10],
42 }
43
44 pub struct pthread_cond_t {
45 __cv_word: [::c_long; 6],
46 }
47
48 pub struct pthread_mutex_t {
49 __mt_word: [::c_long; 8],
50 }
51
52 pub struct stat {
53 pub st_dev: ::dev_t,
54 pub st_ino: ::ino_t,
55 pub st_mode: ::mode_t,
56 pub st_nlink: ::nlink_t,
57 pub st_flag: ::c_ushort,
58 pub st_uid: ::uid_t,
59 pub st_gid: ::gid_t,
60 pub st_rdev: ::dev_t,
61 pub st_ssize: ::c_int,
62 pub st_atime: ::st_timespec,
63 pub st_mtime: ::st_timespec,
64 pub st_ctime: ::st_timespec,
65 pub st_blksize: ::blksize_t,
66 pub st_blocks: ::blkcnt_t,
67 pub st_vfstype: ::c_int,
68 pub st_vfs: ::c_uint,
69 pub st_type: ::c_uint,
70 pub st_gen: ::c_uint,
71 pub st_reserved: [::c_uint; 9],
72 pub st_padto_ll: ::c_uint,
73 pub st_size: ::off_t,
74 }
75
76 pub struct statfs {
77 pub f_version: ::c_int,
78 pub f_type: ::c_int,
79 pub f_bsize: ::c_ulong,
80 pub f_blocks: ::fsblkcnt_t,
81 pub f_bfree: ::fsblkcnt_t,
82 pub f_bavail: ::fsblkcnt_t,
83 pub f_files: ::fsblkcnt_t,
84 pub f_ffree: ::fsblkcnt_t,
85 pub f_fsid: ::fsid64_t,
86 pub f_vfstype: ::c_int,
87 pub f_fsize: ::c_ulong,
88 pub f_vfsnumber: ::c_int,
89 pub f_vfsoff: ::c_int,
90 pub f_vfslen: ::c_int,
91 pub f_vfsvers: ::c_int,
92 pub f_fname: [::c_char; 32],
93 pub f_fpack: [::c_char; 32],
94 pub f_name_max: ::c_int,
95 }
96}
97
98s_no_extra_traits! {
99 #[cfg(libc_union)]
100 pub union sigval {
101 pub sival_ptr: *mut ::c_void,
102 pub sival_int: ::c_int,
103 }
104
105 pub struct siginfo_t {
106 pub si_signo: ::c_int,
107 pub si_errno: ::c_int,
108 pub si_code: ::c_int,
109 pub si_pid: ::pid_t,
110 pub si_uid: ::uid_t,
111 pub si_status: ::c_int,
112 pub si_addr: *mut ::c_void,
113 pub si_band: ::c_long,
114 #[cfg(libc_union)]
115 pub si_value: sigval,
116 pub __si_flags: ::c_int,
117 pub __pad: [::c_int; 3],
118 }
119
120 #[cfg(libc_union)]
121 pub union _kernel_simple_lock {
122 pub _slock: ::c_long,
123 // Should be pointer to 'lock_data_instrumented'
124 pub _slockp: *mut ::c_void,
125 }
126
127 pub struct fileops_t {
128 pub fo_rw: extern fn(file: *mut file, rw: ::uio_rw, io: *mut ::c_void, ext: ::c_long,
129 secattr: *mut ::c_void) -> ::c_int,
130 pub fo_ioctl: extern fn(file: *mut file, a: ::c_long, b: ::caddr_t, c: ::c_long,
131 d: ::c_long) -> ::c_int,
132 pub fo_select: extern fn(file: *mut file, a: ::c_int, b: *mut ::c_ushort,
133 c: extern fn()) -> ::c_int,
134 pub fo_close: extern fn(file: *mut file) -> ::c_int,
135 pub fo_fstat: extern fn(file: *mut file, sstat: *mut ::stat) -> ::c_int,
136 }
137
138 pub struct file {
139 pub f_flag: ::c_long,
140 pub f_count: ::c_int,
141 pub f_options: ::c_short,
142 pub f_type: ::c_short,
143 // Should be pointer to 'vnode'
144 pub f_data: *mut ::c_void,
145 pub f_offset: ::c_longlong,
146 pub f_dir_off: ::c_long,
147 // Should be pointer to 'cred'
148 pub f_cred: *mut ::c_void,
149 #[cfg(libc_union)]
150 pub f_lock: _kernel_simple_lock,
151 #[cfg(libc_union)]
152 pub f_offset_lock: _kernel_simple_lock,
153 pub f_vinfo: ::caddr_t,
154 pub f_ops: *mut fileops_t,
155 pub f_parentp: ::caddr_t,
156 pub f_fnamep: ::caddr_t,
157 pub f_fdata: [::c_char; 160],
158 }
159
160 #[cfg(libc_union)]
161 pub union __ld_info_file {
162 pub _ldinfo_fd: ::c_int,
163 pub _ldinfo_fp: *mut file,
164 pub _core_offset: ::c_long,
165 }
166
167 pub struct ld_info {
168 pub ldinfo_next: ::c_uint,
169 pub ldinfo_flags: ::c_uint,
170 #[cfg(libc_union)]
171 pub _file: __ld_info_file,
172 pub ldinfo_textorg: *mut ::c_void,
173 pub ldinfo_textsize: ::c_ulong,
174 pub ldinfo_dataorg: *mut ::c_void,
175 pub ldinfo_datasize: ::c_ulong,
176 pub ldinfo_filename: [::c_char; 2],
177 }
178
179 #[cfg(libc_union)]
180 pub union __pollfd_ext_u {
181 pub addr: *mut ::c_void,
182 pub data32: u32,
183 pub data: u64,
184 }
185
186 pub struct pollfd_ext {
187 pub fd: ::c_int,
188 pub events: ::c_ushort,
189 pub revents: ::c_ushort,
190 #[cfg(libc_union)]
191 pub data: __pollfd_ext_u,
192 }
193}
194
195cfg_if! {
196 if #[cfg(feature = "extra_traits")] {
197 #[cfg(libc_union)]
198 impl PartialEq for sigval {
199 fn eq(&self, other: &sigval) -> bool {
200 unsafe {
201 self.sival_ptr == other.sival_ptr
202 && self.sival_int == other.sival_int
203 }
204 }
205 }
206 #[cfg(libc_union)]
207 impl Eq for sigval {}
208 #[cfg(libc_union)]
209 impl ::fmt::Debug for sigval {
210 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
211 f.debug_struct("sigval")
212 .field("sival_ptr", unsafe { &self.sival_ptr })
213 .field("sival_int", unsafe { &self.sival_int })
214 .finish()
215 }
216 }
217 #[cfg(libc_union)]
218 impl ::hash::Hash for sigval {
219 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
220 unsafe {
221 self.sival_ptr.hash(state);
222 self.sival_int.hash(state);
223 }
224 }
225 }
226
227 impl PartialEq for siginfo_t {
228 fn eq(&self, other: &siginfo_t) -> bool {
229 #[cfg(libc_union)]
230 let value_eq = self.si_value == other.si_value;
231 #[cfg(not(libc_union))]
232 let value_eq = true;
233 self.si_signo == other.si_signo
234 && self.si_errno == other.si_errno
235 && self.si_code == other.si_code
236 && self.si_pid == other.si_pid
237 && self.si_uid == other.si_uid
238 && self.si_status == other.si_status
239 && self.si_addr == other.si_addr
240 && self.si_band == other.si_band
241 && self.__si_flags == other.__si_flags
242 && value_eq
243 }
244 }
245 impl Eq for siginfo_t {}
246 impl ::fmt::Debug for siginfo_t {
247 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
248 let mut struct_formatter = f.debug_struct("siginfo_t");
249 struct_formatter.field("si_signo", &self.si_signo);
250 struct_formatter.field("si_errno", &self.si_errno);
251 struct_formatter.field("si_code", &self.si_code);
252 struct_formatter.field("si_pid", &self.si_pid);
253 struct_formatter.field("si_uid", &self.si_uid);
254 struct_formatter.field("si_status", &self.si_status);
255 struct_formatter.field("si_addr", &self.si_addr);
256 struct_formatter.field("si_band", &self.si_band);
257 #[cfg(libc_union)]
258 struct_formatter.field("si_value", &self.si_value);
259 struct_formatter.field("__si_flags", &self.__si_flags);
260 struct_formatter.finish()
261 }
262 }
263 impl ::hash::Hash for siginfo_t {
264 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
265 self.si_signo.hash(state);
266 self.si_errno.hash(state);
267 self.si_code.hash(state);
268 self.si_pid.hash(state);
269 self.si_uid.hash(state);
270 self.si_status.hash(state);
271 self.si_addr.hash(state);
272 self.si_band.hash(state);
273 #[cfg(libc_union)]
274 self.si_value.hash(state);
275 self.__si_flags.hash(state);
276 }
277 }
278
279 #[cfg(libc_union)]
280 impl PartialEq for _kernel_simple_lock {
281 fn eq(&self, other: &_kernel_simple_lock) -> bool {
282 unsafe {
283 self._slock == other._slock
284 && self._slockp == other._slockp
285 }
286 }
287 }
288 #[cfg(libc_union)]
289 impl Eq for _kernel_simple_lock {}
290 #[cfg(libc_union)]
291 impl ::fmt::Debug for _kernel_simple_lock {
292 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
293 f.debug_struct("sigval")
294 .field("_slock", unsafe { &self._slock })
295 .field("_slockp", unsafe { &self._slockp })
296 .finish()
297 }
298 }
299 #[cfg(libc_union)]
300 impl ::hash::Hash for _kernel_simple_lock {
301 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
302 unsafe {
303 self._slock.hash(state);
304 self._slockp.hash(state);
305 }
306 }
307 }
308
309 impl PartialEq for fileops_t {
310 fn eq(&self, other: &fileops_t) -> bool {
311 self.fo_rw == other.fo_rw
312 && self.fo_ioctl == other.fo_ioctl
313 && self.fo_select == other.fo_select
314 && self.fo_close == other.fo_close
315 && self.fo_fstat == other.fo_fstat
316 }
317 }
318 impl Eq for fileops_t {}
319 impl ::fmt::Debug for fileops_t {
320 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
321 let mut struct_formatter = f.debug_struct("fileops_t");
322 struct_formatter.field("fo_rw", &self.fo_rw);
323 struct_formatter.field("fo_ioctl", &self.fo_ioctl);
324 struct_formatter.field("fo_select", &self.fo_select);
325 struct_formatter.field("fo_close", &self.fo_close);
326 struct_formatter.field("fo_fstat", &self.fo_fstat);
327 struct_formatter.finish()
328 }
329 }
330 impl ::hash::Hash for fileops_t {
331 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
332 self.fo_rw.hash(state);
333 self.fo_ioctl.hash(state);
334 self.fo_select.hash(state);
335 self.fo_close.hash(state);
336 self.fo_fstat.hash(state);
337 }
338 }
339
340 impl PartialEq for file {
341 fn eq(&self, other: &file) -> bool {
342 #[cfg(libc_union)]
343 let lock_eq = self.f_lock == other.f_lock
344 && self.f_offset_lock == other.f_offset_lock;
345 #[cfg(not(libc_union))]
346 let lock_eq = true;
347 self.f_flag == other.f_flag
348 && self.f_count == other.f_count
349 && self.f_options == other.f_options
350 && self.f_type == other.f_type
351 && self.f_data == other.f_data
352 && self.f_offset == other.f_offset
353 && self.f_dir_off == other.f_dir_off
354 && self.f_cred == other.f_cred
355 && self.f_vinfo == other.f_vinfo
356 && self.f_ops == other.f_ops
357 && self.f_parentp == other.f_parentp
358 && self.f_fnamep == other.f_fnamep
359 && self.f_fdata == other.f_fdata
360 && lock_eq
361 }
362 }
363 impl Eq for file {}
364 impl ::fmt::Debug for file {
365 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
366 let mut struct_formatter = f.debug_struct("file");
367 struct_formatter.field("f_flag", &self.f_flag);
368 struct_formatter.field("f_count", &self.f_count);
369 struct_formatter.field("f_options", &self.f_options);
370 struct_formatter.field("f_type", &self.f_type);
371 struct_formatter.field("f_data", &self.f_data);
372 struct_formatter.field("f_offset", &self.f_offset);
373 struct_formatter.field("f_dir_off", &self.f_dir_off);
374 struct_formatter.field("f_cred", &self.f_cred);
375 #[cfg(libc_union)]
376 struct_formatter.field("f_lock", &self.f_lock);
377 #[cfg(libc_union)]
378 struct_formatter.field("f_offset_lock", &self.f_offset_lock);
379 struct_formatter.field("f_vinfo", &self.f_vinfo);
380 struct_formatter.field("f_ops", &self.f_ops);
381 struct_formatter.field("f_parentp", &self.f_parentp);
382 struct_formatter.field("f_fnamep", &self.f_fnamep);
383 struct_formatter.field("f_fdata", &self.f_fdata);
384 struct_formatter.finish()
385 }
386 }
387 impl ::hash::Hash for file {
388 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
389 self.f_flag.hash(state);
390 self.f_count.hash(state);
391 self.f_options.hash(state);
392 self.f_type.hash(state);
393 self.f_data.hash(state);
394 self.f_offset.hash(state);
395 self.f_dir_off.hash(state);
396 self.f_cred.hash(state);
397 #[cfg(libc_union)]
398 self.f_lock.hash(state);
399 #[cfg(libc_union)]
400 self.f_offset_lock.hash(state);
401 self.f_vinfo.hash(state);
402 self.f_ops.hash(state);
403 self.f_parentp.hash(state);
404 self.f_fnamep.hash(state);
405 self.f_fdata.hash(state);
406 }
407 }
408
409 #[cfg(libc_union)]
410 impl PartialEq for __ld_info_file {
411 fn eq(&self, other: &__ld_info_file) -> bool {
412 unsafe {
413 self._ldinfo_fd == other._ldinfo_fd
414 && self._ldinfo_fp == other._ldinfo_fp
415 && self._core_offset == other._core_offset
416 }
417 }
418 }
419 #[cfg(libc_union)]
420 impl Eq for __ld_info_file {}
421 #[cfg(libc_union)]
422 impl ::fmt::Debug for __ld_info_file {
423 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
424 f.debug_struct("__ld_info_file")
425 .field("_ldinfo_fd", unsafe { &self._ldinfo_fd })
426 .field("_ldinfo_fp", unsafe { &self._ldinfo_fp })
427 .field("_core_offset", unsafe { &self._core_offset })
428 .finish()
429 }
430 }
431 #[cfg(libc_union)]
432 impl ::hash::Hash for __ld_info_file {
433 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
434 unsafe {
435 self._ldinfo_fd.hash(state);
436 self._ldinfo_fp.hash(state);
437 self._core_offset.hash(state);
438 }
439 }
440 }
441
442 impl PartialEq for ld_info {
443 fn eq(&self, other: &ld_info) -> bool {
444 #[cfg(libc_union)]
445 let file_eq = self._file == other._file;
446 #[cfg(not(libc_union))]
447 let file_eq = true;
448 self.ldinfo_next == other.ldinfo_next
449 && self.ldinfo_flags == other.ldinfo_flags
450 && self.ldinfo_textorg == other.ldinfo_textorg
451 && self.ldinfo_textsize == other.ldinfo_textsize
452 && self.ldinfo_dataorg == other.ldinfo_dataorg
453 && self.ldinfo_datasize == other.ldinfo_datasize
454 && self.ldinfo_filename == other.ldinfo_filename
455 && file_eq
456 }
457 }
458 impl Eq for ld_info {}
459 impl ::fmt::Debug for ld_info {
460 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
461 let mut struct_formatter = f.debug_struct("ld_info");
462 struct_formatter.field("ldinfo_next", &self.ldinfo_next);
463 struct_formatter.field("ldinfo_flags", &self.ldinfo_flags);
464 struct_formatter.field("ldinfo_textorg", &self.ldinfo_textorg);
465 struct_formatter.field("ldinfo_textsize", &self.ldinfo_textsize);
466 struct_formatter.field("ldinfo_dataorg", &self.ldinfo_dataorg);
467 struct_formatter.field("ldinfo_datasize", &self.ldinfo_datasize);
468 struct_formatter.field("ldinfo_filename", &self.ldinfo_filename);
469 #[cfg(libc_union)]
470 struct_formatter.field("_file", &self._file);
471 struct_formatter.finish()
472 }
473 }
474 impl ::hash::Hash for ld_info {
475 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
476 self.ldinfo_next.hash(state);
477 self.ldinfo_flags.hash(state);
478 self.ldinfo_textorg.hash(state);
479 self.ldinfo_textsize.hash(state);
480 self.ldinfo_dataorg.hash(state);
481 self.ldinfo_datasize.hash(state);
482 self.ldinfo_filename.hash(state);
483 #[cfg(libc_union)]
484 self._file.hash(state);
485 }
486 }
487
488 #[cfg(libc_union)]
489 impl PartialEq for __pollfd_ext_u {
490 fn eq(&self, other: &__pollfd_ext_u) -> bool {
491 unsafe {
492 self.addr == other.addr
493 && self.data32 == other.data32
494 && self.data == other.data
495 }
496 }
497 }
498 #[cfg(libc_union)]
499 impl Eq for __pollfd_ext_u {}
500 #[cfg(libc_union)]
501 impl ::fmt::Debug for __pollfd_ext_u {
502 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
503 f.debug_struct("__pollfd_ext_u")
504 .field("addr", unsafe { &self.addr })
505 .field("data32", unsafe { &self.data32 })
506 .field("data", unsafe { &self.data })
507 .finish()
508 }
509 }
510 #[cfg(libc_union)]
511 impl ::hash::Hash for __pollfd_ext_u {
512 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
513 unsafe {
514 self.addr.hash(state);
515 self.data.hash(state);
516 self.data32.hash(state);
517 }
518 }
519 }
520
521 impl PartialEq for pollfd_ext {
522 fn eq(&self, other: &pollfd_ext) -> bool {
523 #[cfg(libc_union)]
524 let data_eq = self.data == other.data;
525 #[cfg(not(libc_union))]
526 let data_eq = true;
527 self.fd == other.fd
528 && self.events == other.events
529 && self.revents == other.revents
530 && data_eq
531 }
532 }
533 impl Eq for pollfd_ext {}
534 impl ::fmt::Debug for pollfd_ext {
535 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
536 let mut struct_formatter = f.debug_struct("pollfd_ext");
537 struct_formatter.field("fd", &self.fd);
538 struct_formatter.field("events", &self.events);
539 struct_formatter.field("revents", &self.revents);
540 #[cfg(libc_union)]
541 struct_formatter.field("data", &self.data);
542 struct_formatter.finish()
543 }
544 }
545 impl ::hash::Hash for pollfd_ext {
546 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
547 self.fd.hash(state);
548 self.events.hash(state);
549 self.revents.hash(state);
550 #[cfg(libc_union)]
551 self.data.hash(state);
552 }
553 }
554 }
555}
556
557pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
558 __mt_word: [0, 2, 0, 0, 0, 0, 0, 0],
559};
560pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
561 __cv_word: [0, 0, 0, 0, 2, 0],
562};
563pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
564 __rw_word: [2, 0, 0, 0, 0, 0, 0, 0, 0, 0],
565};
566pub const RLIM_INFINITY: ::c_ulong = 0x7fffffffffffffff;
567
568extern "C" {
569 pub fn getsystemcfg(label: ::c_int) -> ::c_ulong;
570}