interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / vendor / libc / src / unix / aix / mod.rs

3408 lines · 117542 bytes Raw Blame History
1use crate::prelude::*;
2use crate::{
3 in_addr_t,
4 in_port_t,
5};
6
7pub type caddr_t = *mut c_char;
8pub type clockid_t = c_longlong;
9pub type blkcnt_t = c_long;
10pub type clock_t = c_int;
11pub type daddr_t = c_long;
12pub type dev_t = c_ulong;
13pub type fpos64_t = c_longlong;
14pub type fsblkcnt_t = c_ulong;
15pub type fsfilcnt_t = c_ulong;
16pub type ino_t = c_ulong;
17pub type key_t = c_int;
18pub type mode_t = c_uint;
19pub type nlink_t = c_short;
20pub type rlim_t = c_ulong;
21pub type speed_t = c_uint;
22pub type tcflag_t = c_uint;
23pub type time_t = c_long;
24pub type time64_t = i64;
25pub type timer_t = c_long;
26pub type wchar_t = c_uint;
27pub type nfds_t = c_uint;
28pub type projid_t = c_int;
29pub type id_t = c_uint;
30pub type blksize64_t = c_ulonglong;
31pub type blkcnt64_t = c_ulonglong;
32pub type suseconds_t = c_int;
33pub type useconds_t = c_uint;
34pub type off_t = c_long;
35pub type offset_t = c_longlong;
36pub type off64_t = c_longlong;
37pub type idtype_t = c_uint;
38
39pub type socklen_t = c_uint;
40pub type sa_family_t = c_uchar;
41
42pub type signal_t = c_int;
43pub type pthread_t = c_uint;
44pub type pthread_key_t = c_uint;
45pub type thread_t = pthread_t;
46pub type blksize_t = c_long;
47pub type nl_item = c_int;
48pub type mqd_t = c_int;
49pub type shmatt_t = c_ulong;
50pub type regoff_t = c_long;
51pub type rlim64_t = c_ulonglong;
52
53pub type sem_t = c_int;
54pub type pollset_t = c_int;
55pub type sctp_assoc_t = c_uint;
56
57pub type pthread_rwlockattr_t = *mut c_void;
58pub type pthread_condattr_t = *mut c_void;
59pub type pthread_mutexattr_t = *mut c_void;
60pub type pthread_attr_t = *mut c_void;
61pub type pthread_barrierattr_t = *mut c_void;
62pub type posix_spawn_file_actions_t = *mut c_char;
63pub type iconv_t = *mut c_void;
64
65e! {
66 #[repr(u32)]
67 pub enum uio_rw {
68 UIO_READ = 0,
69 UIO_WRITE,
70 UIO_READ_NO_MOVE,
71 UIO_WRITE_NO_MOVE,
72 UIO_PWRITE,
73 }
74 #[repr(u32)]
75 pub enum ACTION {
76 FIND = 0,
77 ENTER,
78 }
79}
80
81s! {
82 pub struct fsid_t {
83 pub val: [c_uint; 2],
84 }
85
86 pub struct fsid64_t {
87 pub val: [crate::uint64_t; 2],
88 }
89
90 pub struct timezone {
91 pub tz_minuteswest: c_int,
92 pub tz_dsttime: c_int,
93 }
94
95 pub struct ip_mreq {
96 pub imr_multiaddr: in_addr,
97 pub imr_interface: in_addr,
98 }
99
100 pub struct dirent {
101 pub d_offset: c_ulong,
102 pub d_ino: crate::ino_t,
103 pub d_reclen: c_ushort,
104 pub d_namlen: c_ushort,
105 pub d_name: [c_char; 256],
106 }
107
108 pub struct termios {
109 pub c_iflag: crate::tcflag_t,
110 pub c_oflag: crate::tcflag_t,
111 pub c_cflag: crate::tcflag_t,
112 pub c_lflag: crate::tcflag_t,
113 pub c_cc: [crate::cc_t; crate::NCCS],
114 }
115
116 pub struct flock64 {
117 pub l_type: c_short,
118 pub l_whence: c_short,
119 pub l_sysid: c_uint,
120 pub l_pid: crate::pid_t,
121 pub l_vfs: c_int,
122 pub l_start: off64_t,
123 pub l_len: off64_t,
124 }
125
126 pub struct msghdr {
127 pub msg_name: *mut c_void,
128 pub msg_namelen: crate::socklen_t,
129 pub msg_iov: *mut crate::iovec,
130 pub msg_iovlen: c_int,
131 pub msg_control: *mut c_void,
132 pub msg_controllen: socklen_t,
133 pub msg_flags: c_int,
134 }
135
136 pub struct statvfs64 {
137 pub f_bsize: crate::blksize64_t,
138 pub f_frsize: crate::blksize64_t,
139 pub f_blocks: crate::blkcnt64_t,
140 pub f_bfree: crate::blkcnt64_t,
141 pub f_bavail: crate::blkcnt64_t,
142 pub f_files: crate::blkcnt64_t,
143 pub f_ffree: crate::blkcnt64_t,
144 pub f_favail: crate::blkcnt64_t,
145 pub f_fsid: fsid64_t,
146 pub f_basetype: [c_char; 16],
147 pub f_flag: c_ulong,
148 pub f_namemax: c_ulong,
149 pub f_fstr: [c_char; 32],
150 pub f_filler: [c_ulong; 16],
151 }
152
153 pub struct lconv {
154 pub decimal_point: *mut c_char,
155 pub thousands_sep: *mut c_char,
156 pub grouping: *mut c_char,
157 pub int_curr_symbol: *mut c_char,
158 pub currency_symbol: *mut c_char,
159 pub mon_decimal_point: *mut c_char,
160 pub mon_thousands_sep: *mut c_char,
161 pub mon_grouping: *mut c_char,
162 pub positive_sign: *mut c_char,
163 pub negative_sign: *mut c_char,
164 pub int_frac_digits: c_char,
165 pub frac_digits: c_char,
166 pub p_cs_precedes: c_char,
167 pub p_sep_by_space: c_char,
168 pub n_cs_precedes: c_char,
169 pub n_sep_by_space: c_char,
170 pub p_sign_posn: c_char,
171 pub n_sign_posn: c_char,
172 pub left_parenthesis: *mut c_char,
173 pub right_parenthesis: *mut c_char,
174 pub int_p_cs_precedes: c_char,
175 pub int_p_sep_by_space: c_char,
176 pub int_n_cs_precedes: c_char,
177 pub int_n_sep_by_space: c_char,
178 pub int_p_sign_posn: c_char,
179 pub int_n_sign_posn: c_char,
180 }
181
182 pub struct tm {
183 pub tm_sec: c_int,
184 pub tm_min: c_int,
185 pub tm_hour: c_int,
186 pub tm_mday: c_int,
187 pub tm_mon: c_int,
188 pub tm_year: c_int,
189 pub tm_wday: c_int,
190 pub tm_yday: c_int,
191 pub tm_isdst: c_int,
192 }
193
194 pub struct addrinfo {
195 pub ai_flags: c_int,
196 pub ai_family: c_int,
197 pub ai_socktype: c_int,
198 pub ai_protocol: c_int,
199 pub ai_addrlen: c_ulong,
200 pub ai_canonname: *mut c_char,
201 pub ai_addr: *mut crate::sockaddr,
202 pub ai_next: *mut addrinfo,
203 pub ai_eflags: c_int,
204 }
205
206 pub struct in_addr {
207 pub s_addr: in_addr_t,
208 }
209
210 pub struct ip_mreq_source {
211 pub imr_multiaddr: in_addr,
212 pub imr_sourceaddr: in_addr,
213 pub imr_interface: in_addr,
214 }
215
216 pub struct sockaddr {
217 pub sa_len: c_uchar,
218 pub sa_family: sa_family_t,
219 pub sa_data: [c_char; 14],
220 }
221
222 pub struct sockaddr_dl {
223 pub sdl_len: c_uchar,
224 pub sdl_family: c_uchar,
225 pub sdl_index: c_ushort,
226 pub sdl_type: c_uchar,
227 pub sdl_nlen: c_uchar,
228 pub sdl_alen: c_uchar,
229 pub sdl_slen: c_uchar,
230 pub sdl_data: [c_char; 120],
231 }
232
233 pub struct sockaddr_in {
234 pub sin_len: c_uchar,
235 pub sin_family: sa_family_t,
236 pub sin_port: in_port_t,
237 pub sin_addr: in_addr,
238 pub sin_zero: [c_uchar; 8],
239 }
240
241 pub struct sockaddr_in6 {
242 pub sin6_len: c_uchar,
243 pub sin6_family: c_uchar,
244 pub sin6_port: crate::uint16_t,
245 pub sin6_flowinfo: crate::uint32_t,
246 pub sin6_addr: crate::in6_addr,
247 pub sin6_scope_id: crate::uint32_t,
248 }
249
250 pub struct sockaddr_storage {
251 pub __ss_len: c_uchar,
252 pub ss_family: sa_family_t,
253 __ss_pad1: Padding<[c_char; 6]>,
254 __ss_align: crate::int64_t,
255 __ss_pad2: Padding<[c_char; 1265]>,
256 }
257
258 pub struct sockaddr_un {
259 pub sun_len: c_uchar,
260 pub sun_family: sa_family_t,
261 pub sun_path: [c_char; 1023],
262 }
263
264 pub struct st_timespec {
265 pub tv_sec: crate::time_t,
266 pub tv_nsec: c_int,
267 }
268
269 pub struct statfs64 {
270 pub f_version: c_int,
271 pub f_type: c_int,
272 pub f_bsize: blksize64_t,
273 pub f_blocks: blkcnt64_t,
274 pub f_bfree: blkcnt64_t,
275 pub f_bavail: blkcnt64_t,
276 pub f_files: crate::uint64_t,
277 pub f_ffree: crate::uint64_t,
278 pub f_fsid: fsid64_t,
279 pub f_vfstype: c_int,
280 pub f_fsize: blksize64_t,
281 pub f_vfsnumber: c_int,
282 pub f_vfsoff: c_int,
283 pub f_vfslen: c_int,
284 pub f_vfsvers: c_int,
285 pub f_fname: [c_char; 32],
286 pub f_fpack: [c_char; 32],
287 pub f_name_max: c_int,
288 }
289
290 pub struct passwd {
291 pub pw_name: *mut c_char,
292 pub pw_passwd: *mut c_char,
293 pub pw_uid: crate::uid_t,
294 pub pw_gid: crate::gid_t,
295 pub pw_gecos: *mut c_char,
296 pub pw_dir: *mut c_char,
297 pub pw_shell: *mut c_char,
298 }
299
300 pub struct utsname {
301 pub sysname: [c_char; 32],
302 pub nodename: [c_char; 32],
303 pub release: [c_char; 32],
304 pub version: [c_char; 32],
305 pub machine: [c_char; 32],
306 }
307
308 pub struct xutsname {
309 pub nid: c_uint,
310 reserved: Padding<c_int>,
311 pub longnid: c_ulonglong,
312 }
313
314 pub struct cmsghdr {
315 pub cmsg_len: crate::socklen_t,
316 pub cmsg_level: c_int,
317 pub cmsg_type: c_int,
318 }
319
320 // FIXME(1.0): This should not implement `PartialEq`
321 #[allow(unpredictable_function_pointer_comparisons)]
322 pub struct sigevent {
323 pub sigev_value: crate::sigval,
324 pub sigev_signo: c_int,
325 pub sigev_notify: c_int,
326 pub sigev_notify_function: extern "C" fn(val: crate::sigval),
327 pub sigev_notify_attributes: *mut pthread_attr_t,
328 }
329
330 pub struct osigevent {
331 pub sevt_value: *mut c_void,
332 pub sevt_signo: signal_t,
333 }
334
335 pub struct poll_ctl {
336 pub cmd: c_short,
337 pub events: c_short,
338 pub fd: c_int,
339 }
340
341 pub struct sf_parms {
342 pub header_data: *mut c_void,
343 pub header_length: c_uint,
344 pub file_descriptor: c_int,
345 pub file_size: crate::uint64_t,
346 pub file_offset: crate::uint64_t,
347 pub file_bytes: crate::int64_t,
348 pub trailer_data: *mut c_void,
349 pub trailer_length: c_uint,
350 pub bytes_sent: crate::uint64_t,
351 }
352
353 pub struct mmsghdr {
354 pub msg_hdr: crate::msghdr,
355 pub msg_len: c_uint,
356 }
357
358 pub struct sched_param {
359 pub sched_priority: c_int,
360 pub sched_policy: c_int,
361 sched_reserved: Padding<[c_int; 6]>,
362 }
363
364 pub struct stack_t {
365 pub ss_sp: *mut c_void,
366 pub ss_size: size_t,
367 pub ss_flags: c_int,
368 pub __pad: [c_int; 4],
369 }
370
371 pub struct posix_spawnattr_t {
372 pub posix_attr_flags: c_short,
373 pub posix_attr_pgroup: crate::pid_t,
374 pub posix_attr_sigmask: crate::sigset_t,
375 pub posix_attr_sigdefault: crate::sigset_t,
376 pub posix_attr_schedpolicy: c_int,
377 pub posix_attr_schedparam: sched_param,
378 }
379
380 pub struct glob_t {
381 pub gl_pathc: size_t,
382 pub gl_pathv: *mut *mut c_char,
383 pub gl_offs: size_t,
384 pub gl_padr: *mut c_void,
385 pub gl_ptx: *mut c_void,
386 }
387
388 pub struct mallinfo {
389 pub arena: c_ulong,
390 pub ordblks: c_int,
391 pub smblks: c_int,
392 pub hblks: c_int,
393 pub hblkhd: c_int,
394 pub usmblks: c_ulong,
395 pub fsmblks: c_ulong,
396 pub uordblks: c_ulong,
397 pub fordblks: c_ulong,
398 pub keepcost: c_int,
399 }
400
401 pub struct exit_status {
402 pub e_termination: c_short,
403 pub e_exit: c_short,
404 }
405
406 pub struct utmp {
407 pub ut_user: [c_char; 256],
408 pub ut_id: [c_char; 14],
409 pub ut_line: [c_char; 64],
410 pub ut_pid: crate::pid_t,
411 pub ut_type: c_short,
412 pub ut_time: time64_t,
413 pub ut_exit: exit_status,
414 pub ut_host: [c_char; 256],
415 pub __dbl_word_pad: c_int,
416 pub __reservedA: [c_int; 2],
417 pub __reservedV: [c_int; 6],
418 }
419
420 pub struct regmatch_t {
421 pub rm_so: regoff_t,
422 pub rm_eo: regoff_t,
423 }
424
425 pub struct regex_t {
426 pub re_nsub: size_t,
427 pub re_comp: *mut c_void,
428 pub re_cflags: c_int,
429 pub re_erroff: size_t,
430 pub re_len: size_t,
431 pub re_ucoll: [crate::wchar_t; 2],
432 pub re_lsub: [*mut c_void; 24],
433 pub re_esub: [*mut c_void; 24],
434 pub re_map: *mut c_uchar,
435 pub __maxsub: c_int,
436 __unused: Padding<[*mut c_void; 34]>,
437 }
438
439 pub struct rlimit64 {
440 pub rlim_cur: rlim64_t,
441 pub rlim_max: rlim64_t,
442 }
443
444 pub struct shmid_ds {
445 pub shm_perm: ipc_perm,
446 pub shm_segsz: size_t,
447 pub shm_lpid: crate::pid_t,
448 pub shm_cpid: crate::pid_t,
449 pub shm_nattch: shmatt_t,
450 pub shm_cnattch: shmatt_t,
451 pub shm_atime: time_t,
452 pub shm_dtime: time_t,
453 pub shm_ctime: time_t,
454 pub shm_handle: crate::uint32_t,
455 pub shm_extshm: c_int,
456 pub shm_pagesize: crate::int64_t,
457 pub shm_lba: crate::uint64_t,
458 shm_reserved0: Padding<crate::int64_t>,
459 shm_reserved1: Padding<crate::int64_t>,
460 }
461
462 pub struct stat64 {
463 pub st_dev: dev_t,
464 pub st_ino: ino_t,
465 pub st_mode: mode_t,
466 pub st_nlink: nlink_t,
467 pub st_flag: c_ushort,
468 pub st_uid: crate::uid_t,
469 pub st_gid: crate::gid_t,
470 pub st_rdev: dev_t,
471 pub st_ssize: c_int,
472 pub st_atim: st_timespec,
473 pub st_mtim: st_timespec,
474 pub st_ctim: st_timespec,
475 pub st_blksize: blksize_t,
476 pub st_blocks: blkcnt_t,
477 pub st_vfstype: c_int,
478 pub st_vfs: c_uint,
479 pub st_type: c_uint,
480 pub st_gen: c_uint,
481 st_reserved: Padding<[c_uint; 10]>,
482 pub st_size: off64_t,
483 }
484
485 pub struct mntent {
486 pub mnt_fsname: *mut c_char,
487 pub mnt_dir: *mut c_char,
488 pub mnt_type: *mut c_char,
489 pub mnt_opts: *mut c_char,
490 pub mnt_freq: c_int,
491 pub mnt_passno: c_int,
492 }
493
494 pub struct ipc_perm {
495 pub uid: crate::uid_t,
496 pub gid: crate::gid_t,
497 pub cuid: crate::uid_t,
498 pub cgid: crate::gid_t,
499 pub mode: mode_t,
500 pub seq: c_ushort,
501 __reserved: Padding<c_ushort>,
502 pub key: key_t,
503 }
504
505 pub struct entry {
506 pub key: *mut c_char,
507 pub data: *mut c_void,
508 }
509
510 pub struct mq_attr {
511 pub mq_flags: c_long,
512 pub mq_maxmsg: c_long,
513 pub mq_msgsize: c_long,
514 pub mq_curmsgs: c_long,
515 }
516
517 pub struct sembuf {
518 pub sem_num: c_ushort,
519 pub sem_op: c_short,
520 pub sem_flg: c_short,
521 }
522
523 pub struct if_nameindex {
524 pub if_index: c_uint,
525 pub if_name: *mut c_char,
526 }
527
528 pub struct itimerspec {
529 pub it_interval: crate::timespec,
530 pub it_value: crate::timespec,
531 }
532
533 pub struct sigaction {
534 pub sa_sigaction: crate::sighandler_t, // FIXME(union): this field is actually a union
535 pub sa_mask: sigset_t,
536 pub sa_flags: c_int,
537 }
538
539 pub struct poll_ctl_ext {
540 pub version: u8,
541 pub command: u8,
542 pub events: c_short,
543 pub fd: c_int,
544 pub u: __poll_ctl_ext_u,
545 reserved64: Padding<[u64; 6]>,
546 }
547}
548
549s_no_extra_traits! {
550 pub union __poll_ctl_ext_u {
551 pub addr: *mut c_void,
552 pub data32: u32,
553 pub data: u64,
554 }
555}
556
557cfg_if! {
558 if #[cfg(feature = "extra_traits")] {
559 impl PartialEq for __poll_ctl_ext_u {
560 fn eq(&self, other: &__poll_ctl_ext_u) -> bool {
561 unsafe {
562 self.addr == other.addr
563 && self.data32 == other.data32
564 && self.data == other.data
565 }
566 }
567 }
568 impl Eq for __poll_ctl_ext_u {}
569 impl hash::Hash for __poll_ctl_ext_u {
570 fn hash<H: hash::Hasher>(&self, state: &mut H) {
571 unsafe {
572 self.addr.hash(state);
573 self.data32.hash(state);
574 self.data.hash(state);
575 }
576 }
577 }
578 }
579}
580
581// dlfcn.h
582pub const RTLD_LAZY: c_int = 0x4;
583pub const RTLD_NOW: c_int = 0x2;
584pub const RTLD_GLOBAL: c_int = 0x10000;
585pub const RTLD_LOCAL: c_int = 0x80000;
586pub const RTLD_MEMBER: c_int = 0x40000;
587pub const RTLD_NOAUTODEFER: c_int = 0x20000;
588pub const RTLD_DEFAULT: *mut c_void = -1isize as *mut c_void;
589pub const RTLD_MYSELF: *mut c_void = -2isize as *mut c_void;
590pub const RTLD_NEXT: *mut c_void = -3isize as *mut c_void;
591
592// fcntl.h
593pub const O_RDONLY: c_int = 0x0;
594pub const O_WRONLY: c_int = 0x1;
595pub const O_RDWR: c_int = 0x2;
596pub const O_NDELAY: c_int = 0x8000;
597pub const O_APPEND: c_int = 0x8;
598pub const O_DSYNC: c_int = 0x400000;
599pub const O_CREAT: c_int = 0x100;
600pub const O_EXCL: c_int = 0x400;
601pub const O_NOCTTY: c_int = 0x800;
602pub const O_TRUNC: c_int = 0x200;
603pub const O_NOFOLLOW: c_int = 0x1000000;
604pub const O_DIRECTORY: c_int = 0x80000;
605pub const O_SEARCH: c_int = 0x20;
606pub const O_EXEC: c_int = 0x20;
607pub const O_CLOEXEC: c_int = 0x800000;
608pub const O_ACCMODE: c_int = O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH;
609pub const O_DIRECT: c_int = 0x8000000;
610pub const O_TTY_INIT: c_int = 0;
611pub const O_RSYNC: c_int = 0x200000;
612pub const O_LARGEFILE: c_int = 0x4000000;
613pub const F_DUPFD: c_int = 0;
614pub const F_DUPFD_CLOEXEC: c_int = 16;
615pub const F_GETFD: c_int = 1;
616pub const F_SETFD: c_int = 2;
617pub const F_GETFL: c_int = 3;
618pub const F_SETFL: c_int = 4;
619pub const F_GETLK: c_int = F_GETLK64;
620pub const F_SETLK: c_int = F_SETLK64;
621pub const F_SETLKW: c_int = F_SETLKW64;
622pub const F_GETOWN: c_int = 8;
623pub const F_SETOWN: c_int = 9;
624pub const F_CLOSEM: c_int = 10;
625pub const F_GETLK64: c_int = 11;
626pub const F_SETLK64: c_int = 12;
627pub const F_SETLKW64: c_int = 13;
628pub const F_DUP2FD: c_int = 14;
629pub const F_TSTLK: c_int = 15;
630pub const AT_FDCWD: c_int = -2;
631pub const AT_SYMLINK_NOFOLLOW: c_int = 1;
632pub const AT_SYMLINK_FOLLOW: c_int = 2;
633pub const AT_REMOVEDIR: c_int = 1;
634pub const AT_EACCESS: c_int = 1;
635pub const O_SYNC: c_int = 16;
636pub const O_NONBLOCK: c_int = 4;
637pub const FASYNC: c_int = 0x20000;
638pub const POSIX_FADV_NORMAL: c_int = 1;
639pub const POSIX_FADV_SEQUENTIAL: c_int = 2;
640pub const POSIX_FADV_RANDOM: c_int = 3;
641pub const POSIX_FADV_WILLNEED: c_int = 4;
642pub const POSIX_FADV_DONTNEED: c_int = 5;
643pub const POSIX_FADV_NOREUSE: c_int = 6;
644
645// glob.h
646pub const GLOB_APPEND: c_int = 0x1;
647pub const GLOB_DOOFFS: c_int = 0x2;
648pub const GLOB_ERR: c_int = 0x4;
649pub const GLOB_MARK: c_int = 0x8;
650pub const GLOB_NOCHECK: c_int = 0x10;
651pub const GLOB_NOSORT: c_int = 0x20;
652pub const GLOB_NOESCAPE: c_int = 0x80;
653pub const GLOB_NOSPACE: c_int = 0x2000;
654pub const GLOB_ABORTED: c_int = 0x1000;
655pub const GLOB_NOMATCH: c_int = 0x4000;
656pub const GLOB_NOSYS: c_int = 0x8000;
657
658// langinfo.h
659pub const DAY_1: crate::nl_item = 13;
660pub const DAY_2: crate::nl_item = 14;
661pub const DAY_3: crate::nl_item = 15;
662pub const DAY_4: crate::nl_item = 16;
663pub const DAY_5: crate::nl_item = 17;
664pub const DAY_6: crate::nl_item = 18;
665pub const DAY_7: crate::nl_item = 19;
666pub const ABDAY_1: crate::nl_item = 6;
667pub const ABDAY_2: crate::nl_item = 7;
668pub const ABDAY_3: crate::nl_item = 8;
669pub const ABDAY_4: crate::nl_item = 9;
670pub const ABDAY_5: crate::nl_item = 10;
671pub const ABDAY_6: crate::nl_item = 11;
672pub const ABDAY_7: crate::nl_item = 12;
673pub const MON_1: crate::nl_item = 32;
674pub const MON_2: crate::nl_item = 33;
675pub const MON_3: crate::nl_item = 34;
676pub const MON_4: crate::nl_item = 35;
677pub const MON_5: crate::nl_item = 36;
678pub const MON_6: crate::nl_item = 37;
679pub const MON_7: crate::nl_item = 38;
680pub const MON_8: crate::nl_item = 39;
681pub const MON_9: crate::nl_item = 40;
682pub const MON_10: crate::nl_item = 41;
683pub const MON_11: crate::nl_item = 42;
684pub const MON_12: crate::nl_item = 43;
685pub const ABMON_1: crate::nl_item = 20;
686pub const ABMON_2: crate::nl_item = 21;
687pub const ABMON_3: crate::nl_item = 22;
688pub const ABMON_4: crate::nl_item = 23;
689pub const ABMON_5: crate::nl_item = 24;
690pub const ABMON_6: crate::nl_item = 25;
691pub const ABMON_7: crate::nl_item = 26;
692pub const ABMON_8: crate::nl_item = 27;
693pub const ABMON_9: crate::nl_item = 28;
694pub const ABMON_10: crate::nl_item = 29;
695pub const ABMON_11: crate::nl_item = 30;
696pub const ABMON_12: crate::nl_item = 31;
697pub const RADIXCHAR: crate::nl_item = 44;
698pub const THOUSEP: crate::nl_item = 45;
699pub const YESSTR: crate::nl_item = 46;
700pub const NOSTR: crate::nl_item = 47;
701pub const CRNCYSTR: crate::nl_item = 48;
702pub const D_T_FMT: crate::nl_item = 1;
703pub const D_FMT: crate::nl_item = 2;
704pub const T_FMT: crate::nl_item = 3;
705pub const AM_STR: crate::nl_item = 4;
706pub const PM_STR: crate::nl_item = 5;
707pub const CODESET: crate::nl_item = 49;
708pub const T_FMT_AMPM: crate::nl_item = 55;
709pub const ERA: crate::nl_item = 56;
710pub const ERA_D_FMT: crate::nl_item = 57;
711pub const ERA_D_T_FMT: crate::nl_item = 58;
712pub const ERA_T_FMT: crate::nl_item = 59;
713pub const ALT_DIGITS: crate::nl_item = 60;
714pub const YESEXPR: crate::nl_item = 61;
715pub const NOEXPR: crate::nl_item = 62;
716
717// locale.h
718pub const LC_GLOBAL_LOCALE: crate::locale_t = -1isize as crate::locale_t;
719pub const LC_COLLATE: c_int = 0;
720pub const LC_CTYPE: c_int = 1;
721pub const LC_MONETARY: c_int = 2;
722pub const LC_NUMERIC: c_int = 3;
723pub const LC_TIME: c_int = 4;
724pub const LC_MESSAGES: c_int = 5;
725pub const LC_ALL: c_int = -1;
726pub const LC_COLLATE_MASK: c_int = 1;
727pub const LC_CTYPE_MASK: c_int = 2;
728pub const LC_MESSAGES_MASK: c_int = 4;
729pub const LC_MONETARY_MASK: c_int = 8;
730pub const LC_NUMERIC_MASK: c_int = 16;
731pub const LC_TIME_MASK: c_int = 32;
732pub const LC_ALL_MASK: c_int = LC_COLLATE_MASK
733 | LC_CTYPE_MASK
734 | LC_MESSAGES_MASK
735 | LC_MONETARY_MASK
736 | LC_NUMERIC_MASK
737 | LC_TIME_MASK;
738
739// netdb.h
740pub const NI_MAXHOST: crate::socklen_t = 1025;
741pub const NI_MAXSERV: crate::socklen_t = 32;
742pub const NI_NOFQDN: crate::socklen_t = 0x1;
743pub const NI_NUMERICHOST: crate::socklen_t = 0x2;
744pub const NI_NAMEREQD: crate::socklen_t = 0x4;
745pub const NI_NUMERICSERV: crate::socklen_t = 0x8;
746pub const NI_DGRAM: crate::socklen_t = 0x10;
747pub const NI_NUMERICSCOPE: crate::socklen_t = 0x40;
748pub const EAI_AGAIN: c_int = 2;
749pub const EAI_BADFLAGS: c_int = 3;
750pub const EAI_FAIL: c_int = 4;
751pub const EAI_FAMILY: c_int = 5;
752pub const EAI_MEMORY: c_int = 6;
753pub const EAI_NODATA: c_int = 7;
754pub const EAI_NONAME: c_int = 8;
755pub const EAI_SERVICE: c_int = 9;
756pub const EAI_SOCKTYPE: c_int = 10;
757pub const EAI_SYSTEM: c_int = 11;
758pub const EAI_OVERFLOW: c_int = 13;
759pub const AI_CANONNAME: c_int = 0x01;
760pub const AI_PASSIVE: c_int = 0x02;
761pub const AI_NUMERICHOST: c_int = 0x04;
762pub const AI_ADDRCONFIG: c_int = 0x08;
763pub const AI_V4MAPPED: c_int = 0x10;
764pub const AI_ALL: c_int = 0x20;
765pub const AI_NUMERICSERV: c_int = 0x40;
766pub const AI_EXTFLAGS: c_int = 0x80;
767pub const AI_DEFAULT: c_int = AI_V4MAPPED | AI_ADDRCONFIG;
768pub const IPV6_ADDRFORM: c_int = 22;
769pub const IPV6_ADDR_PREFERENCES: c_int = 74;
770pub const IPV6_CHECKSUM: c_int = 39;
771pub const IPV6_DONTFRAG: c_int = 45;
772pub const IPV6_DSTOPTS: c_int = 54;
773pub const IPV6_FLOWINFO_FLOWLABEL: c_int = 0x00ffffff;
774pub const IPV6_FLOWINFO_PRIORITY: c_int = 0x0f000000;
775pub const IPV6_FLOWINFO_PRIFLOW: c_int = 0x0fffffff;
776pub const IPV6_FLOWINFO_SRFLAG: c_int = 0x10000000;
777pub const IPV6_FLOWINFO_VERSION: c_int = u32_cast_int(0xf0000000);
778pub const IPV6_HOPLIMIT: c_int = 40;
779pub const IPV6_HOPOPTS: c_int = 52;
780pub const IPV6_NEXTHOP: c_int = 48;
781pub const IPV6_PATHMTU: c_int = 46;
782pub const IPV6_PKTINFO: c_int = 33;
783pub const IPV6_PREFER_SRC_CGA: c_int = 16;
784pub const IPV6_PREFER_SRC_COA: c_int = 2;
785pub const IPV6_PREFER_SRC_HOME: c_int = 1;
786pub const IPV6_PREFER_SRC_NONCGA: c_int = 32;
787pub const IPV6_PREFER_SRC_PUBLIC: c_int = 4;
788pub const IPV6_PREFER_SRC_TMP: c_int = 8;
789pub const IPV6_RECVDSTOPTS: c_int = 56;
790pub const IPV6_RECVHOPLIMIT: c_int = 41;
791pub const IPV6_RECVHOPOPTS: c_int = 53;
792pub const IPV6_RECVPATHMTU: c_int = 47;
793pub const IPV6_RECVRTHDR: c_int = 51;
794pub const IPV6_RECVTCLASS: c_int = 42;
795pub const IPV6_RTHDR: c_int = 50;
796pub const IPV6_RTHDRDSTOPTS: c_int = 55;
797pub const IPV6_TCLASS: c_int = 43;
798
799// net/bpf.h
800pub const DLT_NULL: c_int = 0x18;
801pub const DLT_EN10MB: c_int = 0x6;
802pub const DLT_EN3MB: c_int = 0x1a;
803pub const DLT_AX25: c_int = 0x5;
804pub const DLT_PRONET: c_int = 0xd;
805pub const DLT_IEEE802: c_int = 0x7;
806pub const DLT_ARCNET: c_int = 0x23;
807pub const DLT_SLIP: c_int = 0x1c;
808pub const DLT_PPP: c_int = 0x17;
809pub const DLT_FDDI: c_int = 0xf;
810pub const DLT_ATM: c_int = 0x25;
811pub const DLT_IPOIB: c_int = 0xc7;
812pub const BIOCSETF: c_int = u32_cast_int(0x80104267);
813pub const BIOCGRTIMEOUT: c_int = 0x4010426e;
814pub const BIOCGBLEN: c_int = 0x40044266;
815pub const BIOCSBLEN: c_int = u32_cast_int(0xc0044266);
816pub const BIOCFLUSH: c_int = 0x20004268;
817pub const BIOCPROMISC: c_int = 0x20004269;
818pub const BIOCGDLT: c_int = 0x4004426a;
819pub const BIOCSRTIMEOUT: c_int = u32_cast_int(0x8010426d);
820pub const BIOCGSTATS: c_int = 0x4008426f;
821pub const BIOCIMMEDIATE: c_int = u32_cast_int(0x80044270);
822pub const BIOCVERSION: c_int = 0x40044271;
823pub const BIOCSDEVNO: c_int = 0x20004272;
824pub const BIOCGETIF: c_int = 0x4020426b;
825pub const BIOCSETIF: c_int = u32_cast_int(0x8020426c);
826pub const BPF_ABS: c_int = 32;
827pub const BPF_ADD: c_int = 0;
828pub const BPF_ALIGNMENT: c_ulong = 4;
829pub const BPF_ALU: c_int = 4;
830pub const BPF_AND: c_int = 80;
831pub const BPF_B: c_int = 16;
832pub const BPF_DIV: c_int = 48;
833pub const BPF_H: c_int = 8;
834pub const BPF_IMM: c_int = 0;
835pub const BPF_IND: c_int = 64;
836pub const BPF_JA: c_int = 0;
837pub const BPF_JEQ: c_int = 16;
838pub const BPF_JGE: c_int = 48;
839pub const BPF_JGT: c_int = 32;
840pub const BPF_JMP: c_int = 5;
841pub const BPF_JSET: c_int = 64;
842pub const BPF_K: c_int = 0;
843pub const BPF_LD: c_int = 0;
844pub const BPF_LDX: c_int = 1;
845pub const BPF_LEN: c_int = 128;
846pub const BPF_LSH: c_int = 96;
847pub const BPF_MAXINSNS: c_int = 512;
848pub const BPF_MEM: c_int = 96;
849pub const BPF_MEMWORDS: c_int = 16;
850pub const BPF_MISC: c_int = 7;
851pub const BPF_MSH: c_int = 160;
852pub const BPF_MUL: c_int = 32;
853pub const BPF_NEG: c_int = 128;
854pub const BPF_OR: c_int = 64;
855pub const BPF_RET: c_int = 6;
856pub const BPF_RSH: c_int = 112;
857pub const BPF_ST: c_int = 2;
858pub const BPF_STX: c_int = 3;
859pub const BPF_SUB: c_int = 16;
860pub const BPF_W: c_int = 0;
861pub const BPF_X: c_int = 8;
862
863// net/if.h
864pub const IFNET_SLOWHZ: c_int = 1;
865pub const IFQ_MAXLEN: c_int = 50;
866pub const IFF_UP: c_int = 0x1;
867pub const IFF_BROADCAST: c_int = 0x2;
868pub const IFF_DEBUG: c_int = 0x4;
869pub const IFF_LOOPBACK: c_int = 0x8;
870pub const IFF_POINTOPOINT: c_int = 0x10;
871pub const IFF_NOTRAILERS: c_int = 0x20;
872pub const IFF_RUNNING: c_int = 0x40;
873pub const IFF_NOARP: c_int = 0x80;
874pub const IFF_PROMISC: c_int = 0x100;
875pub const IFF_ALLMULTI: c_int = 0x200;
876pub const IFF_MULTICAST: c_int = 0x80000;
877pub const IFF_LINK0: c_int = 0x100000;
878pub const IFF_LINK1: c_int = 0x200000;
879pub const IFF_LINK2: c_int = 0x400000;
880pub const IFF_OACTIVE: c_int = 0x400;
881pub const IFF_SIMPLEX: c_int = 0x800;
882
883// net/if_arp.h
884pub const ARPHRD_ETHER: c_int = 1;
885pub const ARPHRD_802_5: c_int = 6;
886pub const ARPHRD_802_3: c_int = 6;
887pub const ARPHRD_FDDI: c_int = 1;
888
889// net/route.h
890pub const RTM_ADD: c_int = 0x1;
891pub const RTM_DELETE: c_int = 0x2;
892pub const RTM_CHANGE: c_int = 0x3;
893pub const RTM_GET: c_int = 0x4;
894pub const RTM_LOSING: c_int = 0x5;
895pub const RTM_REDIRECT: c_int = 0x6;
896pub const RTM_MISS: c_int = 0x7;
897pub const RTM_LOCK: c_int = 0x8;
898pub const RTM_OLDADD: c_int = 0x9;
899pub const RTM_OLDDEL: c_int = 0xa;
900pub const RTM_RESOLVE: c_int = 0xb;
901pub const RTM_NEWADDR: c_int = 0xc;
902pub const RTM_DELADDR: c_int = 0xd;
903pub const RTM_IFINFO: c_int = 0xe;
904pub const RTM_EXPIRE: c_int = 0xf;
905pub const RTM_RTLOST: c_int = 0x10;
906pub const RTM_GETNEXT: c_int = 0x11;
907pub const RTM_SAMEADDR: c_int = 0x12;
908pub const RTM_SET: c_int = 0x13;
909pub const RTV_MTU: c_int = 0x1;
910pub const RTV_HOPCOUNT: c_int = 0x2;
911pub const RTV_EXPIRE: c_int = 0x4;
912pub const RTV_RPIPE: c_int = 0x8;
913pub const RTV_SPIPE: c_int = 0x10;
914pub const RTV_SSTHRESH: c_int = 0x20;
915pub const RTV_RTT: c_int = 0x40;
916pub const RTV_RTTVAR: c_int = 0x80;
917pub const RTA_DST: c_int = 0x1;
918pub const RTA_GATEWAY: c_int = 0x2;
919pub const RTA_NETMASK: c_int = 0x4;
920pub const RTA_GENMASK: c_int = 0x8;
921pub const RTA_IFP: c_int = 0x10;
922pub const RTA_IFA: c_int = 0x20;
923pub const RTA_AUTHOR: c_int = 0x40;
924pub const RTA_BRD: c_int = 0x80;
925pub const RTA_DOWNSTREAM: c_int = 0x100;
926pub const RTAX_DST: c_int = 0;
927pub const RTAX_GATEWAY: c_int = 1;
928pub const RTAX_NETMASK: c_int = 2;
929pub const RTAX_GENMASK: c_int = 3;
930pub const RTAX_IFP: c_int = 4;
931pub const RTAX_IFA: c_int = 5;
932pub const RTAX_AUTHOR: c_int = 6;
933pub const RTAX_BRD: c_int = 7;
934
935/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines)
936/// for details.
937pub const RTAX_MAX: c_int = 8;
938
939pub const RTF_UP: c_int = 0x1;
940pub const RTF_GATEWAY: c_int = 0x2;
941pub const RTF_HOST: c_int = 0x4;
942pub const RTF_REJECT: c_int = 0x8;
943pub const RTF_DYNAMIC: c_int = 0x10;
944pub const RTF_MODIFIED: c_int = 0x20;
945pub const RTF_DONE: c_int = 0x40;
946pub const RTF_MASK: c_int = 0x80;
947pub const RTF_CLONING: c_int = 0x100;
948pub const RTF_XRESOLVE: c_int = 0x200;
949pub const RTF_LLINFO: c_int = 0x400;
950pub const RTF_STATIC: c_int = 0x800;
951pub const RTF_BLACKHOLE: c_int = 0x1000;
952pub const RTF_BUL: c_int = 0x2000;
953pub const RTF_PROTO2: c_int = 0x4000;
954pub const RTF_PROTO1: c_int = 0x8000;
955pub const RTF_CLONE: c_int = 0x10000;
956pub const RTF_CLONED: c_int = 0x20000;
957pub const RTF_PROTO3: c_int = 0x40000;
958pub const RTF_BCE: c_int = 0x80000;
959pub const RTF_PINNED: c_int = 0x100000;
960pub const RTF_LOCAL: c_int = 0x200000;
961pub const RTF_BROADCAST: c_int = 0x400000;
962pub const RTF_MULTICAST: c_int = 0x800000;
963pub const RTF_ACTIVE_DGD: c_int = 0x1000000;
964pub const RTF_STOPSRCH: c_int = 0x2000000;
965pub const RTF_FREE_IN_PROG: c_int = 0x4000000;
966pub const RTF_PERMANENT6: c_int = 0x8000000;
967pub const RTF_UNREACHABLE: c_int = 0x10000000;
968pub const RTF_CACHED: c_int = 0x20000000;
969pub const RTF_SMALLMTU: c_int = 0x40000;
970
971// netinet/in.h
972pub const IPPROTO_HOPOPTS: c_int = 0;
973pub const IPPROTO_IGMP: c_int = 2;
974pub const IPPROTO_GGP: c_int = 3;
975pub const IPPROTO_IPIP: c_int = 4;
976pub const IPPROTO_EGP: c_int = 8;
977pub const IPPROTO_PUP: c_int = 12;
978pub const IPPROTO_IDP: c_int = 22;
979pub const IPPROTO_TP: c_int = 29;
980pub const IPPROTO_ROUTING: c_int = 43;
981pub const IPPROTO_FRAGMENT: c_int = 44;
982pub const IPPROTO_QOS: c_int = 45;
983pub const IPPROTO_RSVP: c_int = 46;
984pub const IPPROTO_GRE: c_int = 47;
985pub const IPPROTO_ESP: c_int = 50;
986pub const IPPROTO_AH: c_int = 51;
987pub const IPPROTO_NONE: c_int = 59;
988pub const IPPROTO_DSTOPTS: c_int = 60;
989pub const IPPROTO_LOCAL: c_int = 63;
990pub const IPPROTO_EON: c_int = 80;
991pub const IPPROTO_BIP: c_int = 0x53;
992pub const IPPROTO_SCTP: c_int = 132;
993pub const IPPROTO_MH: c_int = 135;
994pub const IPPROTO_GIF: c_int = 140;
995pub const IPPROTO_RAW: c_int = 255;
996pub const IP_OPTIONS: c_int = 1;
997pub const IP_HDRINCL: c_int = 2;
998pub const IP_TOS: c_int = 3;
999pub const IP_TTL: c_int = 4;
1000pub const IP_UNICAST_HOPS: c_int = 4;
1001pub const IP_RECVOPTS: c_int = 5;
1002pub const IP_RECVRETOPTS: c_int = 6;
1003pub const IP_RECVDSTADDR: c_int = 7;
1004pub const IP_RETOPTS: c_int = 8;
1005pub const IP_MULTICAST_IF: c_int = 9;
1006pub const IP_MULTICAST_TTL: c_int = 10;
1007pub const IP_MULTICAST_HOPS: c_int = 10;
1008pub const IP_MULTICAST_LOOP: c_int = 11;
1009pub const IP_ADD_MEMBERSHIP: c_int = 12;
1010pub const IP_DROP_MEMBERSHIP: c_int = 13;
1011pub const IP_RECVMACHDR: c_int = 14;
1012pub const IP_RECVIFINFO: c_int = 15;
1013pub const IP_BROADCAST_IF: c_int = 16;
1014pub const IP_DHCPMODE: c_int = 17;
1015pub const IP_RECVIF: c_int = 20;
1016pub const IP_ADDRFORM: c_int = 22;
1017pub const IP_DONTFRAG: c_int = 25;
1018pub const IP_FINDPMTU: c_int = 26;
1019pub const IP_PMTUAGE: c_int = 27;
1020pub const IP_RECVINTERFACE: c_int = 32;
1021pub const IP_RECVTTL: c_int = 34;
1022pub const IP_BLOCK_SOURCE: c_int = 58;
1023pub const IP_UNBLOCK_SOURCE: c_int = 59;
1024pub const IP_ADD_SOURCE_MEMBERSHIP: c_int = 60;
1025pub const IP_DROP_SOURCE_MEMBERSHIP: c_int = 61;
1026pub const IP_DEFAULT_MULTICAST_TTL: c_int = 1;
1027pub const IP_DEFAULT_MULTICAST_LOOP: c_int = 1;
1028pub const IP_INC_MEMBERSHIPS: c_int = 20;
1029pub const IP_INIT_MEMBERSHIP: c_int = 20;
1030pub const IPV6_UNICAST_HOPS: c_int = IP_TTL;
1031pub const IPV6_MULTICAST_IF: c_int = IP_MULTICAST_IF;
1032pub const IPV6_MULTICAST_HOPS: c_int = IP_MULTICAST_TTL;
1033pub const IPV6_MULTICAST_LOOP: c_int = IP_MULTICAST_LOOP;
1034pub const IPV6_RECVPKTINFO: c_int = 35;
1035pub const IPV6_V6ONLY: c_int = 37;
1036pub const IPV6_ADD_MEMBERSHIP: c_int = IP_ADD_MEMBERSHIP;
1037pub const IPV6_DROP_MEMBERSHIP: c_int = IP_DROP_MEMBERSHIP;
1038pub const IPV6_JOIN_GROUP: c_int = IP_ADD_MEMBERSHIP;
1039pub const IPV6_LEAVE_GROUP: c_int = IP_DROP_MEMBERSHIP;
1040pub const MCAST_BLOCK_SOURCE: c_int = 64;
1041pub const MCAST_EXCLUDE: c_int = 2;
1042pub const MCAST_INCLUDE: c_int = 1;
1043pub const MCAST_JOIN_GROUP: c_int = 62;
1044pub const MCAST_JOIN_SOURCE_GROUP: c_int = 66;
1045pub const MCAST_LEAVE_GROUP: c_int = 63;
1046pub const MCAST_LEAVE_SOURCE_GROUP: c_int = 67;
1047pub const MCAST_UNBLOCK_SOURCE: c_int = 65;
1048
1049// netinet/ip.h
1050pub const MAXTTL: c_int = 255;
1051pub const IPDEFTTL: c_int = 64;
1052pub const IPOPT_CONTROL: c_int = 0;
1053pub const IPOPT_EOL: c_int = 0;
1054pub const IPOPT_LSRR: c_int = 131;
1055pub const IPOPT_MINOFF: c_int = 4;
1056pub const IPOPT_NOP: c_int = 1;
1057pub const IPOPT_OFFSET: c_int = 2;
1058pub const IPOPT_OLEN: c_int = 1;
1059pub const IPOPT_OPTVAL: c_int = 0;
1060pub const IPOPT_RESERVED1: c_int = 0x20;
1061pub const IPOPT_RESERVED2: c_int = 0x60;
1062pub const IPOPT_RR: c_int = 7;
1063pub const IPOPT_SSRR: c_int = 137;
1064pub const IPOPT_TS: c_int = 68;
1065pub const IPOPT_TS_PRESPEC: c_int = 3;
1066pub const IPOPT_TS_TSANDADDR: c_int = 1;
1067pub const IPOPT_TS_TSONLY: c_int = 0;
1068pub const IPTOS_LOWDELAY: c_int = 16;
1069pub const IPTOS_PREC_CRITIC_ECP: c_int = 160;
1070pub const IPTOS_PREC_FLASH: c_int = 96;
1071pub const IPTOS_PREC_FLASHOVERRIDE: c_int = 128;
1072pub const IPTOS_PREC_IMMEDIATE: c_int = 64;
1073pub const IPTOS_PREC_INTERNETCONTROL: c_int = 192;
1074pub const IPTOS_PREC_NETCONTROL: c_int = 224;
1075pub const IPTOS_PREC_PRIORITY: c_int = 32;
1076pub const IPTOS_PREC_ROUTINE: c_int = 16;
1077pub const IPTOS_RELIABILITY: c_int = 4;
1078pub const IPTOS_THROUGHPUT: c_int = 8;
1079pub const IPVERSION: c_int = 4;
1080
1081// netinet/tcp.h
1082pub const TCP_NODELAY: c_int = 0x1;
1083pub const TCP_MAXSEG: c_int = 0x2;
1084pub const TCP_RFC1323: c_int = 0x4;
1085pub const TCP_KEEPALIVE: c_int = 0x8;
1086pub const TCP_KEEPIDLE: c_int = 0x11;
1087pub const TCP_KEEPINTVL: c_int = 0x12;
1088pub const TCP_KEEPCNT: c_int = 0x13;
1089pub const TCP_NODELAYACK: c_int = 0x14;
1090
1091// pthread.h
1092pub const PTHREAD_BARRIER_SERIAL_THREAD: c_int = 2;
1093pub const PTHREAD_CREATE_JOINABLE: c_int = 0;
1094pub const PTHREAD_CREATE_DETACHED: c_int = 1;
1095pub const PTHREAD_PROCESS_SHARED: c_int = 0;
1096pub const PTHREAD_PROCESS_PRIVATE: c_ushort = 1;
1097pub const PTHREAD_STACK_MIN: size_t = PAGESIZE as size_t * 4;
1098pub const PTHREAD_MUTEX_NORMAL: c_int = 5;
1099pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 3;
1100pub const PTHREAD_MUTEX_RECURSIVE: c_int = 4;
1101pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL;
1102pub const PTHREAD_MUTEX_ROBUST: c_int = 1;
1103pub const PTHREAD_MUTEX_STALLED: c_int = 0;
1104pub const PTHREAD_PRIO_INHERIT: c_int = 3;
1105pub const PTHREAD_PRIO_NONE: c_int = 1;
1106pub const PTHREAD_PRIO_PROTECT: c_int = 2;
1107
1108// regex.h
1109pub const REG_EXTENDED: c_int = 1;
1110pub const REG_ICASE: c_int = 2;
1111pub const REG_NEWLINE: c_int = 4;
1112pub const REG_NOSUB: c_int = 8;
1113pub const REG_NOTBOL: c_int = 0x100;
1114pub const REG_NOTEOL: c_int = 0x200;
1115pub const REG_NOMATCH: c_int = 1;
1116pub const REG_BADPAT: c_int = 2;
1117pub const REG_ECOLLATE: c_int = 3;
1118pub const REG_ECTYPE: c_int = 4;
1119pub const REG_EESCAPE: c_int = 5;
1120pub const REG_ESUBREG: c_int = 6;
1121pub const REG_EBRACK: c_int = 7;
1122pub const REG_EPAREN: c_int = 8;
1123pub const REG_EBRACE: c_int = 9;
1124pub const REG_BADBR: c_int = 10;
1125pub const REG_ERANGE: c_int = 11;
1126pub const REG_ESPACE: c_int = 12;
1127pub const REG_BADRPT: c_int = 13;
1128pub const REG_ECHAR: c_int = 14;
1129pub const REG_EBOL: c_int = 15;
1130pub const REG_EEOL: c_int = 16;
1131pub const REG_ENOSYS: c_int = 17;
1132
1133// rpcsvc/mount.h
1134pub const NFSMNT_SOFT: c_int = 0x001;
1135pub const NFSMNT_WSIZE: c_int = 0x002;
1136pub const NFSMNT_RSIZE: c_int = 0x004;
1137pub const NFSMNT_TIMEO: c_int = 0x008;
1138pub const NFSMNT_RETRANS: c_int = 0x010;
1139pub const NFSMNT_HOSTNAME: c_int = 0x020;
1140pub const NFSMNT_INT: c_int = 0x040;
1141pub const NFSMNT_NOAC: c_int = 0x080;
1142pub const NFSMNT_ACREGMIN: c_int = 0x0100;
1143pub const NFSMNT_ACREGMAX: c_int = 0x0200;
1144pub const NFSMNT_ACDIRMIN: c_int = 0x0400;
1145pub const NFSMNT_ACDIRMAX: c_int = 0x0800;
1146
1147// rpcsvc/rstat.h
1148pub const CPUSTATES: c_int = 4;
1149
1150// semaphore.h
1151pub const SEM_FAILED: *mut sem_t = -1isize as *mut crate::sem_t;
1152
1153// spawn.h
1154// DIFF(main): changed to `c_short` in f62eb023ab
1155pub const POSIX_SPAWN_SETPGROUP: c_int = 0x1;
1156pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x2;
1157pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x4;
1158pub const POSIX_SPAWN_SETSCHEDULER: c_int = 0x8;
1159pub const POSIX_SPAWN_SETSCHEDPARAM: c_int = 0x10;
1160pub const POSIX_SPAWN_RESETIDS: c_int = 0x20;
1161pub const POSIX_SPAWN_FORK_HANDLERS: c_int = 0x1000;
1162
1163// stdio.h
1164pub const EOF: c_int = -1;
1165pub const SEEK_SET: c_int = 0;
1166pub const SEEK_CUR: c_int = 1;
1167pub const SEEK_END: c_int = 2;
1168pub const _IOFBF: c_int = 0o000;
1169pub const _IONBF: c_int = 0o004;
1170pub const _IOLBF: c_int = 0o100;
1171pub const BUFSIZ: c_uint = 4096;
1172pub const FOPEN_MAX: c_uint = 32767;
1173pub const FILENAME_MAX: c_uint = 255;
1174pub const L_tmpnam: c_uint = 21;
1175pub const TMP_MAX: c_uint = 16384;
1176
1177// stdlib.h
1178pub const EXIT_FAILURE: c_int = 1;
1179pub const EXIT_SUCCESS: c_int = 0;
1180pub const RAND_MAX: c_int = 32767;
1181
1182// sys/access.h
1183pub const F_OK: c_int = 0;
1184pub const R_OK: c_int = 4;
1185pub const W_OK: c_int = 2;
1186pub const X_OK: c_int = 1;
1187
1188// sys/aio.h
1189pub const LIO_NOP: c_int = 0;
1190pub const LIO_READ: c_int = 1;
1191pub const LIO_WRITE: c_int = 2;
1192pub const LIO_NOWAIT: c_int = 0;
1193pub const LIO_WAIT: c_int = 1;
1194pub const AIO_ALLDONE: c_int = 2;
1195pub const AIO_CANCELED: c_int = 0;
1196pub const AIO_NOTCANCELED: c_int = 1;
1197
1198// sys/errno.h
1199pub const EPERM: c_int = 1;
1200pub const ENOENT: c_int = 2;
1201pub const ESRCH: c_int = 3;
1202pub const EINTR: c_int = 4;
1203pub const EIO: c_int = 5;
1204pub const ENXIO: c_int = 6;
1205pub const E2BIG: c_int = 7;
1206pub const ENOEXEC: c_int = 8;
1207pub const EBADF: c_int = 9;
1208pub const ECHILD: c_int = 10;
1209pub const EAGAIN: c_int = 11;
1210pub const ENOMEM: c_int = 12;
1211pub const EACCES: c_int = 13;
1212pub const EFAULT: c_int = 14;
1213pub const ENOTBLK: c_int = 15;
1214pub const EBUSY: c_int = 16;
1215pub const EEXIST: c_int = 17;
1216pub const EXDEV: c_int = 18;
1217pub const ENODEV: c_int = 19;
1218pub const ENOTDIR: c_int = 20;
1219pub const EISDIR: c_int = 21;
1220pub const EINVAL: c_int = 22;
1221pub const ENFILE: c_int = 23;
1222pub const EMFILE: c_int = 24;
1223pub const ENOTTY: c_int = 25;
1224pub const ETXTBSY: c_int = 26;
1225pub const EFBIG: c_int = 27;
1226pub const ENOSPC: c_int = 28;
1227pub const ESPIPE: c_int = 29;
1228pub const EROFS: c_int = 30;
1229pub const EMLINK: c_int = 31;
1230pub const EPIPE: c_int = 32;
1231pub const EDOM: c_int = 33;
1232pub const ERANGE: c_int = 34;
1233pub const ENOMSG: c_int = 35;
1234pub const EIDRM: c_int = 36;
1235pub const ECHRNG: c_int = 37;
1236pub const EL2NSYNC: c_int = 38;
1237pub const EL3HLT: c_int = 39;
1238pub const EL3RST: c_int = 40;
1239pub const ELNRNG: c_int = 41;
1240pub const EUNATCH: c_int = 42;
1241pub const ENOCSI: c_int = 43;
1242pub const EL2HLT: c_int = 44;
1243pub const EDEADLK: c_int = 45;
1244pub const ENOTREADY: c_int = 46;
1245pub const EWRPROTECT: c_int = 47;
1246pub const EFORMAT: c_int = 48;
1247pub const ENOLCK: c_int = 49;
1248pub const ENOCONNECT: c_int = 50;
1249pub const ESTALE: c_int = 52;
1250pub const EDIST: c_int = 53;
1251// POSIX allows EWOULDBLOCK to be the same value as EAGAIN.
1252pub const EWOULDBLOCK: c_int = EAGAIN;
1253pub const EINPROGRESS: c_int = 55;
1254pub const EALREADY: c_int = 56;
1255pub const ENOTSOCK: c_int = 57;
1256pub const EDESTADDRREQ: c_int = 58;
1257pub const EMSGSIZE: c_int = 59;
1258pub const EPROTOTYPE: c_int = 60;
1259pub const ENOPROTOOPT: c_int = 61;
1260pub const EPROTONOSUPPORT: c_int = 62;
1261pub const ESOCKTNOSUPPORT: c_int = 63;
1262pub const EOPNOTSUPP: c_int = 64;
1263pub const EPFNOSUPPORT: c_int = 65;
1264pub const EAFNOSUPPORT: c_int = 66;
1265pub const EADDRINUSE: c_int = 67;
1266pub const EADDRNOTAVAIL: c_int = 68;
1267pub const ENETDOWN: c_int = 69;
1268pub const ENETUNREACH: c_int = 70;
1269pub const ENETRESET: c_int = 71;
1270pub const ECONNABORTED: c_int = 72;
1271pub const ECONNRESET: c_int = 73;
1272pub const ENOBUFS: c_int = 74;
1273pub const EISCONN: c_int = 75;
1274pub const ENOTCONN: c_int = 76;
1275pub const ESHUTDOWN: c_int = 77;
1276pub const ETIMEDOUT: c_int = 78;
1277pub const ECONNREFUSED: c_int = 79;
1278pub const EHOSTDOWN: c_int = 80;
1279pub const EHOSTUNREACH: c_int = 81;
1280pub const ERESTART: c_int = 82;
1281pub const EPROCLIM: c_int = 83;
1282pub const EUSERS: c_int = 84;
1283pub const ELOOP: c_int = 85;
1284pub const ENAMETOOLONG: c_int = 86;
1285pub const ENOTEMPTY: c_int = 87;
1286pub const EDQUOT: c_int = 88;
1287pub const ECORRUPT: c_int = 89;
1288pub const ESYSERROR: c_int = 90;
1289pub const EREMOTE: c_int = 93;
1290pub const ENOTRECOVERABLE: c_int = 94;
1291pub const EOWNERDEAD: c_int = 95;
1292// errnos 96-108 reserved for future use compatible with AIX PS/2
1293pub const ENOSYS: c_int = 109;
1294pub const EMEDIA: c_int = 110;
1295pub const ESOFT: c_int = 111;
1296pub const ENOATTR: c_int = 112;
1297pub const ESAD: c_int = 113;
1298pub const ENOTRUST: c_int = 114;
1299pub const ETOOMANYREFS: c_int = 115;
1300pub const EILSEQ: c_int = 116;
1301pub const ECANCELED: c_int = 117;
1302pub const ENOSR: c_int = 118;
1303pub const ETIME: c_int = 119;
1304pub const EBADMSG: c_int = 120;
1305pub const EPROTO: c_int = 121;
1306pub const ENODATA: c_int = 122;
1307pub const ENOSTR: c_int = 123;
1308pub const ENOTSUP: c_int = 124;
1309pub const EMULTIHOP: c_int = 125;
1310pub const ENOLINK: c_int = 126;
1311pub const EOVERFLOW: c_int = 127;
1312
1313// sys/dr.h
1314pub const LPAR_INFO_FORMAT1: c_int = 1;
1315pub const LPAR_INFO_FORMAT2: c_int = 2;
1316pub const WPAR_INFO_FORMAT: c_int = 3;
1317pub const PROC_MODULE_INFO: c_int = 4;
1318pub const NUM_PROC_MODULE_TYPES: c_int = 5;
1319pub const LPAR_INFO_VRME_NUM_POOLS: c_int = 6;
1320pub const LPAR_INFO_VRME_POOLS: c_int = 7;
1321pub const LPAR_INFO_VRME_LPAR: c_int = 8;
1322pub const LPAR_INFO_VRME_RESET_HWMARKS: c_int = 9;
1323pub const LPAR_INFO_VRME_ALLOW_DESIRED: c_int = 10;
1324pub const EMTP_INFO_FORMAT: c_int = 11;
1325pub const LPAR_INFO_LPM_CAPABILITY: c_int = 12;
1326pub const ENERGYSCALE_INFO: c_int = 13;
1327
1328// sys/file.h
1329pub const LOCK_SH: c_int = 1;
1330pub const LOCK_EX: c_int = 2;
1331pub const LOCK_NB: c_int = 4;
1332pub const LOCK_UN: c_int = 8;
1333
1334// sys/flock.h
1335pub const F_RDLCK: c_short = 0o01;
1336pub const F_WRLCK: c_short = 0o02;
1337pub const F_UNLCK: c_short = 0o03;
1338
1339// sys/fs/quota_common.h
1340pub const Q_QUOTAON: c_int = 0x100;
1341pub const Q_QUOTAOFF: c_int = 0x200;
1342pub const Q_SETUSE: c_int = 0x500;
1343pub const Q_SYNC: c_int = 0x600;
1344pub const Q_GETQUOTA: c_int = 0x300;
1345pub const Q_SETQLIM: c_int = 0x400;
1346pub const Q_SETQUOTA: c_int = 0x400;
1347
1348// sys/ioctl.h
1349pub const IOCPARM_MASK: c_int = 0x7f;
1350pub const IOC_VOID: c_int = 0x20000000;
1351pub const IOC_OUT: c_int = 0x40000000;
1352pub const IOC_IN: c_int = 0x40000000 << 1;
1353pub const IOC_INOUT: c_int = IOC_IN | IOC_OUT;
1354pub const FIOCLEX: c_int = 0x20006601;
1355pub const FIONCLEX: c_int = 0x20006602;
1356pub const FIONREAD: c_int = 0x4004667f;
1357pub const FIONBIO: c_int = u32_cast_int(0x8004667e);
1358pub const FIOASYNC: c_int = u32_cast_int(0x8004667d);
1359pub const FIOSETOWN: c_int = u32_cast_int(0x8004667c);
1360pub const FIOGETOWN: c_int = 0x4004667b;
1361pub const TIOCGETD: c_int = 0x40047400;
1362pub const TIOCSETD: c_int = u32_cast_int(0x80047401);
1363pub const TIOCHPCL: c_int = 0x20007402;
1364pub const TIOCMODG: c_int = 0x40047403;
1365pub const TIOCMODS: c_int = u32_cast_int(0x80047404);
1366pub const TIOCM_LE: c_int = 0x1;
1367pub const TIOCM_DTR: c_int = 0x2;
1368pub const TIOCM_RTS: c_int = 0x4;
1369pub const TIOCM_ST: c_int = 0x8;
1370pub const TIOCM_SR: c_int = 0x10;
1371pub const TIOCM_CTS: c_int = 0x20;
1372pub const TIOCM_CAR: c_int = 0x40;
1373pub const TIOCM_CD: c_int = 0x40;
1374pub const TIOCM_RNG: c_int = 0x80;
1375pub const TIOCM_RI: c_int = 0x80;
1376pub const TIOCM_DSR: c_int = 0x100;
1377pub const TIOCGETP: c_int = 0x40067408;
1378pub const TIOCSETP: c_int = u32_cast_int(0x80067409);
1379pub const TIOCSETN: c_int = u32_cast_int(0x8006740a);
1380pub const TIOCEXCL: c_int = 0x2000740d;
1381pub const TIOCNXCL: c_int = 0x2000740e;
1382pub const TIOCFLUSH: c_int = u32_cast_int(0x80047410);
1383pub const TIOCSETC: c_int = u32_cast_int(0x80067411);
1384pub const TIOCGETC: c_int = 0x40067412;
1385pub const TANDEM: c_int = 0x1;
1386pub const CBREAK: c_int = 0x2;
1387pub const LCASE: c_int = 0x4;
1388pub const MDMBUF: c_int = 0x800000;
1389pub const XTABS: c_int = 0xc00;
1390pub const SIOCADDMULTI: c_int = u32_cast_int(0x80206931);
1391pub const SIOCADDRT: c_int = u32_cast_int(0x8038720a);
1392pub const SIOCDARP: c_int = u32_cast_int(0x804c6920);
1393pub const SIOCDELMULTI: c_int = u32_cast_int(0x80206932);
1394pub const SIOCDELRT: c_int = u32_cast_int(0x8038720b);
1395pub const SIOCDIFADDR: c_int = u32_cast_int(0x80286919);
1396pub const SIOCGARP: c_int = u32_cast_int(0xc04c6926);
1397pub const SIOCGIFADDR: c_int = u32_cast_int(0xc0286921);
1398pub const SIOCGIFBRDADDR: c_int = u32_cast_int(0xc0286923);
1399pub const SIOCGIFCONF: c_int = u32_cast_int(0xc0106945);
1400pub const SIOCGIFDSTADDR: c_int = u32_cast_int(0xc0286922);
1401pub const SIOCGIFFLAGS: c_int = u32_cast_int(0xc0286911);
1402pub const SIOCGIFHWADDR: c_int = u32_cast_int(0xc0546995);
1403pub const SIOCGIFMETRIC: c_int = u32_cast_int(0xc0286917);
1404pub const SIOCGIFMTU: c_int = u32_cast_int(0xc0286956);
1405pub const SIOCGIFNETMASK: c_int = u32_cast_int(0xc0286925);
1406pub const SIOCSARP: c_int = u32_cast_int(0x804c691e);
1407pub const SIOCSIFADDR: c_int = u32_cast_int(0x8028690c);
1408pub const SIOCSIFBRDADDR: c_int = u32_cast_int(0x80286913);
1409pub const SIOCSIFDSTADDR: c_int = u32_cast_int(0x8028690e);
1410pub const SIOCSIFFLAGS: c_int = u32_cast_int(0x80286910);
1411pub const SIOCSIFMETRIC: c_int = u32_cast_int(0x80286918);
1412pub const SIOCSIFMTU: c_int = u32_cast_int(0x80286958);
1413pub const SIOCSIFNETMASK: c_int = u32_cast_int(0x80286916);
1414pub const TIOCUCNTL: c_int = u32_cast_int(0x80047466);
1415pub const TIOCCONS: c_int = u32_cast_int(0x80047462);
1416pub const TIOCPKT: c_int = u32_cast_int(0x80047470);
1417pub const TIOCPKT_DATA: c_int = 0;
1418pub const TIOCPKT_FLUSHREAD: c_int = 1;
1419pub const TIOCPKT_FLUSHWRITE: c_int = 2;
1420pub const TIOCPKT_NOSTOP: c_int = 0x10;
1421pub const TIOCPKT_DOSTOP: c_int = 0x20;
1422pub const TIOCPKT_START: c_int = 8;
1423pub const TIOCPKT_STOP: c_int = 4;
1424
1425// sys/ipc.h
1426pub const IPC_ALLOC: c_int = 0o100000;
1427pub const IPC_CREAT: c_int = 0o020000;
1428pub const IPC_EXCL: c_int = 0o002000;
1429pub const IPC_NOWAIT: c_int = 0o004000;
1430pub const IPC_RMID: c_int = 0;
1431pub const IPC_SET: c_int = 101;
1432pub const IPC_R: c_int = 0o0400;
1433pub const IPC_W: c_int = 0o0200;
1434pub const IPC_O: c_int = 0o1000;
1435pub const IPC_NOERROR: c_int = 0o10000;
1436pub const IPC_STAT: c_int = 102;
1437pub const IPC_PRIVATE: crate::key_t = -1;
1438pub const SHM_LOCK: c_int = 201;
1439pub const SHM_UNLOCK: c_int = 202;
1440
1441// sys/ldr.h
1442pub const L_GETMESSAGES: c_int = 1;
1443pub const L_GETINFO: c_int = 2;
1444pub const L_GETLIBPATH: c_int = 3;
1445pub const L_GETKERNINFO: c_int = 4;
1446pub const L_GETLIB32INFO: c_int = 5;
1447pub const L_GETLIB64INFO: c_int = 6;
1448pub const L_GETPROCINFO: c_int = 7;
1449pub const L_GETXINFO: c_int = 8;
1450
1451// sys/limits.h
1452
1453/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines)
1454/// for details.
1455pub const PATH_MAX: c_int = 1023;
1456
1457pub const PAGESIZE: c_int = 4096;
1458pub const IOV_MAX: c_int = 16;
1459pub const AIO_LISTIO_MAX: c_int = 4096;
1460pub const PIPE_BUF: usize = 32768;
1461pub const OPEN_MAX: c_int = 65534;
1462pub const MAX_INPUT: c_int = 512;
1463pub const MAX_CANON: c_int = 256;
1464pub const ARG_MAX: c_int = 1048576;
1465
1466/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines)
1467/// for details.
1468pub const BC_BASE_MAX: c_int = 99;
1469
1470/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines)
1471/// for details.
1472pub const BC_DIM_MAX: c_int = 0x800;
1473
1474/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines)
1475/// for details.
1476pub const BC_SCALE_MAX: c_int = 99;
1477
1478/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines)
1479/// for details.
1480pub const BC_STRING_MAX: c_int = 0x800;
1481
1482/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines)
1483/// for details.
1484pub const CHARCLASS_NAME_MAX: c_int = 14;
1485
1486pub const CHILD_MAX: c_int = 128;
1487
1488/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines)
1489/// for details.
1490pub const COLL_WEIGHTS_MAX: c_int = 4;
1491
1492/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines)
1493/// for details.
1494pub const EXPR_NEST_MAX: c_int = 32;
1495
1496pub const NZERO: c_int = 20;
1497
1498// sys/lockf.h
1499pub const F_LOCK: c_int = 1;
1500pub const F_TEST: c_int = 3;
1501pub const F_TLOCK: c_int = 2;
1502pub const F_ULOCK: c_int = 0;
1503
1504// sys/machine.h
1505pub const BIG_ENDIAN: c_int = 4321;
1506pub const LITTLE_ENDIAN: c_int = 1234;
1507pub const PDP_ENDIAN: c_int = 3412;
1508
1509// sys/mman.h
1510pub const PROT_NONE: c_int = 0;
1511pub const PROT_READ: c_int = 1;
1512pub const PROT_WRITE: c_int = 2;
1513pub const PROT_EXEC: c_int = 4;
1514pub const MAP_FILE: c_int = 0;
1515pub const MAP_SHARED: c_int = 1;
1516pub const MAP_PRIVATE: c_int = 2;
1517pub const MAP_FIXED: c_int = 0x100;
1518pub const MAP_ANON: c_int = 0x10;
1519pub const MAP_ANONYMOUS: c_int = 0x10;
1520pub const MAP_FAILED: *mut c_void = !0 as *mut c_void;
1521pub const MAP_TYPE: c_int = 0xf0;
1522pub const MCL_CURRENT: c_int = 0x100;
1523pub const MCL_FUTURE: c_int = 0x200;
1524pub const MS_SYNC: c_int = 0x20;
1525pub const MS_ASYNC: c_int = 0x10;
1526pub const MS_INVALIDATE: c_int = 0x40;
1527pub const POSIX_MADV_NORMAL: c_int = 1;
1528pub const POSIX_MADV_RANDOM: c_int = 3;
1529pub const POSIX_MADV_SEQUENTIAL: c_int = 2;
1530pub const POSIX_MADV_WILLNEED: c_int = 4;
1531pub const POSIX_MADV_DONTNEED: c_int = 5;
1532pub const MADV_NORMAL: c_int = 0;
1533pub const MADV_RANDOM: c_int = 1;
1534pub const MADV_SEQUENTIAL: c_int = 2;
1535pub const MADV_WILLNEED: c_int = 3;
1536pub const MADV_DONTNEED: c_int = 4;
1537
1538// sys/mode.h
1539pub const S_IFMT: mode_t = 0o17_0000;
1540pub const S_IFREG: mode_t = 0o10_0000;
1541pub const S_IFDIR: mode_t = 0o4_0000;
1542pub const S_IFBLK: mode_t = 0o6_0000;
1543pub const S_IFCHR: mode_t = 0o2_0000;
1544pub const S_IFIFO: mode_t = 0o1_0000;
1545pub const S_IRWXU: mode_t = 0o0700;
1546pub const S_IRUSR: mode_t = 0o0400;
1547pub const S_IWUSR: mode_t = 0o0200;
1548pub const S_IXUSR: mode_t = 0o0100;
1549pub const S_IRWXG: mode_t = 0o0070;
1550pub const S_IRGRP: mode_t = 0o0040;
1551pub const S_IWGRP: mode_t = 0o0020;
1552pub const S_IXGRP: mode_t = 0o0010;
1553pub const S_IRWXO: mode_t = 0o0007;
1554pub const S_IROTH: mode_t = 0o0004;
1555pub const S_IWOTH: mode_t = 0o0002;
1556pub const S_IXOTH: mode_t = 0o0001;
1557pub const S_IFLNK: mode_t = 0o12_0000;
1558pub const S_IFSOCK: mode_t = 0o14_0000;
1559pub const S_IEXEC: mode_t = 0o0100;
1560pub const S_IWRITE: mode_t = 0o0200;
1561pub const S_IREAD: mode_t = 0o0400;
1562
1563// sys/msg.h
1564pub const MSG_NOERROR: c_int = 0o10000;
1565
1566// sys/m_signal.h
1567pub const SIGSTKSZ: size_t = 4096;
1568pub const MINSIGSTKSZ: size_t = 1200;
1569
1570// sys/params.h
1571pub const MAXPATHLEN: c_int = PATH_MAX + 1;
1572pub const MAXSYMLINKS: c_int = 20;
1573pub const MAXHOSTNAMELEN: c_int = 256;
1574pub const MAXUPRC: c_int = 128;
1575
1576/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines)
1577/// for details.
1578pub const NGROUPS_MAX: c_ulong = 2048;
1579
1580pub const NGROUPS: c_ulong = NGROUPS_MAX;
1581pub const NOFILE: c_int = OPEN_MAX;
1582
1583// sys/poll.h
1584pub const POLLIN: c_short = 0x0001;
1585pub const POLLPRI: c_short = 0x0004;
1586pub const POLLOUT: c_short = 0x0002;
1587pub const POLLERR: c_short = 0x4000;
1588pub const POLLHUP: c_short = 0x2000;
1589pub const POLLMSG: c_short = 0x0080;
1590pub const POLLSYNC: c_short = u16_cast_short(0x8000);
1591pub const POLLNVAL: c_short = POLLSYNC;
1592pub const POLLNORM: c_short = POLLIN;
1593pub const POLLRDNORM: c_short = 0x0010;
1594pub const POLLWRNORM: c_short = POLLOUT;
1595pub const POLLRDBAND: c_short = 0x0020;
1596pub const POLLWRBAND: c_short = 0x0040;
1597
1598// sys/pollset.h
1599pub const PS_ADD: c_uchar = 0;
1600pub const PS_MOD: c_uchar = 1;
1601pub const PS_DELETE: c_uchar = 2;
1602pub const PS_REPLACE: c_uchar = 3;
1603
1604// sys/ptrace.h
1605pub const PT_TRACE_ME: c_int = 0;
1606pub const PT_READ_I: c_int = 1;
1607pub const PT_READ_D: c_int = 2;
1608pub const PT_WRITE_I: c_int = 4;
1609pub const PT_WRITE_D: c_int = 5;
1610pub const PT_CONTINUE: c_int = 7;
1611pub const PT_KILL: c_int = 8;
1612pub const PT_STEP: c_int = 9;
1613pub const PT_READ_GPR: c_int = 11;
1614pub const PT_READ_FPR: c_int = 12;
1615pub const PT_WRITE_GPR: c_int = 14;
1616pub const PT_WRITE_FPR: c_int = 15;
1617pub const PT_READ_BLOCK: c_int = 17;
1618pub const PT_WRITE_BLOCK: c_int = 19;
1619pub const PT_ATTACH: c_int = 30;
1620pub const PT_DETACH: c_int = 31;
1621pub const PT_REGSET: c_int = 32;
1622pub const PT_REATT: c_int = 33;
1623pub const PT_LDINFO: c_int = 34;
1624pub const PT_MULTI: c_int = 35;
1625pub const PT_NEXT: c_int = 36;
1626pub const PT_SET: c_int = 37;
1627pub const PT_CLEAR: c_int = 38;
1628pub const PT_LDXINFO: c_int = 39;
1629pub const PT_QUERY: c_int = 40;
1630pub const PT_WATCH: c_int = 41;
1631pub const PTT_CONTINUE: c_int = 50;
1632pub const PTT_STEP: c_int = 51;
1633pub const PTT_READ_SPRS: c_int = 52;
1634pub const PTT_WRITE_SPRS: c_int = 53;
1635pub const PTT_READ_GPRS: c_int = 54;
1636pub const PTT_WRITE_GPRS: c_int = 55;
1637pub const PTT_READ_FPRS: c_int = 56;
1638pub const PTT_WRITE_FPRS: c_int = 57;
1639pub const PTT_READ_VEC: c_int = 58;
1640pub const PTT_WRITE_VEC: c_int = 59;
1641pub const PTT_WATCH: c_int = 60;
1642pub const PTT_SET_TRAP: c_int = 61;
1643pub const PTT_CLEAR_TRAP: c_int = 62;
1644pub const PTT_READ_UKEYSET: c_int = 63;
1645pub const PT_GET_UKEY: c_int = 64;
1646pub const PTT_READ_FPSCR_HI: c_int = 65;
1647pub const PTT_WRITE_FPSCR_HI: c_int = 66;
1648pub const PTT_READ_VSX: c_int = 67;
1649pub const PTT_WRITE_VSX: c_int = 68;
1650pub const PTT_READ_TM: c_int = 69;
1651pub const PTRACE_ATTACH: c_int = 14;
1652pub const PTRACE_CONT: c_int = 7;
1653pub const PTRACE_DETACH: c_int = 15;
1654pub const PTRACE_GETFPREGS: c_int = 12;
1655pub const PTRACE_GETREGS: c_int = 10;
1656pub const PTRACE_KILL: c_int = 8;
1657pub const PTRACE_PEEKDATA: c_int = 2;
1658pub const PTRACE_PEEKTEXT: c_int = 1;
1659pub const PTRACE_PEEKUSER: c_int = 3;
1660pub const PTRACE_POKEDATA: c_int = 5;
1661pub const PTRACE_POKETEXT: c_int = 4;
1662pub const PTRACE_POKEUSER: c_int = 6;
1663pub const PTRACE_SETFPREGS: c_int = 13;
1664pub const PTRACE_SETREGS: c_int = 11;
1665pub const PTRACE_SINGLESTEP: c_int = 9;
1666pub const PTRACE_SYSCALL: c_int = 16;
1667pub const PTRACE_TRACEME: c_int = 0;
1668
1669// sys/resource.h
1670pub const RLIMIT_CPU: c_int = 0;
1671pub const RLIMIT_FSIZE: c_int = 1;
1672pub const RLIMIT_DATA: c_int = 2;
1673pub const RLIMIT_STACK: c_int = 3;
1674pub const RLIMIT_CORE: c_int = 4;
1675pub const RLIMIT_RSS: c_int = 5;
1676pub const RLIMIT_AS: c_int = 6;
1677pub const RLIMIT_NOFILE: c_int = 7;
1678pub const RLIMIT_THREADS: c_int = 8;
1679pub const RLIMIT_NPROC: c_int = 9;
1680pub const RUSAGE_SELF: c_int = 0;
1681pub const RUSAGE_CHILDREN: c_int = -1;
1682pub const PRIO_PROCESS: c_int = 0;
1683pub const PRIO_PGRP: c_int = 1;
1684pub const PRIO_USER: c_int = 2;
1685pub const RUSAGE_THREAD: c_int = 1;
1686pub const RLIM_SAVED_MAX: c_ulong = RLIM_INFINITY - 1;
1687pub const RLIM_SAVED_CUR: c_ulong = RLIM_INFINITY - 2;
1688#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
1689pub const RLIM_NLIMITS: c_int = 10;
1690
1691// sys/sched.h
1692pub const SCHED_OTHER: c_int = 0;
1693pub const SCHED_FIFO: c_int = 1;
1694pub const SCHED_RR: c_int = 2;
1695pub const SCHED_LOCAL: c_int = 3;
1696pub const SCHED_GLOBAL: c_int = 4;
1697pub const SCHED_FIFO2: c_int = 5;
1698pub const SCHED_FIFO3: c_int = 6;
1699pub const SCHED_FIFO4: c_int = 7;
1700
1701// sys/sem.h
1702pub const SEM_UNDO: c_int = 0o10000;
1703pub const GETNCNT: c_int = 3;
1704pub const GETPID: c_int = 4;
1705pub const GETVAL: c_int = 5;
1706pub const GETALL: c_int = 6;
1707pub const GETZCNT: c_int = 7;
1708pub const SETVAL: c_int = 8;
1709pub const SETALL: c_int = 9;
1710
1711// sys/shm.h
1712pub const SHMLBA: c_int = 0x10000000;
1713pub const SHMLBA_EXTSHM: c_int = 0x1000;
1714pub const SHM_SHMAT: c_int = u32_cast_int(0x80000000);
1715pub const SHM_RDONLY: c_int = 0o10000;
1716pub const SHM_RND: c_int = 0o20000;
1717pub const SHM_PIN: c_int = 0o4000;
1718pub const SHM_LGPAGE: c_int = u32_cast_int(0o20000000000);
1719pub const SHM_MAP: c_int = 0o4000;
1720pub const SHM_FMAP: c_int = 0o2000;
1721pub const SHM_COPY: c_int = 0o40000;
1722pub const SHM_CLEAR: c_int = 0;
1723pub const SHM_HGSEG: c_int = 0o10000000000;
1724pub const SHM_R: c_int = IPC_R;
1725pub const SHM_W: c_int = IPC_W;
1726pub const SHM_DEST: c_int = 0o2000;
1727
1728// sys/signal.h
1729pub const SA_ONSTACK: c_int = 0x00000001;
1730pub const SA_RESETHAND: c_int = 0x00000002;
1731pub const SA_RESTART: c_int = 0x00000008;
1732pub const SA_SIGINFO: c_int = 0x00000100;
1733pub const SA_NODEFER: c_int = 0x00000200;
1734pub const SA_NOCLDWAIT: c_int = 0x00000400;
1735pub const SA_NOCLDSTOP: c_int = 0x00000004;
1736pub const SS_ONSTACK: c_int = 0x00000001;
1737pub const SS_DISABLE: c_int = 0x00000002;
1738pub const SIGCHLD: c_int = 20;
1739pub const SIGBUS: c_int = 10;
1740pub const SIG_BLOCK: c_int = 0;
1741pub const SIG_UNBLOCK: c_int = 1;
1742pub const SIG_SETMASK: c_int = 2;
1743pub const SIGEV_NONE: c_int = 1;
1744pub const SIGEV_SIGNAL: c_int = 2;
1745pub const SIGEV_THREAD: c_int = 3;
1746pub const SIGHUP: c_int = 1;
1747pub const SIGINT: c_int = 2;
1748pub const SIGQUIT: c_int = 3;
1749pub const SIGILL: c_int = 4;
1750pub const SIGABRT: c_int = 6;
1751pub const SIGEMT: c_int = 7;
1752pub const SIGFPE: c_int = 8;
1753pub const SIGKILL: c_int = 9;
1754pub const SIGSEGV: c_int = 11;
1755pub const SIGSYS: c_int = 12;
1756pub const SIGPIPE: c_int = 13;
1757pub const SIGALRM: c_int = 14;
1758pub const SIGTERM: c_int = 15;
1759pub const SIGUSR1: c_int = 30;
1760pub const SIGUSR2: c_int = 31;
1761pub const SIGPWR: c_int = 29;
1762pub const SIGWINCH: c_int = 28;
1763pub const SIGURG: c_int = 16;
1764pub const SIGPOLL: c_int = SIGIO;
1765pub const SIGIO: c_int = 23;
1766pub const SIGSTOP: c_int = 17;
1767pub const SIGTSTP: c_int = 18;
1768pub const SIGCONT: c_int = 19;
1769pub const SIGTTIN: c_int = 21;
1770pub const SIGTTOU: c_int = 22;
1771pub const SIGVTALRM: c_int = 34;
1772pub const SIGPROF: c_int = 32;
1773pub const SIGXCPU: c_int = 24;
1774pub const SIGXFSZ: c_int = 25;
1775pub const SIGTRAP: c_int = 5;
1776pub const SIGCLD: c_int = 20;
1777
1778/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines)
1779/// for details.
1780pub const SIGRTMAX: c_int = 57;
1781
1782pub const SIGRTMIN: c_int = 50;
1783pub const SI_USER: c_int = 0;
1784pub const SI_UNDEFINED: c_int = 8;
1785pub const SI_EMPTY: c_int = 9;
1786pub const BUS_ADRALN: c_int = 1;
1787pub const BUS_ADRERR: c_int = 2;
1788pub const BUS_OBJERR: c_int = 3;
1789pub const BUS_UEGARD: c_int = 4;
1790pub const CLD_EXITED: c_int = 10;
1791pub const CLD_KILLED: c_int = 11;
1792pub const CLD_DUMPED: c_int = 12;
1793pub const CLD_TRAPPED: c_int = 13;
1794pub const CLD_STOPPED: c_int = 14;
1795pub const CLD_CONTINUED: c_int = 15;
1796pub const FPE_INTDIV: c_int = 20;
1797pub const FPE_INTOVF: c_int = 21;
1798pub const FPE_FLTDIV: c_int = 22;
1799pub const FPE_FLTOVF: c_int = 23;
1800pub const FPE_FLTUND: c_int = 24;
1801pub const FPE_FLTRES: c_int = 25;
1802pub const FPE_FLTINV: c_int = 26;
1803pub const FPE_FLTSUB: c_int = 27;
1804pub const ILL_ILLOPC: c_int = 30;
1805pub const ILL_ILLOPN: c_int = 31;
1806pub const ILL_ILLADR: c_int = 32;
1807pub const ILL_ILLTRP: c_int = 33;
1808pub const ILL_PRVOPC: c_int = 34;
1809pub const ILL_PRVREG: c_int = 35;
1810pub const ILL_COPROC: c_int = 36;
1811pub const ILL_BADSTK: c_int = 37;
1812pub const ILL_TMBADTHING: c_int = 38;
1813pub const POLL_IN: c_int = 40;
1814pub const POLL_OUT: c_int = 41;
1815pub const POLL_MSG: c_int = -3;
1816pub const POLL_ERR: c_int = 43;
1817pub const POLL_PRI: c_int = 44;
1818pub const POLL_HUP: c_int = 45;
1819pub const SEGV_MAPERR: c_int = 50;
1820pub const SEGV_ACCERR: c_int = 51;
1821pub const SEGV_KEYERR: c_int = 52;
1822pub const TRAP_BRKPT: c_int = 60;
1823pub const TRAP_TRACE: c_int = 61;
1824pub const SI_QUEUE: c_int = 71;
1825pub const SI_TIMER: c_int = 72;
1826pub const SI_ASYNCIO: c_int = 73;
1827pub const SI_MESGQ: c_int = 74;
1828
1829// sys/socket.h
1830pub const AF_UNSPEC: c_int = 0;
1831pub const AF_UNIX: c_int = 1;
1832pub const AF_INET: c_int = 2;
1833pub const AF_IMPLINK: c_int = 3;
1834pub const AF_PUP: c_int = 4;
1835pub const AF_CHAOS: c_int = 5;
1836pub const AF_NS: c_int = 6;
1837pub const AF_ECMA: c_int = 8;
1838pub const AF_DATAKIT: c_int = 9;
1839pub const AF_CCITT: c_int = 10;
1840pub const AF_SNA: c_int = 11;
1841pub const AF_DECnet: c_int = 12;
1842pub const AF_DLI: c_int = 13;
1843pub const AF_LAT: c_int = 14;
1844pub const SO_TIMESTAMPNS: c_int = 0x100a;
1845pub const SOMAXCONN: c_int = 1024;
1846pub const AF_LOCAL: c_int = AF_UNIX;
1847pub const UIO_MAXIOV: c_int = 1024;
1848pub const pseudo_AF_XTP: c_int = 19;
1849pub const AF_HYLINK: c_int = 15;
1850pub const AF_APPLETALK: c_int = 16;
1851pub const AF_ISO: c_int = 7;
1852pub const AF_OSI: c_int = AF_ISO;
1853pub const AF_ROUTE: c_int = 17;
1854pub const AF_LINK: c_int = 18;
1855pub const AF_INET6: c_int = 24;
1856pub const AF_INTF: c_int = 20;
1857pub const AF_RIF: c_int = 21;
1858pub const AF_NDD: c_int = 23;
1859
1860/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines)
1861/// for details.
1862pub const AF_MAX: c_int = 30;
1863
1864pub const PF_UNSPEC: c_int = AF_UNSPEC;
1865pub const PF_UNIX: c_int = AF_UNIX;
1866pub const PF_INET: c_int = AF_INET;
1867pub const PF_IMPLINK: c_int = AF_IMPLINK;
1868pub const PF_PUP: c_int = AF_PUP;
1869pub const PF_CHAOS: c_int = AF_CHAOS;
1870pub const PF_NS: c_int = AF_NS;
1871pub const PF_ISO: c_int = AF_ISO;
1872pub const PF_OSI: c_int = AF_ISO;
1873pub const PF_ECMA: c_int = AF_ECMA;
1874pub const PF_DATAKIT: c_int = AF_DATAKIT;
1875pub const PF_CCITT: c_int = AF_CCITT;
1876pub const PF_SNA: c_int = AF_SNA;
1877pub const PF_DECnet: c_int = AF_DECnet;
1878pub const PF_DLI: c_int = AF_DLI;
1879pub const PF_LAT: c_int = AF_LAT;
1880pub const PF_HYLINK: c_int = AF_HYLINK;
1881pub const PF_APPLETALK: c_int = AF_APPLETALK;
1882pub const PF_ROUTE: c_int = AF_ROUTE;
1883pub const PF_LINK: c_int = AF_LINK;
1884pub const PF_XTP: c_int = 19;
1885pub const PF_RIF: c_int = AF_RIF;
1886pub const PF_INTF: c_int = AF_INTF;
1887pub const PF_NDD: c_int = AF_NDD;
1888pub const PF_INET6: c_int = AF_INET6;
1889
1890/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines)
1891/// for details.
1892pub const PF_MAX: c_int = AF_MAX;
1893
1894pub const SF_CLOSE: c_int = 1;
1895pub const SF_REUSE: c_int = 2;
1896pub const SF_DONT_CACHE: c_int = 4;
1897pub const SF_SYNC_CACHE: c_int = 8;
1898pub const SOCK_DGRAM: c_int = 2;
1899pub const SOCK_STREAM: c_int = 1;
1900pub const SOCK_RAW: c_int = 3;
1901pub const SOCK_RDM: c_int = 4;
1902pub const SOCK_SEQPACKET: c_int = 5;
1903pub const SOL_SOCKET: c_int = 0xffff;
1904pub const SO_DEBUG: c_int = 0x0001;
1905pub const SO_ACCEPTCONN: c_int = 0x0002;
1906pub const SO_REUSEADDR: c_int = 0x0004;
1907pub const SO_KEEPALIVE: c_int = 0x0008;
1908pub const SO_DONTROUTE: c_int = 0x0010;
1909pub const SO_BROADCAST: c_int = 0x0020;
1910pub const SO_USELOOPBACK: c_int = 0x0040;
1911pub const SO_LINGER: c_int = 0x0080;
1912pub const SO_OOBINLINE: c_int = 0x0100;
1913pub const SO_REUSEPORT: c_int = 0x0200;
1914pub const SO_USE_IFBUFS: c_int = 0x0400;
1915pub const SO_CKSUMRECV: c_int = 0x0800;
1916pub const SO_NOREUSEADDR: c_int = 0x1000;
1917pub const SO_KERNACCEPT: c_int = 0x2000;
1918pub const SO_NOMULTIPATH: c_int = 0x4000;
1919pub const SO_AUDIT: c_int = 0x8000;
1920pub const SO_SNDBUF: c_int = 0x1001;
1921pub const SO_RCVBUF: c_int = 0x1002;
1922pub const SO_SNDLOWAT: c_int = 0x1003;
1923pub const SO_RCVLOWAT: c_int = 0x1004;
1924pub const SO_SNDTIMEO: c_int = 0x1005;
1925pub const SO_RCVTIMEO: c_int = 0x1006;
1926pub const SO_ERROR: c_int = 0x1007;
1927pub const SO_TYPE: c_int = 0x1008;
1928pub const SCM_RIGHTS: c_int = 0x01;
1929pub const MSG_OOB: c_int = 0x1;
1930pub const MSG_PEEK: c_int = 0x2;
1931pub const MSG_DONTROUTE: c_int = 0x4;
1932pub const MSG_EOR: c_int = 0x8;
1933pub const MSG_TRUNC: c_int = 0x10;
1934pub const MSG_CTRUNC: c_int = 0x20;
1935pub const MSG_WAITALL: c_int = 0x40;
1936pub const MSG_MPEG2: c_int = 0x80;
1937pub const MSG_NOSIGNAL: c_int = 0x100;
1938pub const MSG_WAITFORONE: c_int = 0x200;
1939pub const MSG_ARGEXT: c_int = 0x400;
1940pub const MSG_NONBLOCK: c_int = 0x4000;
1941pub const MSG_COMPAT: c_int = 0x8000;
1942pub const MSG_MAXIOVLEN: c_int = 16;
1943pub const SHUT_RD: c_int = 0;
1944pub const SHUT_WR: c_int = 1;
1945pub const SHUT_RDWR: c_int = 2;
1946
1947// sys/stat.h
1948pub const UTIME_NOW: c_int = -2;
1949pub const UTIME_OMIT: c_int = -3;
1950
1951// sys/statvfs.h
1952pub const ST_RDONLY: c_ulong = 0x0001;
1953pub const ST_NOSUID: c_ulong = 0x0040;
1954pub const ST_NODEV: c_ulong = 0x0080;
1955
1956// sys/stropts.h
1957pub const I_NREAD: c_int = 0x20005301;
1958pub const I_PUSH: c_int = 0x20005302;
1959pub const I_POP: c_int = 0x20005303;
1960pub const I_LOOK: c_int = 0x20005304;
1961pub const I_FLUSH: c_int = 0x20005305;
1962pub const I_SRDOPT: c_int = 0x20005306;
1963pub const I_GRDOPT: c_int = 0x20005307;
1964pub const I_STR: c_int = 0x20005308;
1965pub const I_SETSIG: c_int = 0x20005309;
1966pub const I_GETSIG: c_int = 0x2000530a;
1967pub const I_FIND: c_int = 0x2000530b;
1968pub const I_LINK: c_int = 0x2000530c;
1969pub const I_UNLINK: c_int = 0x2000530d;
1970pub const I_PEEK: c_int = 0x2000530f;
1971pub const I_FDINSERT: c_int = 0x20005310;
1972pub const I_SENDFD: c_int = 0x20005311;
1973pub const I_RECVFD: c_int = 0x20005312;
1974pub const I_SWROPT: c_int = 0x20005314;
1975pub const I_GWROPT: c_int = 0x20005315;
1976pub const I_LIST: c_int = 0x20005316;
1977pub const I_PLINK: c_int = 0x2000531d;
1978pub const I_PUNLINK: c_int = 0x2000531e;
1979pub const I_FLUSHBAND: c_int = 0x20005313;
1980pub const I_CKBAND: c_int = 0x20005318;
1981pub const I_GETBAND: c_int = 0x20005319;
1982pub const I_ATMARK: c_int = 0x20005317;
1983pub const I_SETCLTIME: c_int = 0x2000531b;
1984pub const I_GETCLTIME: c_int = 0x2000531c;
1985pub const I_CANPUT: c_int = 0x2000531a;
1986
1987// sys/syslog.h
1988pub const LOG_CRON: c_int = 9 << 3;
1989pub const LOG_AUTHPRIV: c_int = 10 << 3;
1990pub const LOG_NFACILITIES: c_int = 24;
1991pub const LOG_PERROR: c_int = 0x20;
1992
1993// sys/systemcfg.h
1994pub const SC_ARCH: c_int = 1;
1995pub const SC_IMPL: c_int = 2;
1996pub const SC_VERS: c_int = 3;
1997pub const SC_WIDTH: c_int = 4;
1998pub const SC_NCPUS: c_int = 5;
1999pub const SC_L1C_ATTR: c_int = 6;
2000pub const SC_L1C_ISZ: c_int = 7;
2001pub const SC_L1C_DSZ: c_int = 8;
2002pub const SC_L1C_ICA: c_int = 9;
2003pub const SC_L1C_DCA: c_int = 10;
2004pub const SC_L1C_IBS: c_int = 11;
2005pub const SC_L1C_DBS: c_int = 12;
2006pub const SC_L1C_ILS: c_int = 13;
2007pub const SC_L1C_DLS: c_int = 14;
2008pub const SC_L2C_SZ: c_int = 15;
2009pub const SC_L2C_AS: c_int = 16;
2010pub const SC_TLB_ATTR: c_int = 17;
2011pub const SC_ITLB_SZ: c_int = 18;
2012pub const SC_DTLB_SZ: c_int = 19;
2013pub const SC_ITLB_ATT: c_int = 20;
2014pub const SC_DTLB_ATT: c_int = 21;
2015pub const SC_RESRV_SZ: c_int = 22;
2016pub const SC_PRI_LC: c_int = 23;
2017pub const SC_PRO_LC: c_int = 24;
2018pub const SC_RTC_TYPE: c_int = 25;
2019pub const SC_VIRT_AL: c_int = 26;
2020pub const SC_CAC_CONG: c_int = 27;
2021pub const SC_MOD_ARCH: c_int = 28;
2022pub const SC_MOD_IMPL: c_int = 29;
2023pub const SC_XINT: c_int = 30;
2024pub const SC_XFRAC: c_int = 31;
2025pub const SC_KRN_ATTR: c_int = 32;
2026pub const SC_PHYSMEM: c_int = 33;
2027pub const SC_SLB_ATTR: c_int = 34;
2028pub const SC_SLB_SZ: c_int = 35;
2029pub const SC_MAX_NCPUS: c_int = 37;
2030pub const SC_MAX_REALADDR: c_int = 38;
2031pub const SC_ORIG_ENT_CAP: c_int = 39;
2032pub const SC_ENT_CAP: c_int = 40;
2033pub const SC_DISP_WHE: c_int = 41;
2034pub const SC_CAPINC: c_int = 42;
2035pub const SC_VCAPW: c_int = 43;
2036pub const SC_SPLP_STAT: c_int = 44;
2037pub const SC_SMT_STAT: c_int = 45;
2038pub const SC_SMT_TC: c_int = 46;
2039pub const SC_VMX_VER: c_int = 47;
2040pub const SC_LMB_SZ: c_int = 48;
2041pub const SC_MAX_XCPU: c_int = 49;
2042pub const SC_EC_LVL: c_int = 50;
2043pub const SC_AME_STAT: c_int = 51;
2044pub const SC_ECO_STAT: c_int = 52;
2045pub const SC_DFP_VER: c_int = 53;
2046pub const SC_VRM_STAT: c_int = 54;
2047pub const SC_PHYS_IMP: c_int = 55;
2048pub const SC_PHYS_VER: c_int = 56;
2049pub const SC_SPCM_STATUS: c_int = 57;
2050pub const SC_SPCM_MAX: c_int = 58;
2051pub const SC_TM_VER: c_int = 59;
2052pub const SC_NX_CAP: c_int = 60;
2053pub const SC_PKS_STATE: c_int = 61;
2054pub const SC_MMA_VER: c_int = 62;
2055pub const POWER_RS: c_int = 1;
2056pub const POWER_PC: c_int = 2;
2057pub const IA64: c_int = 3;
2058pub const POWER_RS1: c_int = 0x1;
2059pub const POWER_RSC: c_int = 0x2;
2060pub const POWER_RS2: c_int = 0x4;
2061pub const POWER_601: c_int = 0x8;
2062pub const POWER_604: c_int = 0x10;
2063pub const POWER_603: c_int = 0x20;
2064pub const POWER_620: c_int = 0x40;
2065pub const POWER_630: c_int = 0x80;
2066pub const POWER_A35: c_int = 0x100;
2067pub const POWER_RS64II: c_int = 0x200;
2068pub const POWER_RS64III: c_int = 0x400;
2069pub const POWER_4: c_int = 0x800;
2070pub const POWER_RS64IV: c_int = POWER_4;
2071pub const POWER_MPC7450: c_int = 0x1000;
2072pub const POWER_5: c_int = 0x2000;
2073pub const POWER_6: c_int = 0x4000;
2074pub const POWER_7: c_int = 0x8000;
2075pub const POWER_8: c_int = 0x10000;
2076pub const POWER_9: c_int = 0x20000;
2077
2078// sys/time.h
2079pub const FD_SETSIZE: usize = 65534;
2080pub const TIMEOFDAY: c_int = 9;
2081pub const CLOCK_REALTIME: crate::clockid_t = TIMEOFDAY as clockid_t;
2082pub const CLOCK_MONOTONIC: crate::clockid_t = 10;
2083pub const TIMER_ABSTIME: c_int = 999;
2084pub const ITIMER_REAL: c_int = 0;
2085pub const ITIMER_VIRTUAL: c_int = 1;
2086pub const ITIMER_PROF: c_int = 2;
2087pub const ITIMER_VIRT: c_int = 3;
2088pub const ITIMER_REAL1: c_int = 20;
2089pub const ITIMER_REAL_TH: c_int = ITIMER_REAL1;
2090pub const DST_AUST: c_int = 2;
2091pub const DST_CAN: c_int = 6;
2092pub const DST_EET: c_int = 5;
2093pub const DST_MET: c_int = 4;
2094pub const DST_NONE: c_int = 0;
2095pub const DST_USA: c_int = 1;
2096pub const DST_WET: c_int = 3;
2097
2098// sys/termio.h
2099pub const CSTART: crate::tcflag_t = 0o21;
2100pub const CSTOP: crate::tcflag_t = 0o23;
2101pub const TCGETA: c_int = TIOC | 5;
2102pub const TCSETA: c_int = TIOC | 6;
2103pub const TCSETAW: c_int = TIOC | 7;
2104pub const TCSETAF: c_int = TIOC | 8;
2105pub const TCSBRK: c_int = TIOC | 9;
2106pub const TCXONC: c_int = TIOC | 11;
2107pub const TCFLSH: c_int = TIOC | 12;
2108pub const TCGETS: c_int = TIOC | 1;
2109pub const TCSETS: c_int = TIOC | 2;
2110pub const TCSANOW: c_int = 0;
2111pub const TCSETSW: c_int = TIOC | 3;
2112pub const TCSADRAIN: c_int = 1;
2113pub const TCSETSF: c_int = TIOC | 4;
2114pub const TCSAFLUSH: c_int = 2;
2115pub const TCIFLUSH: c_int = 0;
2116pub const TCOFLUSH: c_int = 1;
2117pub const TCIOFLUSH: c_int = 2;
2118pub const TCOOFF: c_int = 0;
2119pub const TCOON: c_int = 1;
2120pub const TCIOFF: c_int = 2;
2121pub const TCION: c_int = 3;
2122pub const TIOC: c_int = 0x5400;
2123pub const TIOCGWINSZ: c_int = 0x40087468;
2124pub const TIOCSWINSZ: c_int = u32_cast_int(0x80087467);
2125pub const TIOCLBIS: c_int = u32_cast_int(0x8004747f);
2126pub const TIOCLBIC: c_int = u32_cast_int(0x8004747e);
2127pub const TIOCLSET: c_int = u32_cast_int(0x8004747d);
2128pub const TIOCLGET: c_int = 0x4004747c;
2129pub const TIOCSBRK: c_int = 0x2000747b;
2130pub const TIOCCBRK: c_int = 0x2000747a;
2131pub const TIOCSDTR: c_int = 0x20007479;
2132pub const TIOCCDTR: c_int = 0x20007478;
2133pub const TIOCSLTC: c_int = u32_cast_int(0x80067475);
2134pub const TIOCGLTC: c_int = 0x40067474;
2135pub const TIOCOUTQ: c_int = 0x40047473;
2136pub const TIOCNOTTY: c_int = 0x20007471;
2137pub const TIOCSTOP: c_int = 0x2000746f;
2138pub const TIOCSTART: c_int = 0x2000746e;
2139pub const TIOCGPGRP: c_int = 0x40047477;
2140pub const TIOCSPGRP: c_int = u32_cast_int(0x80047476);
2141pub const TIOCGSID: c_int = 0x40047448;
2142pub const TIOCSTI: c_int = u32_cast_int(0x80017472);
2143pub const TIOCMSET: c_int = u32_cast_int(0x8004746d);
2144pub const TIOCMBIS: c_int = u32_cast_int(0x8004746c);
2145pub const TIOCMBIC: c_int = u32_cast_int(0x8004746b);
2146pub const TIOCMGET: c_int = 0x4004746a;
2147pub const TIOCREMOTE: c_int = u32_cast_int(0x80047469);
2148
2149// sys/user.h
2150pub const MAXCOMLEN: c_int = 32;
2151pub const UF_SYSTEM: c_int = 0x1000;
2152
2153// sys/vattr.h
2154pub const AT_FLAGS: c_int = 0x80;
2155pub const AT_GID: c_int = 8;
2156pub const AT_UID: c_int = 4;
2157
2158// sys/wait.h
2159pub const P_ALL: idtype_t = 0;
2160pub const P_PID: idtype_t = 1;
2161pub const P_PGID: idtype_t = 2;
2162pub const WNOHANG: c_int = 0x1;
2163pub const WUNTRACED: c_int = 0x2;
2164pub const WEXITED: c_int = 0x04;
2165pub const WCONTINUED: c_int = 0x01000000;
2166pub const WNOWAIT: c_int = 0x10;
2167pub const WSTOPPED: c_int = _W_STOPPED;
2168pub const _W_STOPPED: c_int = 0x00000040;
2169pub const _W_SLWTED: c_int = 0x0000007c;
2170pub const _W_SEWTED: c_int = 0x0000007d;
2171pub const _W_SFWTED: c_int = 0x0000007e;
2172pub const _W_STRC: c_int = 0x0000007f;
2173
2174// termios.h
2175pub const NCCS: usize = 16;
2176pub const OLCUC: crate::tcflag_t = 2;
2177pub const CSIZE: crate::tcflag_t = 0x00000030;
2178pub const CS5: crate::tcflag_t = 0x00000000;
2179pub const CS6: crate::tcflag_t = 0x00000010;
2180pub const CS7: crate::tcflag_t = 0x00000020;
2181pub const CS8: crate::tcflag_t = 0x00000030;
2182pub const CSTOPB: crate::tcflag_t = 0x00000040;
2183pub const ECHO: crate::tcflag_t = 0x00000008;
2184pub const ECHOE: crate::tcflag_t = 0x00000010;
2185pub const ECHOK: crate::tcflag_t = 0x00000020;
2186pub const ECHONL: crate::tcflag_t = 0x00000040;
2187pub const ECHOCTL: crate::tcflag_t = 0x00020000;
2188pub const ECHOPRT: crate::tcflag_t = 0x00040000;
2189pub const ECHOKE: crate::tcflag_t = 0x00080000;
2190pub const IGNBRK: crate::tcflag_t = 0x00000001;
2191pub const BRKINT: crate::tcflag_t = 0x00000002;
2192pub const IGNPAR: crate::tcflag_t = 0x00000004;
2193pub const PARMRK: crate::tcflag_t = 0x00000008;
2194pub const INPCK: crate::tcflag_t = 0x00000010;
2195pub const ISTRIP: crate::tcflag_t = 0x00000020;
2196pub const INLCR: crate::tcflag_t = 0x00000040;
2197pub const IGNCR: crate::tcflag_t = 0x00000080;
2198pub const ICRNL: crate::tcflag_t = 0x00000100;
2199pub const IXON: crate::tcflag_t = 0x00000200;
2200pub const IXOFF: crate::tcflag_t = 0x00000400;
2201pub const IXANY: crate::tcflag_t = 0x00001000;
2202pub const IMAXBEL: crate::tcflag_t = 0x00010000;
2203pub const OPOST: crate::tcflag_t = 0x00000001;
2204pub const ONLCR: crate::tcflag_t = 0x00000004;
2205pub const OCRNL: crate::tcflag_t = 0x00000008;
2206pub const ONOCR: crate::tcflag_t = 0x00000010;
2207pub const ONLRET: crate::tcflag_t = 0x00000020;
2208pub const CREAD: crate::tcflag_t = 0x00000080;
2209pub const IEXTEN: crate::tcflag_t = 0x00200000;
2210pub const TOSTOP: crate::tcflag_t = 0x00010000;
2211pub const FLUSHO: crate::tcflag_t = 0x00100000;
2212pub const PENDIN: crate::tcflag_t = 0x20000000;
2213pub const NOFLSH: crate::tcflag_t = 0x00000080;
2214pub const VINTR: usize = 0;
2215pub const VQUIT: usize = 1;
2216pub const VERASE: usize = 2;
2217pub const VKILL: usize = 3;
2218pub const VEOF: usize = 4;
2219pub const VEOL: usize = 5;
2220pub const VSTART: usize = 7;
2221pub const VSTOP: usize = 8;
2222pub const VSUSP: usize = 9;
2223pub const VMIN: usize = 4;
2224pub const VTIME: usize = 5;
2225pub const VEOL2: usize = 6;
2226pub const VDSUSP: usize = 10;
2227pub const VREPRINT: usize = 11;
2228pub const VDISCRD: usize = 12;
2229pub const VWERSE: usize = 13;
2230pub const VLNEXT: usize = 14;
2231pub const B0: crate::speed_t = 0x0;
2232pub const B50: crate::speed_t = 0x1;
2233pub const B75: crate::speed_t = 0x2;
2234pub const B110: crate::speed_t = 0x3;
2235pub const B134: crate::speed_t = 0x4;
2236pub const B150: crate::speed_t = 0x5;
2237pub const B200: crate::speed_t = 0x6;
2238pub const B300: crate::speed_t = 0x7;
2239pub const B600: crate::speed_t = 0x8;
2240pub const B1200: crate::speed_t = 0x9;
2241pub const B1800: crate::speed_t = 0xa;
2242pub const B2400: crate::speed_t = 0xb;
2243pub const B4800: crate::speed_t = 0xc;
2244pub const B9600: crate::speed_t = 0xd;
2245pub const B19200: crate::speed_t = 0xe;
2246pub const B38400: crate::speed_t = 0xf;
2247pub const EXTA: crate::speed_t = B19200;
2248pub const EXTB: crate::speed_t = B38400;
2249pub const IUCLC: crate::tcflag_t = 0x00000800;
2250pub const OFILL: crate::tcflag_t = 0x00000040;
2251pub const OFDEL: crate::tcflag_t = 0x00000080;
2252pub const CRDLY: crate::tcflag_t = 0x00000300;
2253pub const CR0: crate::tcflag_t = 0x00000000;
2254pub const CR1: crate::tcflag_t = 0x00000100;
2255pub const CR2: crate::tcflag_t = 0x00000200;
2256pub const CR3: crate::tcflag_t = 0x00000300;
2257pub const TABDLY: crate::tcflag_t = 0x00000c00;
2258pub const TAB0: crate::tcflag_t = 0x00000000;
2259pub const TAB1: crate::tcflag_t = 0x00000400;
2260pub const TAB2: crate::tcflag_t = 0x00000800;
2261pub const TAB3: crate::tcflag_t = 0x00000c00;
2262pub const BSDLY: crate::tcflag_t = 0x00001000;
2263pub const BS0: crate::tcflag_t = 0x00000000;
2264pub const BS1: crate::tcflag_t = 0x00001000;
2265pub const FFDLY: crate::tcflag_t = 0x00002000;
2266pub const FF0: crate::tcflag_t = 0x00000000;
2267pub const FF1: crate::tcflag_t = 0x00002000;
2268pub const NLDLY: crate::tcflag_t = 0x00004000;
2269pub const NL0: crate::tcflag_t = 0x00000000;
2270pub const NL1: crate::tcflag_t = 0x00004000;
2271pub const VTDLY: crate::tcflag_t = 0x00008000;
2272pub const VT0: crate::tcflag_t = 0x00000000;
2273pub const VT1: crate::tcflag_t = 0x00008000;
2274pub const OXTABS: crate::tcflag_t = 0x00040000;
2275pub const ONOEOT: crate::tcflag_t = 0x00080000;
2276pub const CBAUD: crate::tcflag_t = 0x0000000f;
2277pub const PARENB: crate::tcflag_t = 0x00000100;
2278pub const PARODD: crate::tcflag_t = 0x00000200;
2279pub const HUPCL: crate::tcflag_t = 0x00000400;
2280pub const CLOCAL: crate::tcflag_t = 0x00000800;
2281pub const CIBAUD: crate::tcflag_t = 0x000f0000;
2282pub const IBSHIFT: crate::tcflag_t = 16;
2283pub const PAREXT: crate::tcflag_t = 0x00100000;
2284pub const ISIG: crate::tcflag_t = 0x00000001;
2285pub const ICANON: crate::tcflag_t = 0x00000002;
2286pub const XCASE: crate::tcflag_t = 0x00000004;
2287pub const ALTWERASE: crate::tcflag_t = 0x00400000;
2288
2289// time.h
2290pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 11;
2291pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 12;
2292
2293// unistd.h
2294pub const _POSIX_VDISABLE: c_int = 0xff;
2295pub const _PC_LINK_MAX: c_int = 11;
2296pub const _PC_MAX_CANON: c_int = 12;
2297pub const _PC_MAX_INPUT: c_int = 13;
2298pub const _PC_NAME_MAX: c_int = 14;
2299pub const _PC_PATH_MAX: c_int = 16;
2300pub const _PC_PIPE_BUF: c_int = 17;
2301pub const _PC_NO_TRUNC: c_int = 15;
2302pub const _PC_VDISABLE: c_int = 18;
2303pub const _PC_CHOWN_RESTRICTED: c_int = 10;
2304pub const _PC_ASYNC_IO: c_int = 19;
2305pub const _PC_PRIO_IO: c_int = 21;
2306pub const _PC_SYNC_IO: c_int = 20;
2307pub const _PC_ALLOC_SIZE_MIN: c_int = 26;
2308pub const _PC_REC_INCR_XFER_SIZE: c_int = 27;
2309pub const _PC_REC_MAX_XFER_SIZE: c_int = 28;
2310pub const _PC_REC_MIN_XFER_SIZE: c_int = 29;
2311pub const _PC_REC_XFER_ALIGN: c_int = 30;
2312pub const _PC_SYMLINK_MAX: c_int = 25;
2313pub const _PC_2_SYMLINKS: c_int = 31;
2314pub const _PC_TIMESTAMP_RESOLUTION: c_int = 32;
2315pub const _PC_FILESIZEBITS: c_int = 22;
2316pub const _SC_ARG_MAX: c_int = 0;
2317pub const _SC_CHILD_MAX: c_int = 1;
2318pub const _SC_CLK_TCK: c_int = 2;
2319pub const _SC_NGROUPS_MAX: c_int = 3;
2320pub const _SC_OPEN_MAX: c_int = 4;
2321pub const _SC_JOB_CONTROL: c_int = 7;
2322pub const _SC_SAVED_IDS: c_int = 8;
2323pub const _SC_VERSION: c_int = 9;
2324pub const _SC_PASS_MAX: c_int = 45;
2325pub const _SC_PAGESIZE: c_int = _SC_PAGE_SIZE;
2326pub const _SC_PAGE_SIZE: c_int = 48;
2327pub const _SC_XOPEN_VERSION: c_int = 46;
2328pub const _SC_NPROCESSORS_CONF: c_int = 71;
2329pub const _SC_NPROCESSORS_ONLN: c_int = 72;
2330pub const _SC_STREAM_MAX: c_int = 5;
2331pub const _SC_TZNAME_MAX: c_int = 6;
2332pub const _SC_AIO_LISTIO_MAX: c_int = 75;
2333pub const _SC_AIO_MAX: c_int = 76;
2334pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 77;
2335pub const _SC_ASYNCHRONOUS_IO: c_int = 78;
2336pub const _SC_DELAYTIMER_MAX: c_int = 79;
2337pub const _SC_FSYNC: c_int = 80;
2338pub const _SC_MAPPED_FILES: c_int = 84;
2339pub const _SC_MEMLOCK: c_int = 85;
2340pub const _SC_MEMLOCK_RANGE: c_int = 86;
2341pub const _SC_MEMORY_PROTECTION: c_int = 87;
2342pub const _SC_MESSAGE_PASSING: c_int = 88;
2343pub const _SC_MQ_OPEN_MAX: c_int = 89;
2344pub const _SC_MQ_PRIO_MAX: c_int = 90;
2345pub const _SC_PRIORITIZED_IO: c_int = 91;
2346pub const _SC_PRIORITY_SCHEDULING: c_int = 92;
2347pub const _SC_REALTIME_SIGNALS: c_int = 93;
2348pub const _SC_RTSIG_MAX: c_int = 94;
2349pub const _SC_SEMAPHORES: c_int = 95;
2350pub const _SC_SEM_NSEMS_MAX: c_int = 96;
2351pub const _SC_SEM_VALUE_MAX: c_int = 97;
2352pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 98;
2353pub const _SC_SIGQUEUE_MAX: c_int = 99;
2354pub const _SC_SYNCHRONIZED_IO: c_int = 100;
2355pub const _SC_TIMERS: c_int = 102;
2356pub const _SC_TIMER_MAX: c_int = 103;
2357pub const _SC_2_C_BIND: c_int = 51;
2358pub const _SC_2_C_DEV: c_int = 32;
2359pub const _SC_2_C_VERSION: c_int = 52;
2360pub const _SC_2_FORT_DEV: c_int = 33;
2361pub const _SC_2_FORT_RUN: c_int = 34;
2362pub const _SC_2_LOCALEDEF: c_int = 35;
2363pub const _SC_2_SW_DEV: c_int = 36;
2364pub const _SC_2_UPE: c_int = 53;
2365pub const _SC_2_VERSION: c_int = 31;
2366pub const _SC_BC_BASE_MAX: c_int = 23;
2367pub const _SC_BC_DIM_MAX: c_int = 24;
2368pub const _SC_BC_SCALE_MAX: c_int = 25;
2369pub const _SC_BC_STRING_MAX: c_int = 26;
2370pub const _SC_COLL_WEIGHTS_MAX: c_int = 50;
2371pub const _SC_EXPR_NEST_MAX: c_int = 28;
2372pub const _SC_LINE_MAX: c_int = 29;
2373pub const _SC_RE_DUP_MAX: c_int = 30;
2374pub const _SC_XOPEN_CRYPT: c_int = 56;
2375pub const _SC_XOPEN_ENH_I18N: c_int = 57;
2376pub const _SC_XOPEN_SHM: c_int = 55;
2377pub const _SC_2_CHAR_TERM: c_int = 54;
2378pub const _SC_XOPEN_XCU_VERSION: c_int = 109;
2379pub const _SC_ATEXIT_MAX: c_int = 47;
2380pub const _SC_IOV_MAX: c_int = 58;
2381pub const _SC_XOPEN_UNIX: c_int = 73;
2382pub const _SC_T_IOV_MAX: c_int = 0;
2383pub const _SC_PHYS_PAGES: c_int = 113;
2384pub const _SC_AVPHYS_PAGES: c_int = 114;
2385pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 101;
2386pub const _SC_GETGR_R_SIZE_MAX: c_int = 81;
2387pub const _SC_GETPW_R_SIZE_MAX: c_int = 82;
2388pub const _SC_LOGIN_NAME_MAX: c_int = 83;
2389pub const _SC_THREAD_KEYS_MAX: c_int = 68;
2390pub const _SC_THREAD_STACK_MIN: c_int = 69;
2391pub const _SC_THREAD_THREADS_MAX: c_int = 70;
2392pub const _SC_TTY_NAME_MAX: c_int = 104;
2393pub const _SC_THREADS: c_int = 60;
2394pub const _SC_THREAD_ATTR_STACKADDR: c_int = 61;
2395pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 62;
2396pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 64;
2397pub const _SC_THREAD_PRIO_INHERIT: c_int = 65;
2398pub const _SC_THREAD_PRIO_PROTECT: c_int = 66;
2399pub const _SC_THREAD_PROCESS_SHARED: c_int = 67;
2400pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 59;
2401pub const _SC_XOPEN_LEGACY: c_int = 112;
2402pub const _SC_XOPEN_REALTIME: c_int = 110;
2403pub const _SC_XOPEN_REALTIME_THREADS: c_int = 111;
2404pub const _SC_XBS5_ILP32_OFF32: c_int = 105;
2405pub const _SC_XBS5_ILP32_OFFBIG: c_int = 106;
2406pub const _SC_XBS5_LP64_OFF64: c_int = 107;
2407pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 108;
2408pub const _SC_2_PBS: c_int = 132;
2409pub const _SC_2_PBS_ACCOUNTING: c_int = 133;
2410pub const _SC_2_PBS_CHECKPOINT: c_int = 134;
2411pub const _SC_2_PBS_LOCATE: c_int = 135;
2412pub const _SC_2_PBS_MESSAGE: c_int = 136;
2413pub const _SC_2_PBS_TRACK: c_int = 137;
2414pub const _SC_ADVISORY_INFO: c_int = 130;
2415pub const _SC_BARRIERS: c_int = 138;
2416pub const _SC_CLOCK_SELECTION: c_int = 139;
2417pub const _SC_CPUTIME: c_int = 140;
2418pub const _SC_HOST_NAME_MAX: c_int = 126;
2419pub const _SC_MONOTONIC_CLOCK: c_int = 141;
2420pub const _SC_READER_WRITER_LOCKS: c_int = 142;
2421pub const _SC_REGEXP: c_int = 127;
2422pub const _SC_SHELL: c_int = 128;
2423pub const _SC_SPAWN: c_int = 143;
2424pub const _SC_SPIN_LOCKS: c_int = 144;
2425pub const _SC_SPORADIC_SERVER: c_int = 145;
2426pub const _SC_SS_REPL_MAX: c_int = 156;
2427pub const _SC_SYMLOOP_MAX: c_int = 129;
2428pub const _SC_THREAD_CPUTIME: c_int = 146;
2429pub const _SC_THREAD_SPORADIC_SERVER: c_int = 147;
2430pub const _SC_TIMEOUTS: c_int = 148;
2431pub const _SC_TRACE: c_int = 149;
2432pub const _SC_TRACE_EVENT_FILTER: c_int = 150;
2433pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 157;
2434pub const _SC_TRACE_INHERIT: c_int = 151;
2435pub const _SC_TRACE_LOG: c_int = 152;
2436pub const _SC_TRACE_NAME_MAX: c_int = 158;
2437pub const _SC_TRACE_SYS_MAX: c_int = 159;
2438pub const _SC_TRACE_USER_EVENT_MAX: c_int = 160;
2439pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 153;
2440pub const _SC_V6_ILP32_OFF32: c_int = 121;
2441pub const _SC_V6_ILP32_OFFBIG: c_int = 122;
2442pub const _SC_V6_LP64_OFF64: c_int = 123;
2443pub const _SC_V6_LPBIG_OFFBIG: c_int = 124;
2444pub const _SC_XOPEN_STREAMS: c_int = 125;
2445pub const _SC_IPV6: c_int = 154;
2446pub const _SC_RAW_SOCKETS: c_int = 155;
2447
2448// utmp.h
2449pub const EMPTY: c_short = 0;
2450pub const RUN_LVL: c_short = 1;
2451pub const BOOT_TIME: c_short = 2;
2452pub const OLD_TIME: c_short = 3;
2453pub const NEW_TIME: c_short = 4;
2454pub const INIT_PROCESS: c_short = 5;
2455pub const LOGIN_PROCESS: c_short = 6;
2456pub const USER_PROCESS: c_short = 7;
2457pub const DEAD_PROCESS: c_short = 8;
2458pub const ACCOUNTING: c_short = 9;
2459
2460f! {
2461 pub unsafe fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
2462 if (*mhdr).msg_controllen as usize >= size_of::<cmsghdr>() {
2463 (*mhdr).msg_control as *mut cmsghdr
2464 } else {
2465 ptr::null_mut()
2466 }
2467 }
2468
2469 pub unsafe fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
2470 if cmsg.is_null() {
2471 CMSG_FIRSTHDR(mhdr)
2472 } else {
2473 if (cmsg as usize + (*cmsg).cmsg_len as usize + size_of::<cmsghdr>())
2474 > ((*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize)
2475 {
2476 ptr::null_mut()
2477 } else {
2478 // AIX does not have any alignment/padding for ancillary data, so we don't need _CMSG_ALIGN here.
2479 (cmsg as usize + (*cmsg).cmsg_len as usize) as *mut cmsghdr
2480 }
2481 }
2482 }
2483
2484 pub unsafe fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar {
2485 (cmsg as *mut c_uchar).offset(size_of::<cmsghdr>() as isize)
2486 }
2487
2488 pub const unsafe fn CMSG_LEN(length: c_uint) -> c_uint {
2489 size_of::<cmsghdr>() as c_uint + length
2490 }
2491
2492 pub const unsafe fn CMSG_SPACE(length: c_uint) -> c_uint {
2493 size_of::<cmsghdr>() as c_uint + length
2494 }
2495
2496 pub unsafe fn FD_ZERO(set: *mut fd_set) -> () {
2497 (*set).fds_bits.fill(0);
2498 }
2499
2500 pub unsafe fn FD_SET(fd: c_int, set: *mut fd_set) -> () {
2501 let bits = size_of::<c_long>() * 8;
2502 let fd = fd as usize;
2503 (*set).fds_bits[fd / bits] |= 1 << (fd % bits);
2504 return;
2505 }
2506
2507 pub unsafe fn FD_CLR(fd: c_int, set: *mut fd_set) -> () {
2508 let bits = size_of::<c_long>() * 8;
2509 let fd = fd as usize;
2510 (*set).fds_bits[fd / bits] &= !(1 << (fd % bits));
2511 return;
2512 }
2513
2514 pub unsafe fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool {
2515 let bits = size_of::<c_long>() * 8;
2516 let fd = fd as usize;
2517 return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0;
2518 }
2519}
2520
2521safe_f! {
2522 pub const safe fn WIFSTOPPED(status: c_int) -> bool {
2523 (status & _W_STOPPED) != 0
2524 }
2525
2526 pub const safe fn WSTOPSIG(status: c_int) -> c_int {
2527 if WIFSTOPPED(status) {
2528 (((status as c_uint) >> 8) & 0xff) as c_int
2529 } else {
2530 -1
2531 }
2532 }
2533
2534 pub const safe fn WIFEXITED(status: c_int) -> bool {
2535 (status & 0xFF) == 0
2536 }
2537
2538 pub const safe fn WEXITSTATUS(status: c_int) -> c_int {
2539 if WIFEXITED(status) {
2540 (((status as c_uint) >> 8) & 0xff) as c_int
2541 } else {
2542 -1
2543 }
2544 }
2545
2546 pub const safe fn WIFSIGNALED(status: c_int) -> bool {
2547 !WIFEXITED(status) && !WIFSTOPPED(status)
2548 }
2549
2550 pub const safe fn WTERMSIG(status: c_int) -> c_int {
2551 if WIFSIGNALED(status) {
2552 (((status as c_uint) >> 16) & 0xff) as c_int
2553 } else {
2554 -1
2555 }
2556 }
2557
2558 pub const safe fn WIFCONTINUED(status: c_int) -> bool {
2559 (status & WCONTINUED) != 0
2560 }
2561
2562 // AIX doesn't have native WCOREDUMP.
2563 pub const safe fn WCOREDUMP(_status: c_int) -> bool {
2564 false
2565 }
2566
2567 pub const safe fn major(dev: crate::dev_t) -> c_uint {
2568 let x = dev >> 16;
2569 x as c_uint
2570 }
2571
2572 pub const safe fn minor(dev: crate::dev_t) -> c_uint {
2573 let y = dev & 0xFFFF;
2574 y as c_uint
2575 }
2576
2577 pub const safe fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t {
2578 let major = major as crate::dev_t;
2579 let minor = minor as crate::dev_t;
2580 let mut dev = 0;
2581 dev |= major << 16;
2582 dev |= minor;
2583 dev
2584 }
2585}
2586
2587#[link(name = "thread")]
2588extern "C" {
2589 pub fn thr_kill(id: thread_t, sig: c_int) -> c_int;
2590 pub fn thr_self() -> thread_t;
2591}
2592
2593#[link(name = "pthread")]
2594extern "C" {
2595 pub fn pthread_atfork(
2596 prepare: Option<unsafe extern "C" fn()>,
2597 parent: Option<unsafe extern "C" fn()>,
2598 child: Option<unsafe extern "C" fn()>,
2599 ) -> c_int;
2600
2601 pub fn pthread_attr_getdetachstate(
2602 attr: *const crate::pthread_attr_t,
2603 detachstate: *mut c_int,
2604 ) -> c_int;
2605
2606 pub fn pthread_attr_getguardsize(
2607 attr: *const crate::pthread_attr_t,
2608 guardsize: *mut size_t,
2609 ) -> c_int;
2610
2611 pub fn pthread_attr_getinheritsched(
2612 attr: *const crate::pthread_attr_t,
2613 inheritsched: *mut c_int,
2614 ) -> c_int;
2615
2616 pub fn pthread_attr_getschedparam(
2617 attr: *const crate::pthread_attr_t,
2618 param: *mut sched_param,
2619 ) -> c_int;
2620
2621 pub fn pthread_attr_getstackaddr(
2622 attr: *const crate::pthread_attr_t,
2623 stackaddr: *mut *mut c_void,
2624 ) -> c_int;
2625
2626 pub fn pthread_attr_getschedpolicy(
2627 attr: *const crate::pthread_attr_t,
2628 policy: *mut c_int,
2629 ) -> c_int;
2630
2631 pub fn pthread_attr_getscope(
2632 attr: *const crate::pthread_attr_t,
2633 contentionscope: *mut c_int,
2634 ) -> c_int;
2635
2636 pub fn pthread_attr_getstack(
2637 attr: *const crate::pthread_attr_t,
2638 stackaddr: *mut *mut c_void,
2639 stacksize: *mut size_t,
2640 ) -> c_int;
2641
2642 pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int;
2643
2644 pub fn pthread_attr_setinheritsched(
2645 attr: *mut crate::pthread_attr_t,
2646 inheritsched: c_int,
2647 ) -> c_int;
2648
2649 pub fn pthread_attr_setschedparam(
2650 attr: *mut crate::pthread_attr_t,
2651 param: *const sched_param,
2652 ) -> c_int;
2653
2654 pub fn pthread_attr_setschedpolicy(attr: *mut crate::pthread_attr_t, policy: c_int) -> c_int;
2655
2656 pub fn pthread_attr_setscope(attr: *mut crate::pthread_attr_t, contentionscope: c_int)
2657 -> c_int;
2658
2659 pub fn pthread_attr_setstack(
2660 attr: *mut crate::pthread_attr_t,
2661 stackaddr: *mut c_void,
2662 stacksize: size_t,
2663 ) -> c_int;
2664
2665 pub fn pthread_attr_setstackaddr(
2666 attr: *mut crate::pthread_attr_t,
2667 stackaddr: *mut c_void,
2668 ) -> c_int;
2669
2670 pub fn pthread_barrierattr_destroy(attr: *mut crate::pthread_barrierattr_t) -> c_int;
2671
2672 pub fn pthread_barrierattr_getpshared(
2673 attr: *const crate::pthread_barrierattr_t,
2674 pshared: *mut c_int,
2675 ) -> c_int;
2676
2677 pub fn pthread_barrierattr_init(attr: *mut crate::pthread_barrierattr_t) -> c_int;
2678
2679 pub fn pthread_barrierattr_setpshared(
2680 attr: *mut crate::pthread_barrierattr_t,
2681 pshared: c_int,
2682 ) -> c_int;
2683
2684 pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> c_int;
2685
2686 pub fn pthread_barrier_init(
2687 barrier: *mut pthread_barrier_t,
2688 attr: *const crate::pthread_barrierattr_t,
2689 count: c_uint,
2690 ) -> c_int;
2691
2692 pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> c_int;
2693
2694 pub fn pthread_cancel(thread: crate::pthread_t) -> c_int;
2695
2696 pub fn pthread_cleanup_pop(execute: c_int);
2697
2698 pub fn pthread_cleanup_push(
2699 routine: Option<unsafe extern "C" fn(*mut c_void)>,
2700 arg: *mut c_void,
2701 );
2702
2703 pub fn pthread_condattr_getclock(
2704 attr: *const pthread_condattr_t,
2705 clock_id: *mut clockid_t,
2706 ) -> c_int;
2707
2708 pub fn pthread_condattr_getpshared(
2709 attr: *const pthread_condattr_t,
2710 pshared: *mut c_int,
2711 ) -> c_int;
2712
2713 pub fn pthread_condattr_setclock(
2714 attr: *mut pthread_condattr_t,
2715 clock_id: crate::clockid_t,
2716 ) -> c_int;
2717
2718 pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int;
2719
2720 pub fn pthread_create(
2721 thread: *mut crate::pthread_t,
2722 attr: *const crate::pthread_attr_t,
2723 start_routine: extern "C" fn(*mut c_void) -> *mut c_void,
2724 arg: *mut c_void,
2725 ) -> c_int;
2726
2727 pub fn pthread_getconcurrency() -> c_int;
2728
2729 pub fn pthread_getcpuclockid(
2730 thread_id: crate::pthread_t,
2731 clock_id: *mut crate::clockid_t,
2732 ) -> c_int;
2733
2734 pub fn pthread_getschedparam(
2735 thread: crate::pthread_t,
2736 policy: *mut c_int,
2737 param: *mut sched_param,
2738 ) -> c_int;
2739
2740 pub fn pthread_kill(thread: crate::pthread_t, sig: c_int) -> c_int;
2741
2742 pub fn pthread_mutexattr_getprioceiling(
2743 attr: *const crate::pthread_mutexattr_t,
2744 prioceiling: *mut c_int,
2745 ) -> c_int;
2746
2747 pub fn pthread_mutexattr_getprotocol(
2748 attr: *const pthread_mutexattr_t,
2749 protocol: *mut c_int,
2750 ) -> c_int;
2751
2752 pub fn pthread_mutexattr_getpshared(
2753 attr: *const pthread_mutexattr_t,
2754 pshared: *mut c_int,
2755 ) -> c_int;
2756
2757 pub fn pthread_mutexattr_getrobust(
2758 attr: *const crate::pthread_mutexattr_t,
2759 robust: *mut c_int,
2760 ) -> c_int;
2761
2762 pub fn pthread_mutexattr_gettype(
2763 attr: *const crate::pthread_mutexattr_t,
2764 _type: *mut c_int,
2765 ) -> c_int;
2766
2767 pub fn pthread_mutexattr_setprioceiling(
2768 attr: *mut crate::pthread_mutexattr_t,
2769 prioceiling: c_int,
2770 ) -> c_int;
2771
2772 pub fn pthread_mutexattr_setprotocol(attr: *mut pthread_mutexattr_t, protocol: c_int) -> c_int;
2773
2774 pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int;
2775
2776 pub fn pthread_mutexattr_setrobust(
2777 attr: *mut crate::pthread_mutexattr_t,
2778 robust: c_int,
2779 ) -> c_int;
2780
2781 pub fn pthread_mutex_consistent(mutex: *mut crate::pthread_mutex_t) -> c_int;
2782
2783 pub fn pthread_mutex_getprioceiling(
2784 mutex: *const crate::pthread_mutex_t,
2785 prioceiling: *mut c_int,
2786 ) -> c_int;
2787
2788 pub fn pthread_mutex_setprioceiling(
2789 mutex: *mut crate::pthread_mutex_t,
2790 prioceiling: c_int,
2791 old_ceiling: *mut c_int,
2792 ) -> c_int;
2793
2794 pub fn pthread_mutex_timedlock(
2795 mutex: *mut pthread_mutex_t,
2796 abstime: *const crate::timespec,
2797 ) -> c_int;
2798
2799 pub fn pthread_once(
2800 once_control: *mut crate::pthread_once_t,
2801 init_routine: Option<unsafe extern "C" fn()>,
2802 ) -> c_int;
2803
2804 pub fn pthread_rwlockattr_getpshared(
2805 attr: *const pthread_rwlockattr_t,
2806 pshared: *mut c_int,
2807 ) -> c_int;
2808
2809 pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, pshared: c_int) -> c_int;
2810
2811 pub fn pthread_rwlock_timedrdlock(
2812 rwlock: *mut crate::pthread_rwlock_t,
2813 abstime: *const crate::timespec,
2814 ) -> c_int;
2815
2816 pub fn pthread_rwlock_timedwrlock(
2817 rwlock: *mut crate::pthread_rwlock_t,
2818 abstime: *const crate::timespec,
2819 ) -> c_int;
2820
2821 pub fn pthread_setcancelstate(state: c_int, oldstate: *mut c_int) -> c_int;
2822 pub fn pthread_setcanceltype(_type: c_int, oldtype: *mut c_int) -> c_int;
2823
2824 pub fn pthread_setconcurrency(new_level: c_int) -> c_int;
2825
2826 pub fn pthread_setschedparam(
2827 thread: crate::pthread_t,
2828 policy: c_int,
2829 param: *const sched_param,
2830 ) -> c_int;
2831
2832 pub fn pthread_setschedprio(thread: crate::pthread_t, prio: c_int) -> c_int;
2833
2834 pub fn pthread_sigmask(how: c_int, set: *const sigset_t, oset: *mut sigset_t) -> c_int;
2835
2836 pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> c_int;
2837 pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: c_int) -> c_int;
2838 pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> c_int;
2839 pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> c_int;
2840 pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> c_int;
2841
2842 pub fn pthread_testcancel();
2843}
2844
2845#[link(name = "iconv")]
2846extern "C" {
2847 pub fn iconv(
2848 cd: iconv_t,
2849 inbuf: *mut *mut c_char,
2850 inbytesleft: *mut size_t,
2851 outbuf: *mut *mut c_char,
2852 outbytesleft: *mut size_t,
2853 ) -> size_t;
2854 pub fn iconv_close(cd: iconv_t) -> c_int;
2855 pub fn iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t;
2856}
2857
2858extern "C" {
2859 pub fn acct(filename: *mut c_char) -> c_int;
2860 #[link_name = "_posix_aio_cancel"]
2861 pub fn aio_cancel(fildes: c_int, aiocbp: *mut crate::aiocb) -> c_int;
2862 #[link_name = "_posix_aio_error"]
2863 pub fn aio_error(aiocbp: *const crate::aiocb) -> c_int;
2864 #[link_name = "_posix_aio_fsync"]
2865 pub fn aio_fsync(op: c_int, aiocbp: *mut crate::aiocb) -> c_int;
2866 #[link_name = "_posix_aio_read"]
2867 pub fn aio_read(aiocbp: *mut crate::aiocb) -> c_int;
2868 #[link_name = "_posix_aio_return"]
2869 pub fn aio_return(aiocbp: *mut crate::aiocb) -> ssize_t;
2870 #[link_name = "_posix_aio_suspend"]
2871 pub fn aio_suspend(
2872 list: *const *const crate::aiocb,
2873 nent: c_int,
2874 timeout: *const crate::timespec,
2875 ) -> c_int;
2876 #[link_name = "_posix_aio_write"]
2877 pub fn aio_write(aiocbp: *mut crate::aiocb) -> c_int;
2878 pub fn basename(path: *mut c_char) -> *mut c_char;
2879 pub fn bind(
2880 socket: c_int,
2881 address: *const crate::sockaddr,
2882 address_len: crate::socklen_t,
2883 ) -> c_int;
2884 pub fn brk(addr: *mut c_void) -> c_int;
2885 pub fn clearenv() -> c_int;
2886 pub fn clock_getcpuclockid(pid: crate::pid_t, clk_id: *mut crate::clockid_t) -> c_int;
2887 pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int;
2888 pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int;
2889 pub fn clock_nanosleep(
2890 clk_id: crate::clockid_t,
2891 flags: c_int,
2892 rqtp: *const crate::timespec,
2893 rmtp: *mut crate::timespec,
2894 ) -> c_int;
2895 pub fn clock_settime(clock_id: crate::clockid_t, tp: *const crate::timespec) -> c_int;
2896 pub fn creat64(path: *const c_char, mode: mode_t) -> c_int;
2897 pub fn ctermid(s: *mut c_char) -> *mut c_char;
2898 pub fn dirfd(dirp: *mut crate::DIR) -> c_int;
2899 pub fn dirname(path: *mut c_char) -> *mut c_char;
2900 pub fn drand48() -> c_double;
2901 pub fn duplocale(arg1: crate::locale_t) -> crate::locale_t;
2902 pub fn endgrent();
2903 pub fn endmntent(streamp: *mut crate::FILE) -> c_int;
2904 pub fn endpwent();
2905 pub fn endutent();
2906 pub fn endutxent();
2907 pub fn erand48(xseed: *mut c_ushort) -> c_double;
2908 pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int;
2909 pub fn fattach(fildes: c_int, path: *const c_char) -> c_int;
2910 pub fn fdatasync(fd: c_int) -> c_int;
2911
2912 // DIFF(main): changed to `*const *mut` in e77f551de9
2913 pub fn fexecve(fd: c_int, argv: *const *const c_char, envp: *const *const c_char) -> c_int;
2914
2915 pub fn ffs(value: c_int) -> c_int;
2916 pub fn ffsl(value: c_long) -> c_int;
2917 pub fn ffsll(value: c_longlong) -> c_int;
2918 pub fn fgetgrent(file: *mut crate::FILE) -> *mut crate::group;
2919 pub fn fgetpos64(stream: *mut crate::FILE, ptr: *mut fpos64_t) -> c_int;
2920 pub fn fgetpwent(file: *mut crate::FILE) -> *mut crate::passwd;
2921 pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut crate::FILE;
2922 pub fn freelocale(loc: crate::locale_t);
2923 pub fn freopen64(
2924 filename: *const c_char,
2925 mode: *const c_char,
2926 file: *mut crate::FILE,
2927 ) -> *mut crate::FILE;
2928 pub fn fseeko64(stream: *mut crate::FILE, offset: off64_t, whence: c_int) -> c_int;
2929 pub fn fsetpos64(stream: *mut crate::FILE, ptr: *const fpos64_t) -> c_int;
2930 pub fn fstat64(fildes: c_int, buf: *mut stat64) -> c_int;
2931 pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int;
2932 pub fn fstatfs64(fd: c_int, buf: *mut statfs64) -> c_int;
2933 pub fn fstatvfs64(fd: c_int, buf: *mut statvfs64) -> c_int;
2934 pub fn ftello64(stream: *mut crate::FILE) -> off64_t;
2935 pub fn ftok(path: *const c_char, id: c_int) -> crate::key_t;
2936 pub fn ftruncate64(fd: c_int, length: off64_t) -> c_int;
2937 pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int;
2938 pub fn getcontext(ucp: *mut ucontext_t) -> c_int;
2939 pub fn getdomainname(name: *mut c_char, len: c_int) -> c_int;
2940 pub fn getdtablesize() -> c_int;
2941 pub fn getgrent() -> *mut crate::group;
2942 pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group;
2943 #[link_name = "_posix_getgrgid_r"]
2944 pub fn getgrgid_r(
2945 gid: crate::gid_t,
2946 grp: *mut crate::group,
2947 buf: *mut c_char,
2948 buflen: size_t,
2949 result: *mut *mut crate::group,
2950 ) -> c_int;
2951 pub fn getgrnam(name: *const c_char) -> *mut crate::group;
2952 #[link_name = "_posix_getgrnam_r"]
2953 pub fn getgrnam_r(
2954 name: *const c_char,
2955 grp: *mut crate::group,
2956 buf: *mut c_char,
2957 buflen: size_t,
2958 result: *mut *mut crate::group,
2959 ) -> c_int;
2960 pub fn getgrset(user: *const c_char) -> *mut c_char;
2961 pub fn gethostid() -> c_long;
2962 pub fn getmntent(stream: *mut crate::FILE) -> *mut crate::mntent;
2963 pub fn getnameinfo(
2964 sa: *const crate::sockaddr,
2965 salen: size_t,
2966 host: *mut c_char,
2967 hostlen: size_t,
2968 serv: *mut c_char,
2969 servlen: size_t,
2970 flags: c_int,
2971 ) -> c_int;
2972 pub fn getpagesize() -> c_int;
2973 pub fn getpeereid(socket: c_int, euid: *mut crate::uid_t, egid: *mut crate::gid_t) -> c_int;
2974 pub fn getpriority(which: c_int, who: crate::id_t) -> c_int;
2975 pub fn getpwent() -> *mut crate::passwd;
2976 #[link_name = "_posix_getpwnam_r"]
2977 pub fn getpwnam_r(
2978 name: *const c_char,
2979 pwd: *mut passwd,
2980 buf: *mut c_char,
2981 buflen: size_t,
2982 result: *mut *mut passwd,
2983 ) -> c_int;
2984 #[link_name = "_posix_getpwuid_r"]
2985 pub fn getpwuid_r(
2986 uid: crate::uid_t,
2987 pwd: *mut passwd,
2988 buf: *mut c_char,
2989 buflen: size_t,
2990 result: *mut *mut passwd,
2991 ) -> c_int;
2992 pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int;
2993 pub fn getrlimit64(resource: c_int, rlim: *mut rlimit64) -> c_int;
2994 pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int;
2995 pub fn getitimer(which: c_int, curr_value: *mut crate::itimerval) -> c_int;
2996 pub fn getutent() -> *mut utmp;
2997 pub fn getutid(u: *const utmp) -> *mut utmp;
2998 pub fn getutline(u: *const utmp) -> *mut utmp;
2999 pub fn getutxent() -> *mut utmpx;
3000 pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
3001 pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
3002 pub fn glob(
3003 pattern: *const c_char,
3004 flags: c_int,
3005 errfunc: Option<extern "C" fn(epath: *const c_char, errno: c_int) -> c_int>,
3006 pglob: *mut crate::glob_t,
3007 ) -> c_int;
3008 pub fn globfree(pglob: *mut crate::glob_t);
3009 pub fn hasmntopt(mnt: *const crate::mntent, opt: *const c_char) -> *mut c_char;
3010 pub fn hcreate(nelt: size_t) -> c_int;
3011 pub fn hdestroy();
3012 pub fn hsearch(entry: entry, action: ACTION) -> *mut entry;
3013 pub fn if_freenameindex(ptr: *mut if_nameindex);
3014 pub fn if_nameindex() -> *mut if_nameindex;
3015 pub fn initgroups(name: *const c_char, basegid: crate::gid_t) -> c_int;
3016 pub fn ioctl(fildes: c_int, request: c_int, ...) -> c_int;
3017 pub fn jrand48(xseed: *mut c_ushort) -> c_long;
3018 pub fn lcong48(p: *mut c_ushort);
3019 pub fn lfind(
3020 key: *const c_void,
3021 base: *const c_void,
3022 nelp: *mut size_t,
3023 width: size_t,
3024 compar: Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
3025 ) -> *mut c_void;
3026 #[link_name = "_posix_lio_listio"]
3027 pub fn lio_listio(
3028 mode: c_int,
3029 aiocb_list: *const *mut aiocb,
3030 nent: c_int,
3031 sevp: *mut sigevent,
3032 ) -> c_int;
3033 pub fn loadquery(flags: c_int, buf: *mut c_void, buflen: c_uint, ...) -> c_int;
3034 pub fn lpar_get_info(command: c_int, buf: *mut c_void, bufsize: size_t) -> c_int;
3035 pub fn lpar_set_resources(id: c_int, resource: *mut c_void) -> c_int;
3036 pub fn lrand48() -> c_long;
3037 pub fn lsearch(
3038 key: *const c_void,
3039 base: *mut c_void,
3040 nelp: *mut size_t,
3041 width: size_t,
3042 compar: Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
3043 ) -> *mut c_void;
3044 pub fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> off64_t;
3045 pub fn lstat64(path: *const c_char, buf: *mut stat64) -> c_int;
3046 pub fn madvise(addr: caddr_t, len: size_t, advice: c_int) -> c_int;
3047 pub fn makecontext(ucp: *mut crate::ucontext_t, func: extern "C" fn(), argc: c_int, ...);
3048 pub fn mallinfo() -> crate::mallinfo;
3049 pub fn mallopt(param: c_int, value: c_int) -> c_int;
3050 pub fn memmem(
3051 haystack: *const c_void,
3052 haystacklen: size_t,
3053 needle: *const c_void,
3054 needlelen: size_t,
3055 ) -> *mut c_void;
3056 pub fn memset_s(s: *mut c_void, smax: size_t, c: c_int, n: size_t) -> c_int;
3057 pub fn mincore(addr: caddr_t, len: size_t, vec: *mut c_char) -> c_int;
3058 pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: mode_t) -> c_int;
3059 pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: mode_t, dev: dev_t) -> c_int;
3060 pub fn mount(device: *const c_char, path: *const c_char, flags: c_int) -> c_int;
3061 pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int;
3062 pub fn mq_close(mqd: crate::mqd_t) -> c_int;
3063 pub fn mq_getattr(mqd: crate::mqd_t, attr: *mut crate::mq_attr) -> c_int;
3064 pub fn mq_notify(mqd: crate::mqd_t, notification: *const crate::sigevent) -> c_int;
3065 pub fn mq_open(name: *const c_char, oflag: c_int, ...) -> crate::mqd_t;
3066 pub fn mq_receive(
3067 mqd: crate::mqd_t,
3068 msg_ptr: *mut c_char,
3069 msg_len: size_t,
3070 msg_prio: *mut c_uint,
3071 ) -> ssize_t;
3072 pub fn mq_send(
3073 mqd: crate::mqd_t,
3074 msg_ptr: *const c_char,
3075 msg_len: size_t,
3076 msg_prio: c_uint,
3077 ) -> c_int;
3078 pub fn mq_setattr(
3079 mqd: crate::mqd_t,
3080 newattr: *const crate::mq_attr,
3081 oldattr: *mut crate::mq_attr,
3082 ) -> c_int;
3083 pub fn mq_timedreceive(
3084 mqd: crate::mqd_t,
3085 msg_ptr: *mut c_char,
3086 msg_len: size_t,
3087 msg_prio: *mut c_uint,
3088 abs_timeout: *const crate::timespec,
3089 ) -> ssize_t;
3090 pub fn mq_timedsend(
3091 mqd: crate::mqd_t,
3092 msg_ptr: *const c_char,
3093 msg_len: size_t,
3094 msg_prio: c_uint,
3095 abs_timeout: *const crate::timespec,
3096 ) -> c_int;
3097 pub fn mq_unlink(name: *const c_char) -> c_int;
3098 pub fn mrand48() -> c_long;
3099 pub fn msgctl(msqid: c_int, cmd: c_int, buf: *mut msqid_ds) -> c_int;
3100 pub fn msgget(key: crate::key_t, msgflg: c_int) -> c_int;
3101 pub fn msgrcv(
3102 msqid: c_int,
3103 msgp: *mut c_void,
3104 msgsz: size_t,
3105 msgtyp: c_long,
3106 msgflg: c_int,
3107 ) -> ssize_t;
3108 pub fn msgsnd(msqid: c_int, msgp: *const c_void, msgsz: size_t, msgflg: c_int) -> c_int;
3109 pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int;
3110 pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t;
3111 pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char;
3112 pub fn nl_langinfo_l(item: crate::nl_item, loc: crate::locale_t) -> *mut c_char;
3113 pub fn nrand48(xseed: *mut c_ushort) -> c_long;
3114 pub fn open64(path: *const c_char, oflag: c_int, ...) -> c_int;
3115 pub fn pollset_create(maxfd: c_int) -> pollset_t;
3116 pub fn pollset_ctl(ps: pollset_t, pollctl_array: *mut poll_ctl, array_length: c_int) -> c_int;
3117 pub fn pollset_destroy(ps: pollset_t) -> c_int;
3118 pub fn pollset_poll(
3119 ps: pollset_t,
3120 polldata_array: *mut crate::pollfd,
3121 array_length: c_int,
3122 timeout: c_int,
3123 ) -> c_int;
3124 pub fn pollset_query(ps: pollset_t, pollfd_query: *mut crate::pollfd) -> c_int;
3125 pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE;
3126 pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int;
3127 pub fn posix_fadvise64(fd: c_int, offset: off64_t, len: off64_t, advise: c_int) -> c_int;
3128 pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int;
3129 pub fn posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int;
3130 pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int;
3131 pub fn posix_spawn(
3132 pid: *mut crate::pid_t,
3133 path: *const c_char,
3134 file_actions: *const crate::posix_spawn_file_actions_t,
3135 attrp: *const crate::posix_spawnattr_t,
3136 argv: *const *mut c_char,
3137 envp: *const *mut c_char,
3138 ) -> c_int;
3139 pub fn posix_spawn_file_actions_addclose(
3140 actions: *mut posix_spawn_file_actions_t,
3141 fd: c_int,
3142 ) -> c_int;
3143 pub fn posix_spawn_file_actions_adddup2(
3144 actions: *mut posix_spawn_file_actions_t,
3145 fd: c_int,
3146 newfd: c_int,
3147 ) -> c_int;
3148 pub fn posix_spawn_file_actions_addopen(
3149 actions: *mut posix_spawn_file_actions_t,
3150 fd: c_int,
3151 path: *const c_char,
3152 oflag: c_int,
3153 mode: mode_t,
3154 ) -> c_int;
3155 pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int;
3156 pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int;
3157 pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int;
3158 pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int;
3159 pub fn posix_spawnattr_getpgroup(
3160 attr: *const posix_spawnattr_t,
3161 flags: *mut crate::pid_t,
3162 ) -> c_int;
3163 pub fn posix_spawnattr_getschedparam(
3164 attr: *const posix_spawnattr_t,
3165 param: *mut crate::sched_param,
3166 ) -> c_int;
3167 pub fn posix_spawnattr_getschedpolicy(
3168 attr: *const posix_spawnattr_t,
3169 flags: *mut c_int,
3170 ) -> c_int;
3171 pub fn posix_spawnattr_getsigdefault(
3172 attr: *const posix_spawnattr_t,
3173 default: *mut sigset_t,
3174 ) -> c_int;
3175 pub fn posix_spawnattr_getsigmask(
3176 attr: *const posix_spawnattr_t,
3177 default: *mut sigset_t,
3178 ) -> c_int;
3179 pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int;
3180 pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int;
3181 pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int;
3182 pub fn posix_spawnattr_setschedparam(
3183 attr: *mut posix_spawnattr_t,
3184 param: *const crate::sched_param,
3185 ) -> c_int;
3186 pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int;
3187 pub fn posix_spawnattr_setsigdefault(
3188 attr: *mut posix_spawnattr_t,
3189 default: *const crate::sigset_t,
3190 ) -> c_int;
3191 pub fn posix_spawnattr_setsigmask(
3192 attr: *mut posix_spawnattr_t,
3193 default: *const crate::sigset_t,
3194 ) -> c_int;
3195 pub fn posix_spawnp(
3196 pid: *mut crate::pid_t,
3197 file: *const c_char,
3198 file_actions: *const crate::posix_spawn_file_actions_t,
3199 attrp: *const crate::posix_spawnattr_t,
3200 argv: *const *mut c_char,
3201 envp: *const *mut c_char,
3202 ) -> c_int;
3203 pub fn pread64(fd: c_int, buf: *mut c_void, count: size_t, offset: off64_t) -> ssize_t;
3204 pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: offset_t) -> ssize_t;
3205 pub fn ptrace64(
3206 request: c_int,
3207 id: c_longlong,
3208 addr: c_longlong,
3209 data: c_int,
3210 buff: *mut c_int,
3211 ) -> c_int;
3212 pub fn pututline(u: *const utmp) -> *mut utmp;
3213 pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
3214 pub fn pwrite64(fd: c_int, buf: *const c_void, count: size_t, offset: off64_t) -> ssize_t;
3215 pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: offset_t)
3216 -> ssize_t;
3217 pub fn quotactl(cmd: *mut c_char, special: c_int, id: c_int, data: caddr_t) -> c_int;
3218 pub fn rand() -> c_int;
3219 pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t;
3220 // AIX header socket.h maps recvfrom() to nrecvfrom()
3221 #[link_name = "nrecvfrom"]
3222 pub fn recvfrom(
3223 socket: c_int,
3224 buf: *mut c_void,
3225 len: size_t,
3226 flags: c_int,
3227 addr: *mut crate::sockaddr,
3228 addrlen: *mut crate::socklen_t,
3229 ) -> ssize_t;
3230 pub fn recvmmsg(
3231 sockfd: c_int,
3232 msgvec: *mut crate::mmsghdr,
3233 vlen: c_uint,
3234 flags: c_int,
3235 timeout: *mut crate::timespec,
3236 ) -> c_int;
3237 // AIX header socket.h maps recvmsg() to nrecvmsg().
3238 #[link_name = "nrecvmsg"]
3239 pub fn recvmsg(sockfd: c_int, msg: *mut msghdr, flags: c_int) -> ssize_t;
3240 pub fn regcomp(preg: *mut regex_t, pattern: *const c_char, cflags: c_int) -> c_int;
3241 pub fn regerror(
3242 errcode: c_int,
3243 preg: *const crate::regex_t,
3244 errbuf: *mut c_char,
3245 errbuf_size: size_t,
3246 ) -> size_t;
3247 pub fn regexec(
3248 preg: *const regex_t,
3249 input: *const c_char,
3250 nmatch: size_t,
3251 pmatch: *mut regmatch_t,
3252 eflags: c_int,
3253 ) -> c_int;
3254 pub fn regfree(preg: *mut regex_t);
3255 pub fn sbrk(increment: intptr_t) -> *mut c_void;
3256 pub fn sched_getparam(pid: crate::pid_t, param: *mut sched_param) -> c_int;
3257 pub fn sched_getscheduler(pid: crate::pid_t) -> c_int;
3258 pub fn sched_get_priority_max(policy: c_int) -> c_int;
3259 pub fn sched_get_priority_min(policy: c_int) -> c_int;
3260 pub fn sched_rr_get_interval(pid: crate::pid_t, tp: *mut crate::timespec) -> c_int;
3261 pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int;
3262 pub fn sched_setscheduler(
3263 pid: crate::pid_t,
3264 policy: c_int,
3265 param: *const crate::sched_param,
3266 ) -> c_int;
3267 pub fn sctp_opt_info(
3268 sd: c_int,
3269 id: crate::sctp_assoc_t,
3270 opt: c_int,
3271 arg_size: *mut c_void,
3272 size: *mut size_t,
3273 ) -> c_int;
3274 pub fn sctp_peeloff(s: c_int, id: *mut c_uint) -> c_int;
3275 pub fn seed48(xseed: *mut c_ushort) -> *mut c_ushort;
3276 pub fn seekdir(dirp: *mut crate::DIR, loc: c_long);
3277 pub fn sem_close(sem: *mut sem_t) -> c_int;
3278 pub fn sem_destroy(sem: *mut sem_t) -> c_int;
3279 pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int;
3280 pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int;
3281 pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t;
3282 pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int;
3283 pub fn sem_unlink(name: *const c_char) -> c_int;
3284 pub fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int;
3285 pub fn semget(key: crate::key_t, nsems: c_int, semflag: c_int) -> c_int;
3286 pub fn semop(semid: c_int, sops: *mut sembuf, nsops: size_t) -> c_int;
3287 pub fn send_file(socket: *mut c_int, iobuf: *mut sf_parms, flags: c_uint) -> ssize_t;
3288 pub fn sendmmsg(sockfd: c_int, msgvec: *mut mmsghdr, vlen: c_uint, flags: c_int) -> c_int;
3289 // AIX header socket.h maps sendmsg() to nsendmsg().
3290 #[link_name = "nsendmsg"]
3291 pub fn sendmsg(sockfd: c_int, msg: *const msghdr, flags: c_int) -> ssize_t;
3292 pub fn setcontext(ucp: *const ucontext_t) -> c_int;
3293 pub fn setdomainname(name: *const c_char, len: c_int) -> c_int;
3294 pub fn setgroups(ngroups: c_int, ptr: *const crate::gid_t) -> c_int;
3295 pub fn setgrent();
3296 pub fn sethostid(hostid: c_int) -> c_int;
3297 pub fn sethostname(name: *const c_char, len: c_int) -> c_int;
3298 pub fn setmntent(filename: *const c_char, ty: *const c_char) -> *mut crate::FILE;
3299 pub fn setpriority(which: c_int, who: id_t, priority: c_int) -> c_int;
3300 pub fn setpwent();
3301 pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int;
3302 pub fn setrlimit64(resource: c_int, rlim: *const rlimit64) -> c_int;
3303 pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int;
3304 pub fn setitimer(
3305 which: c_int,
3306 new_value: *const crate::itimerval,
3307 old_value: *mut crate::itimerval,
3308 ) -> c_int;
3309 pub fn setutent();
3310 pub fn setutxent();
3311 pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int;
3312 pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int;
3313 pub fn sigtimedwait(
3314 set: *const sigset_t,
3315 info: *mut siginfo_t,
3316 timeout: *const crate::timespec,
3317 ) -> c_int;
3318 pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int;
3319 pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int;
3320 pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void;
3321 pub fn shmdt(shmaddr: *const c_void) -> c_int;
3322 pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int;
3323 pub fn shmget(key: key_t, size: size_t, shmflg: c_int) -> c_int;
3324 pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int;
3325 pub fn shm_unlink(name: *const c_char) -> c_int;
3326 pub fn splice(socket1: c_int, socket2: c_int, flags: c_int) -> c_int;
3327 pub fn srand(seed: c_uint);
3328 pub fn srand48(seed: c_long);
3329 pub fn stat64(path: *const c_char, buf: *mut stat64) -> c_int;
3330 pub fn stat64at(dirfd: c_int, path: *const c_char, buf: *mut stat64, flags: c_int) -> c_int;
3331 pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int;
3332 pub fn statfs64(path: *const c_char, buf: *mut statfs64) -> c_int;
3333 pub fn statvfs64(path: *const c_char, buf: *mut statvfs64) -> c_int;
3334 pub fn statx(path: *const c_char, buf: *mut stat, length: c_int, command: c_int) -> c_int;
3335 pub fn strcasecmp_l(
3336 string1: *const c_char,
3337 string2: *const c_char,
3338 locale: crate::locale_t,
3339 ) -> c_int;
3340 pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int;
3341 pub fn strftime(
3342 arg1: *mut c_char,
3343 arg2: size_t,
3344 arg3: *const c_char,
3345 arg4: *const tm,
3346 ) -> size_t;
3347 pub fn strncasecmp_l(
3348 string1: *const c_char,
3349 string2: *const c_char,
3350 length: size_t,
3351 locale: crate::locale_t,
3352 ) -> c_int;
3353 pub fn strptime(s: *const c_char, format: *const c_char, tm: *mut crate::tm) -> *mut c_char;
3354 pub fn strsep(string: *mut *mut c_char, delim: *const c_char) -> *mut c_char;
3355 pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> c_int;
3356 pub fn swapoff(path: *const c_char) -> c_int;
3357 pub fn swapon(path: *const c_char) -> c_int;
3358 pub fn sync();
3359 pub fn telldir(dirp: *mut crate::DIR) -> c_long;
3360 pub fn timer_create(
3361 clockid: crate::clockid_t,
3362 sevp: *mut crate::sigevent,
3363 timerid: *mut crate::timer_t,
3364 ) -> c_int;
3365 pub fn timer_delete(timerid: timer_t) -> c_int;
3366 pub fn timer_getoverrun(timerid: timer_t) -> c_int;
3367 pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> c_int;
3368 pub fn timer_settime(
3369 timerid: crate::timer_t,
3370 flags: c_int,
3371 new_value: *const crate::itimerspec,
3372 old_value: *mut crate::itimerspec,
3373 ) -> c_int;
3374 pub fn truncate64(path: *const c_char, length: off64_t) -> c_int;
3375 pub fn uname(buf: *mut crate::utsname) -> c_int;
3376 pub fn updwtmp(file: *const c_char, u: *const utmp);
3377 pub fn uselocale(loc: crate::locale_t) -> crate::locale_t;
3378 pub fn utmpname(file: *const c_char) -> c_int;
3379 pub fn utimensat(
3380 dirfd: c_int,
3381 path: *const c_char,
3382 times: *const crate::timespec,
3383 flag: c_int,
3384 ) -> c_int;
3385 pub fn wait4(
3386 pid: crate::pid_t,
3387 status: *mut c_int,
3388 options: c_int,
3389 rusage: *mut crate::rusage,
3390 ) -> crate::pid_t;
3391 pub fn waitid(
3392 idtype: idtype_t,
3393 id: id_t,
3394 infop: *mut crate::siginfo_t,
3395 options: c_int,
3396 ) -> c_int;
3397 pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t;
3398
3399 // Use AIX thread-safe version errno.
3400 pub fn _Errno() -> *mut c_int;
3401}
3402
3403cfg_if! {
3404 if #[cfg(target_arch = "powerpc64")] {
3405 mod powerpc64;
3406 pub use self::powerpc64::*;
3407 }
3408}