blob: 3fc47bb5ebab3da81d5a6e57d130c5ab6bd43eb9 [file] [log] [blame]
Alex Crichton22b98de2017-08-26 20:39:46 -07001pub type c_char = i8;
2pub type wchar_t = i32;
3pub type useconds_t = u32;
4pub type dev_t = u32;
5pub type socklen_t = u32;
6pub type pthread_t = c_ulong;
7pub type mode_t = u32;
Matthew Maurere9a2a712020-01-02 15:36:15 -08008pub type ino64_t = u64;
9pub type off64_t = i64;
Alex Crichton22b98de2017-08-26 20:39:46 -070010pub type blkcnt64_t = i32;
11pub type rlim64_t = u64;
12pub type shmatt_t = ::c_ulong;
13pub type mqd_t = ::c_int;
14pub type msgqnum_t = ::c_ulong;
15pub type msglen_t = ::c_ulong;
16pub type nfds_t = ::c_ulong;
17pub type nl_item = ::c_int;
18pub type idtype_t = ::c_uint;
Matthew Maurere9a2a712020-01-02 15:36:15 -080019pub type loff_t = i64;
gnzlbg61c9de82019-05-22 18:51:50 +020020pub type pthread_key_t = ::c_uint;
Alex Crichton22b98de2017-08-26 20:39:46 -070021
22pub type clock_t = c_long;
23pub type time_t = c_long;
24pub type suseconds_t = c_long;
Matthew Maurere9a2a712020-01-02 15:36:15 -080025pub type ino_t = u64;
26pub type off_t = i64;
Alex Crichton22b98de2017-08-26 20:39:46 -070027pub type blkcnt_t = i32;
28
29pub type blksize_t = c_long;
30pub type fsblkcnt_t = u32;
31pub type fsfilcnt_t = u32;
32pub type rlim_t = ::c_ulonglong;
33pub type c_long = i32;
34pub type c_ulong = u32;
35pub type nlink_t = u32;
36
Bryant Mairsfa9cb782019-01-23 07:18:32 -080037#[cfg_attr(feature = "extra_traits", derive(Debug))]
Alex Crichton22b98de2017-08-26 20:39:46 -070038pub enum fpos64_t {} // TODO: fill this out with a struct
gnzlbg7ac0fe52019-02-13 10:38:54 +010039impl ::Copy for fpos64_t {}
40impl ::Clone for fpos64_t {
Matthew Maurere9a2a712020-01-02 15:36:15 -080041 fn clone(&self) -> fpos64_t {
42 *self
43 }
Bryant Mairsf3684582019-01-23 07:23:09 -080044}
Alex Crichton22b98de2017-08-26 20:39:46 -070045
46s! {
Alex Crichton22b98de2017-08-26 20:39:46 -070047 pub struct rlimit64 {
48 pub rlim_cur: rlim64_t,
49 pub rlim_max: rlim64_t,
50 }
51
52 pub struct glob_t {
53 pub gl_pathc: ::size_t,
54 pub gl_pathv: *mut *mut c_char,
55 pub gl_offs: ::size_t,
56 pub gl_flags: ::c_int,
57
58 __unused1: *mut ::c_void,
59 __unused2: *mut ::c_void,
60 __unused3: *mut ::c_void,
61 __unused4: *mut ::c_void,
62 __unused5: *mut ::c_void,
63 }
64
Alex Crichton22b98de2017-08-26 20:39:46 -070065 pub struct passwd {
66 pub pw_name: *mut ::c_char,
67 pub pw_passwd: *mut ::c_char,
68 pub pw_uid: ::uid_t,
69 pub pw_gid: ::gid_t,
70 pub pw_gecos: *mut ::c_char,
71 pub pw_dir: *mut ::c_char,
72 pub pw_shell: *mut ::c_char,
73 }
74
75 pub struct spwd {
76 pub sp_namp: *mut ::c_char,
77 pub sp_pwdp: *mut ::c_char,
78 pub sp_lstchg: ::c_long,
79 pub sp_min: ::c_long,
80 pub sp_max: ::c_long,
81 pub sp_warn: ::c_long,
82 pub sp_inact: ::c_long,
83 pub sp_expire: ::c_long,
84 pub sp_flag: ::c_ulong,
85 }
86
87 pub struct statvfs {
88 pub f_bsize: ::c_ulong,
89 pub f_frsize: ::c_ulong,
90 pub f_blocks: ::fsblkcnt_t,
91 pub f_bfree: ::fsblkcnt_t,
92 pub f_bavail: ::fsblkcnt_t,
93 pub f_files: ::fsfilcnt_t,
94 pub f_ffree: ::fsfilcnt_t,
95 pub f_favail: ::fsfilcnt_t,
96 pub f_fsid: ::c_ulong,
97 __f_unused: ::c_int,
98 pub f_flag: ::c_ulong,
99 pub f_namemax: ::c_ulong,
100 __f_spare: [::c_int; 6],
101 }
102
103 pub struct dqblk {
gnzlbga0865262019-05-29 13:17:17 +0200104 pub dqb_bhardlimit: u64,
105 pub dqb_bsoftlimit: u64,
106 pub dqb_curspace: u64,
107 pub dqb_ihardlimit: u64,
108 pub dqb_isoftlimit: u64,
109 pub dqb_curinodes: u64,
110 pub dqb_btime: u64,
111 pub dqb_itime: u64,
112 pub dqb_valid: u32,
Alex Crichton22b98de2017-08-26 20:39:46 -0700113 }
114
115 pub struct signalfd_siginfo {
gnzlbga0865262019-05-29 13:17:17 +0200116 pub ssi_signo: u32,
117 pub ssi_errno: i32,
118 pub ssi_code: i32,
119 pub ssi_pid: u32,
120 pub ssi_uid: u32,
121 pub ssi_fd: i32,
122 pub ssi_tid: u32,
123 pub ssi_band: u32,
124 pub ssi_overrun: u32,
125 pub ssi_trapno: u32,
126 pub ssi_status: i32,
127 pub ssi_int: i32,
128 pub ssi_ptr: u64,
129 pub ssi_utime: u64,
130 pub ssi_stime: u64,
131 pub ssi_addr: u64,
132 pub ssi_addr_lsb: u16,
133 _pad2: u16,
134 pub ssi_syscall: i32,
135 pub ssi_call_addr: u64,
136 pub ssi_arch: u32,
137 _pad: [u8; 28],
Alex Crichton22b98de2017-08-26 20:39:46 -0700138 }
139
140 pub struct fsid_t {
141 __val: [::c_int; 2],
142 }
143
Alex Crichton22b98de2017-08-26 20:39:46 -0700144 pub struct cpu_set_t {
145 bits: [u32; 32],
146 }
147
148 pub struct if_nameindex {
149 pub if_index: ::c_uint,
150 pub if_name: *mut ::c_char,
151 }
152
153 // System V IPC
154 pub struct msginfo {
155 pub msgpool: ::c_int,
156 pub msgmap: ::c_int,
157 pub msgmax: ::c_int,
158 pub msgmnb: ::c_int,
159 pub msgmni: ::c_int,
160 pub msgssz: ::c_int,
161 pub msgtql: ::c_int,
162 pub msgseg: ::c_ushort,
163 }
164
Alex Crichton22b98de2017-08-26 20:39:46 -0700165 pub struct sembuf {
166 pub sem_num: ::c_ushort,
167 pub sem_op: ::c_short,
168 pub sem_flg: ::c_short,
169 }
170
171 pub struct aiocb {
172 pub aio_fildes: ::c_int,
173 pub aio_lio_opcode: ::c_int,
174 pub aio_reqprio: ::c_int,
175 pub aio_buf: *mut ::c_void,
176 pub aio_nbytes: ::size_t,
177 pub aio_sigevent: ::sigevent,
178 __td: *mut ::c_void,
179 __lock: [::c_int; 2],
180 __err: ::c_int,
181 __ret: ::ssize_t,
182 pub aio_offset: off_t,
183 __next: *mut ::c_void,
184 __prev: *mut ::c_void,
185 __dummy4: [::c_char; 24],
186 }
187
188 pub struct sigaction {
189 pub sa_sigaction: ::sighandler_t,
190 pub sa_mask: ::sigset_t,
191 pub sa_flags: ::c_int,
gnzlbg7ac0fe52019-02-13 10:38:54 +0100192 pub sa_restorer: ::Option<extern fn()>,
Alex Crichton22b98de2017-08-26 20:39:46 -0700193 }
194
195 pub struct ipc_perm {
196 pub __ipc_perm_key: ::key_t,
197 pub uid: ::uid_t,
198 pub gid: ::gid_t,
199 pub cuid: ::uid_t,
200 pub cgid: ::gid_t,
201 pub mode: ::mode_t,
202 pub __seq: ::c_int,
203 __unused1: ::c_long,
204 __unused2: ::c_long
205 }
206
207 pub struct termios {
208 pub c_iflag: ::tcflag_t,
209 pub c_oflag: ::tcflag_t,
210 pub c_cflag: ::tcflag_t,
211 pub c_lflag: ::tcflag_t,
212 pub c_line: ::cc_t,
213 pub c_cc: [::cc_t; ::NCCS],
214 pub __c_ispeed: ::speed_t,
215 pub __c_ospeed: ::speed_t,
216 }
217
218 pub struct flock {
219 pub l_type: ::c_short,
220 pub l_whence: ::c_short,
221 pub l_start: ::off_t,
222 pub l_len: ::off_t,
223 pub l_pid: ::pid_t,
224 }
225
Matthew Maurere9a2a712020-01-02 15:36:15 -0800226 pub struct flock64 {
227 pub l_type: ::c_short,
228 pub l_whence: ::c_short,
229 pub l_start: ::off64_t,
230 pub l_len: ::off64_t,
231 pub l_pid: ::pid_t,
232 }
233
Alex Crichton22b98de2017-08-26 20:39:46 -0700234 pub struct pthread_attr_t {
235 __size: [u32; 11]
236 }
237
238 pub struct sigset_t {
239 __val: [::c_ulong; 32],
240 }
241
242 pub struct msghdr {
243 pub msg_name: *mut ::c_void,
244 pub msg_namelen: ::socklen_t,
245 pub msg_iov: *mut ::iovec,
246 pub msg_iovlen: ::c_int,
247 pub msg_control: *mut ::c_void,
248 pub msg_controllen: ::socklen_t,
249 pub msg_flags: ::c_int,
250 }
251
252 pub struct cmsghdr {
253 pub cmsg_len: ::socklen_t,
254 pub cmsg_level: ::c_int,
255 pub cmsg_type: ::c_int,
256 }
257
258 pub struct sem_t {
259 __val: [::c_int; 4],
260 }
261 pub struct stat {
262 pub st_dev: ::dev_t,
263 __st_dev_padding: ::c_int,
264 __st_ino_truncated: ::c_long,
265 pub st_mode: ::mode_t,
266 pub st_nlink: ::nlink_t,
267 pub st_uid: ::uid_t,
268 pub st_gid: ::gid_t,
269 pub st_rdev: ::dev_t,
270 __st_rdev_padding: ::c_int,
271 pub st_size: ::off_t,
272 pub st_blksize: ::blksize_t,
273 pub st_blocks: ::blkcnt_t,
274 pub st_atime: ::time_t,
275 pub st_atime_nsec: ::c_long,
276 pub st_mtime: ::time_t,
277 pub st_mtime_nsec: ::c_long,
278 pub st_ctime: ::time_t,
279 pub st_ctime_nsec: ::c_long,
280 pub st_ino: ::ino_t,
281 }
282
283 pub struct stat64 {
284 pub st_dev: ::dev_t,
285 __st_dev_padding: ::c_int,
286 __st_ino_truncated: ::c_long,
287 pub st_mode: ::mode_t,
288 pub st_nlink: ::nlink_t,
289 pub st_uid: ::uid_t,
290 pub st_gid: ::gid_t,
291 pub st_rdev: ::dev_t,
292 __st_rdev_padding: ::c_int,
293 pub st_size: ::off_t,
294 pub st_blksize: ::blksize_t,
295 pub st_blocks: ::blkcnt_t,
296 pub st_atime: ::time_t,
297 pub st_atime_nsec: ::c_long,
298 pub st_mtime: ::time_t,
299 pub st_mtime_nsec: ::c_long,
300 pub st_ctime: ::time_t,
301 pub st_ctime_nsec: ::c_long,
302 pub st_ino: ::ino_t,
303 }
304
305 pub struct stack_t {
306 pub ss_sp: *mut ::c_void,
307 pub ss_flags: ::c_int,
308 pub ss_size: ::size_t
309 }
310
311 pub struct shmid_ds {
312 pub shm_perm: ::ipc_perm,
313 pub shm_segsz: ::size_t,
314 pub shm_atime: ::time_t,
315 __unused1: ::c_int,
316 pub shm_dtime: ::time_t,
317 __unused2: ::c_int,
318 pub shm_ctime: ::time_t,
319 __unused3: ::c_int,
320 pub shm_cpid: ::pid_t,
321 pub shm_lpid: ::pid_t,
322 pub shm_nattch: ::c_ulong,
323 __pad1: ::c_ulong,
324 __pad2: ::c_ulong,
325 }
326
327 pub struct msqid_ds {
328 pub msg_perm: ::ipc_perm,
329 pub msg_stime: ::time_t,
330 __unused1: ::c_int,
331 pub msg_rtime: ::time_t,
332 __unused2: ::c_int,
333 pub msg_ctime: ::time_t,
334 __unused3: ::c_int,
335 __msg_cbytes: ::c_ulong,
336 pub msg_qnum: ::msgqnum_t,
337 pub msg_qbytes: ::msglen_t,
338 pub msg_lspid: ::pid_t,
339 pub msg_lrpid: ::pid_t,
340 __pad1: ::c_ulong,
341 __pad2: ::c_ulong,
342 }
343
344 pub struct statfs {
345 pub f_type: ::c_ulong,
346 pub f_bsize: ::c_ulong,
347 pub f_blocks: ::fsblkcnt_t,
348 pub f_bfree: ::fsblkcnt_t,
349 pub f_bavail: ::fsblkcnt_t,
350 pub f_files: ::fsfilcnt_t,
351 pub f_ffree: ::fsfilcnt_t,
352 pub f_fsid: ::fsid_t,
353 pub f_namelen: ::c_ulong,
354 pub f_frsize: ::c_ulong,
355 pub f_flags: ::c_ulong,
356 pub f_spare: [::c_ulong; 4],
357 }
358
359 pub struct siginfo_t {
360 pub si_signo: ::c_int,
361 pub si_errno: ::c_int,
362 pub si_code: ::c_int,
363 pub _pad: [::c_int; 29],
364 _align: [usize; 0],
365 }
366
367 pub struct statfs64 {
368 pub f_type: ::c_ulong,
369 pub f_bsize: ::c_ulong,
370 pub f_blocks: ::fsblkcnt_t,
371 pub f_bfree: ::fsblkcnt_t,
372 pub f_bavail: ::fsblkcnt_t,
373 pub f_files: ::fsfilcnt_t,
374 pub f_ffree: ::fsfilcnt_t,
375 pub f_fsid: ::fsid_t,
376 pub f_namelen: ::c_ulong,
377 pub f_frsize: ::c_ulong,
378 pub f_flags: ::c_ulong,
379 pub f_spare: [::c_ulong; 4],
380 }
381
382 pub struct statvfs64 {
383 pub f_bsize: ::c_ulong,
384 pub f_frsize: ::c_ulong,
385 pub f_blocks: u32,
386 pub f_bfree: u32,
387 pub f_bavail: u32,
388 pub f_files: u32,
389 pub f_ffree: u32,
390 pub f_favail: u32,
391 pub f_fsid: ::c_ulong,
392 __f_unused: ::c_int,
393 pub f_flag: ::c_ulong,
394 pub f_namemax: ::c_ulong,
395 __f_spare: [::c_int; 6],
396 }
Andrew Cann1cc2f1e2018-05-29 16:44:06 +0800397
398 pub struct arpd_request {
399 pub req: ::c_ushort,
400 pub ip: u32,
401 pub dev: ::c_ulong,
402 pub stamp: ::c_ulong,
403 pub updated: ::c_ulong,
404 pub ha: [::c_uchar; ::MAX_ADDR_LEN],
405 }
Alex Crichton22b98de2017-08-26 20:39:46 -0700406}
407
gnzlbga17a91c2019-02-07 11:37:21 +0100408s_no_extra_traits! {
gnzlbga17a91c2019-02-07 11:37:21 +0100409 pub struct dirent {
410 pub d_ino: ::ino_t,
411 pub d_off: ::off_t,
412 pub d_reclen: ::c_ushort,
413 pub d_type: ::c_uchar,
414 pub d_name: [::c_char; 256],
415 }
416
gnzlbga17a91c2019-02-07 11:37:21 +0100417 pub struct dirent64 {
418 pub d_ino: ::ino64_t,
419 pub d_off: ::off64_t,
420 pub d_reclen: ::c_ushort,
421 pub d_type: ::c_uchar,
422 pub d_name: [::c_char; 256],
423 }
424
gnzlbga17a91c2019-02-07 11:37:21 +0100425 pub struct sysinfo {
426 pub uptime: ::c_ulong,
427 pub loads: [::c_ulong; 3],
428 pub totalram: ::c_ulong,
429 pub freeram: ::c_ulong,
430 pub sharedram: ::c_ulong,
431 pub bufferram: ::c_ulong,
432 pub totalswap: ::c_ulong,
433 pub freeswap: ::c_ulong,
434 pub procs: ::c_ushort,
435 pub pad: ::c_ushort,
436 pub totalhigh: ::c_ulong,
437 pub freehigh: ::c_ulong,
438 pub mem_unit: ::c_uint,
439 pub __reserved: [::c_char; 256],
440 }
Bryant Mairs7d235af2019-05-27 08:37:42 -0700441
442 pub struct mq_attr {
443 pub mq_flags: ::c_long,
444 pub mq_maxmsg: ::c_long,
445 pub mq_msgsize: ::c_long,
446 pub mq_curmsgs: ::c_long,
447 pad: [::c_long; 4]
448 }
gnzlbga17a91c2019-02-07 11:37:21 +0100449}
450
Bryant Mairs9af1e002019-02-22 18:52:21 -0800451cfg_if! {
452 if #[cfg(feature = "extra_traits")] {
453 impl PartialEq for dirent {
454 fn eq(&self, other: &dirent) -> bool {
455 self.d_ino == other.d_ino
456 && self.d_off == other.d_off
457 && self.d_reclen == other.d_reclen
458 && self.d_type == other.d_type
459 && self
460 .d_name
461 .iter()
462 .zip(other.d_name.iter())
463 .all(|(a,b)| a == b)
464 }
465 }
466 impl Eq for dirent {}
467 impl ::fmt::Debug for dirent {
468 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
469 f.debug_struct("dirent")
470 .field("d_ino", &self.d_ino)
471 .field("d_off", &self.d_off)
472 .field("d_reclen", &self.d_reclen)
473 .field("d_type", &self.d_type)
474 // FIXME: .field("d_name", &self.d_name)
475 .finish()
476 }
477 }
478 impl ::hash::Hash for dirent {
479 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
480 self.d_ino.hash(state);
481 self.d_off.hash(state);
482 self.d_reclen.hash(state);
483 self.d_type.hash(state);
484 self.d_name.hash(state);
485 }
486 }
487
488 impl PartialEq for dirent64 {
489 fn eq(&self, other: &dirent64) -> bool {
490 self.d_ino == other.d_ino
491 && self.d_off == other.d_off
492 && self.d_reclen == other.d_reclen
493 && self.d_type == other.d_type
494 && self
495 .d_name
496 .iter()
497 .zip(other.d_name.iter())
498 .all(|(a,b)| a == b)
499 }
500 }
501 impl Eq for dirent64 {}
502 impl ::fmt::Debug for dirent64 {
503 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
504 f.debug_struct("dirent64")
505 .field("d_ino", &self.d_ino)
506 .field("d_off", &self.d_off)
507 .field("d_reclen", &self.d_reclen)
508 .field("d_type", &self.d_type)
509 // FIXME: .field("d_name", &self.d_name)
510 .finish()
511 }
512 }
513 impl ::hash::Hash for dirent64 {
514 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
515 self.d_ino.hash(state);
516 self.d_off.hash(state);
517 self.d_reclen.hash(state);
518 self.d_type.hash(state);
519 self.d_name.hash(state);
520 }
521 }
522
523 impl PartialEq for sysinfo {
524 fn eq(&self, other: &sysinfo) -> bool {
525 self.uptime == other.uptime
526 && self.loads == other.loads
527 && self.totalram == other.totalram
528 && self.freeram == other.freeram
529 && self.sharedram == other.sharedram
530 && self.bufferram == other.bufferram
531 && self.totalswap == other.totalswap
532 && self.freeswap == other.freeswap
533 && self.procs == other.procs
534 && self.pad == other.pad
535 && self.totalhigh == other.totalhigh
536 && self.freehigh == other.freehigh
537 && self.mem_unit == other.mem_unit
538 && self
539 .__reserved
540 .iter()
541 .zip(other.__reserved.iter())
542 .all(|(a,b)| a == b)
543 }
544 }
545 impl Eq for sysinfo {}
546 impl ::fmt::Debug for sysinfo {
547 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
548 f.debug_struct("sysinfo")
549 .field("uptime", &self.uptime)
550 .field("loads", &self.loads)
551 .field("totalram", &self.totalram)
552 .field("freeram", &self.freeram)
553 .field("sharedram", &self.sharedram)
554 .field("bufferram", &self.bufferram)
555 .field("totalswap", &self.totalswap)
556 .field("freeswap", &self.freeswap)
557 .field("procs", &self.procs)
558 .field("pad", &self.pad)
559 .field("totalhigh", &self.totalhigh)
560 .field("freehigh", &self.freehigh)
561 .field("mem_unit", &self.mem_unit)
562 // FIXME: .field("__reserved", &self.__reserved)
563 .finish()
564 }
565 }
566 impl ::hash::Hash for sysinfo {
567 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
568 self.uptime.hash(state);
569 self.loads.hash(state);
570 self.totalram.hash(state);
571 self.freeram.hash(state);
572 self.sharedram.hash(state);
573 self.bufferram.hash(state);
574 self.totalswap.hash(state);
575 self.freeswap.hash(state);
576 self.procs.hash(state);
577 self.pad.hash(state);
578 self.totalhigh.hash(state);
579 self.freehigh.hash(state);
580 self.mem_unit.hash(state);
581 self.__reserved.hash(state);
582 }
583 }
Bryant Mairs7d235af2019-05-27 08:37:42 -0700584
585 impl PartialEq for mq_attr {
586 fn eq(&self, other: &mq_attr) -> bool {
587 self.mq_flags == other.mq_flags &&
588 self.mq_maxmsg == other.mq_maxmsg &&
589 self.mq_msgsize == other.mq_msgsize &&
590 self.mq_curmsgs == other.mq_curmsgs
591 }
592 }
593 impl Eq for mq_attr {}
594 impl ::fmt::Debug for mq_attr {
595 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
596 f.debug_struct("mq_attr")
597 .field("mq_flags", &self.mq_flags)
598 .field("mq_maxmsg", &self.mq_maxmsg)
599 .field("mq_msgsize", &self.mq_msgsize)
600 .field("mq_curmsgs", &self.mq_curmsgs)
601 .finish()
602 }
603 }
604 impl ::hash::Hash for mq_attr {
605 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
606 self.mq_flags.hash(state);
607 self.mq_maxmsg.hash(state);
608 self.mq_msgsize.hash(state);
609 self.mq_curmsgs.hash(state);
610 }
611 }
Bryant Mairs9af1e002019-02-22 18:52:21 -0800612 }
613}
614
gnzlbg1cbc5232019-05-27 14:09:40 +0200615pub const MADV_SOFT_OFFLINE: ::c_int = 101;
gnzlbge42b1ed2019-05-16 13:29:09 +0200616pub const MS_NOUSER: ::c_ulong = 0x80000000;
gnzlbgcf0bd362019-05-28 14:44:56 +0200617pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
gnzlbge42b1ed2019-05-16 13:29:09 +0200618
Alex Crichton22b98de2017-08-26 20:39:46 -0700619pub const ABDAY_1: ::nl_item = 0x20000;
620pub const ABDAY_2: ::nl_item = 0x20001;
621pub const ABDAY_3: ::nl_item = 0x20002;
622pub const ABDAY_4: ::nl_item = 0x20003;
623pub const ABDAY_5: ::nl_item = 0x20004;
624pub const ABDAY_6: ::nl_item = 0x20005;
625pub const ABDAY_7: ::nl_item = 0x20006;
626
627pub const DAY_1: ::nl_item = 0x20007;
628pub const DAY_2: ::nl_item = 0x20008;
629pub const DAY_3: ::nl_item = 0x20009;
630pub const DAY_4: ::nl_item = 0x2000A;
631pub const DAY_5: ::nl_item = 0x2000B;
632pub const DAY_6: ::nl_item = 0x2000C;
633pub const DAY_7: ::nl_item = 0x2000D;
634
635pub const ABMON_1: ::nl_item = 0x2000E;
636pub const ABMON_2: ::nl_item = 0x2000F;
637pub const ABMON_3: ::nl_item = 0x20010;
638pub const ABMON_4: ::nl_item = 0x20011;
639pub const ABMON_5: ::nl_item = 0x20012;
640pub const ABMON_6: ::nl_item = 0x20013;
641pub const ABMON_7: ::nl_item = 0x20014;
642pub const ABMON_8: ::nl_item = 0x20015;
643pub const ABMON_9: ::nl_item = 0x20016;
644pub const ABMON_10: ::nl_item = 0x20017;
645pub const ABMON_11: ::nl_item = 0x20018;
646pub const ABMON_12: ::nl_item = 0x20019;
647
648pub const MON_1: ::nl_item = 0x2001A;
649pub const MON_2: ::nl_item = 0x2001B;
650pub const MON_3: ::nl_item = 0x2001C;
651pub const MON_4: ::nl_item = 0x2001D;
652pub const MON_5: ::nl_item = 0x2001E;
653pub const MON_6: ::nl_item = 0x2001F;
654pub const MON_7: ::nl_item = 0x20020;
655pub const MON_8: ::nl_item = 0x20021;
656pub const MON_9: ::nl_item = 0x20022;
657pub const MON_10: ::nl_item = 0x20023;
658pub const MON_11: ::nl_item = 0x20024;
659pub const MON_12: ::nl_item = 0x20025;
660
661pub const AM_STR: ::nl_item = 0x20026;
662pub const PM_STR: ::nl_item = 0x20027;
663
664pub const D_T_FMT: ::nl_item = 0x20028;
665pub const D_FMT: ::nl_item = 0x20029;
666pub const T_FMT: ::nl_item = 0x2002A;
667pub const T_FMT_AMPM: ::nl_item = 0x2002B;
668
669pub const ERA: ::nl_item = 0x2002C;
670pub const ERA_D_FMT: ::nl_item = 0x2002E;
671pub const ALT_DIGITS: ::nl_item = 0x2002F;
672pub const ERA_D_T_FMT: ::nl_item = 0x20030;
673pub const ERA_T_FMT: ::nl_item = 0x20031;
674
675pub const CODESET: ::nl_item = 14;
676
677pub const CRNCYSTR: ::nl_item = 0x4000F;
678
679pub const RUSAGE_THREAD: ::c_int = 1;
680pub const RUSAGE_CHILDREN: ::c_int = -1;
681
682pub const RADIXCHAR: ::nl_item = 0x10000;
683pub const THOUSEP: ::nl_item = 0x10001;
684
685pub const YESEXPR: ::nl_item = 0x50000;
686pub const NOEXPR: ::nl_item = 0x50001;
687pub const YESSTR: ::nl_item = 0x50002;
688pub const NOSTR: ::nl_item = 0x50003;
689
690pub const FILENAME_MAX: ::c_uint = 4096;
691pub const L_tmpnam: ::c_uint = 20;
692pub const _PC_LINK_MAX: ::c_int = 0;
693pub const _PC_MAX_CANON: ::c_int = 1;
694pub const _PC_MAX_INPUT: ::c_int = 2;
695pub const _PC_NAME_MAX: ::c_int = 3;
696pub const _PC_PATH_MAX: ::c_int = 4;
697pub const _PC_PIPE_BUF: ::c_int = 5;
698pub const _PC_CHOWN_RESTRICTED: ::c_int = 6;
699pub const _PC_NO_TRUNC: ::c_int = 7;
700pub const _PC_VDISABLE: ::c_int = 8;
701pub const _PC_SYNC_IO: ::c_int = 9;
702pub const _PC_ASYNC_IO: ::c_int = 10;
703pub const _PC_PRIO_IO: ::c_int = 11;
704pub const _PC_SOCK_MAXBUF: ::c_int = 12;
705pub const _PC_FILESIZEBITS: ::c_int = 13;
706pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
707pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
708pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
709pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
710pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18;
711pub const _PC_SYMLINK_MAX: ::c_int = 19;
712pub const _PC_2_SYMLINKS: ::c_int = 20;
713
714pub const _SC_ARG_MAX: ::c_int = 0;
715pub const _SC_CHILD_MAX: ::c_int = 1;
716pub const _SC_CLK_TCK: ::c_int = 2;
717pub const _SC_NGROUPS_MAX: ::c_int = 3;
718pub const _SC_OPEN_MAX: ::c_int = 4;
719pub const _SC_STREAM_MAX: ::c_int = 5;
720pub const _SC_TZNAME_MAX: ::c_int = 6;
721pub const _SC_JOB_CONTROL: ::c_int = 7;
722pub const _SC_SAVED_IDS: ::c_int = 8;
723pub const _SC_REALTIME_SIGNALS: ::c_int = 9;
724pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10;
725pub const _SC_TIMERS: ::c_int = 11;
726pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12;
727pub const _SC_PRIORITIZED_IO: ::c_int = 13;
728pub const _SC_SYNCHRONIZED_IO: ::c_int = 14;
729pub const _SC_FSYNC: ::c_int = 15;
730pub const _SC_MAPPED_FILES: ::c_int = 16;
731pub const _SC_MEMLOCK: ::c_int = 17;
732pub const _SC_MEMLOCK_RANGE: ::c_int = 18;
733pub const _SC_MEMORY_PROTECTION: ::c_int = 19;
734pub const _SC_MESSAGE_PASSING: ::c_int = 20;
735pub const _SC_SEMAPHORES: ::c_int = 21;
736pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22;
737pub const _SC_AIO_LISTIO_MAX: ::c_int = 23;
738pub const _SC_AIO_MAX: ::c_int = 24;
739pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25;
740pub const _SC_DELAYTIMER_MAX: ::c_int = 26;
741pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
742pub const _SC_MQ_PRIO_MAX: ::c_int = 28;
743pub const _SC_VERSION: ::c_int = 29;
744pub const _SC_PAGESIZE: ::c_int = 30;
745pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
746pub const _SC_RTSIG_MAX: ::c_int = 31;
747pub const _SC_SEM_NSEMS_MAX: ::c_int = 32;
748pub const _SC_SEM_VALUE_MAX: ::c_int = 33;
749pub const _SC_SIGQUEUE_MAX: ::c_int = 34;
750pub const _SC_TIMER_MAX: ::c_int = 35;
751pub const _SC_BC_BASE_MAX: ::c_int = 36;
752pub const _SC_BC_DIM_MAX: ::c_int = 37;
753pub const _SC_BC_SCALE_MAX: ::c_int = 38;
754pub const _SC_BC_STRING_MAX: ::c_int = 39;
755pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40;
756pub const _SC_EXPR_NEST_MAX: ::c_int = 42;
757pub const _SC_LINE_MAX: ::c_int = 43;
758pub const _SC_RE_DUP_MAX: ::c_int = 44;
759pub const _SC_2_VERSION: ::c_int = 46;
760pub const _SC_2_C_BIND: ::c_int = 47;
761pub const _SC_2_C_DEV: ::c_int = 48;
762pub const _SC_2_FORT_DEV: ::c_int = 49;
763pub const _SC_2_FORT_RUN: ::c_int = 50;
764pub const _SC_2_SW_DEV: ::c_int = 51;
765pub const _SC_2_LOCALEDEF: ::c_int = 52;
766pub const _SC_UIO_MAXIOV: ::c_int = 60;
767pub const _SC_IOV_MAX: ::c_int = 60;
768pub const _SC_THREADS: ::c_int = 67;
769pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68;
770pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69;
771pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70;
772pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
773pub const _SC_TTY_NAME_MAX: ::c_int = 72;
774pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73;
775pub const _SC_THREAD_KEYS_MAX: ::c_int = 74;
776pub const _SC_THREAD_STACK_MIN: ::c_int = 75;
777pub const _SC_THREAD_THREADS_MAX: ::c_int = 76;
778pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
779pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
780pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
781pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
782pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
783pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 82;
784pub const _SC_NPROCESSORS_CONF: ::c_int = 83;
785pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
786pub const _SC_PHYS_PAGES: ::c_int = 85;
787pub const _SC_AVPHYS_PAGES: ::c_int = 86;
788pub const _SC_ATEXIT_MAX: ::c_int = 87;
789pub const _SC_PASS_MAX: ::c_int = 88;
790pub const _SC_XOPEN_VERSION: ::c_int = 89;
791pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90;
792pub const _SC_XOPEN_UNIX: ::c_int = 91;
793pub const _SC_XOPEN_CRYPT: ::c_int = 92;
794pub const _SC_XOPEN_ENH_I18N: ::c_int = 93;
795pub const _SC_XOPEN_SHM: ::c_int = 94;
796pub const _SC_2_CHAR_TERM: ::c_int = 95;
797pub const _SC_2_UPE: ::c_int = 97;
798pub const _SC_XOPEN_XPG2: ::c_int = 98;
799pub const _SC_XOPEN_XPG3: ::c_int = 99;
800pub const _SC_XOPEN_XPG4: ::c_int = 100;
801pub const _SC_NZERO: ::c_int = 109;
802pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125;
803pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126;
804pub const _SC_XBS5_LP64_OFF64: ::c_int = 127;
805pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128;
806pub const _SC_XOPEN_LEGACY: ::c_int = 129;
807pub const _SC_XOPEN_REALTIME: ::c_int = 130;
808pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131;
809pub const _SC_ADVISORY_INFO: ::c_int = 132;
810pub const _SC_BARRIERS: ::c_int = 133;
811pub const _SC_CLOCK_SELECTION: ::c_int = 137;
812pub const _SC_CPUTIME: ::c_int = 138;
813pub const _SC_THREAD_CPUTIME: ::c_int = 139;
814pub const _SC_MONOTONIC_CLOCK: ::c_int = 149;
815pub const _SC_READER_WRITER_LOCKS: ::c_int = 153;
816pub const _SC_SPIN_LOCKS: ::c_int = 154;
817pub const _SC_REGEXP: ::c_int = 155;
818pub const _SC_SHELL: ::c_int = 157;
819pub const _SC_SPAWN: ::c_int = 159;
820pub const _SC_SPORADIC_SERVER: ::c_int = 160;
821pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 161;
822pub const _SC_TIMEOUTS: ::c_int = 164;
823pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 165;
824pub const _SC_2_PBS: ::c_int = 168;
825pub const _SC_2_PBS_ACCOUNTING: ::c_int = 169;
826pub const _SC_2_PBS_LOCATE: ::c_int = 170;
827pub const _SC_2_PBS_MESSAGE: ::c_int = 171;
828pub const _SC_2_PBS_TRACK: ::c_int = 172;
829pub const _SC_SYMLOOP_MAX: ::c_int = 173;
830pub const _SC_STREAMS: ::c_int = 174;
831pub const _SC_2_PBS_CHECKPOINT: ::c_int = 175;
832pub const _SC_V6_ILP32_OFF32: ::c_int = 176;
833pub const _SC_V6_ILP32_OFFBIG: ::c_int = 177;
834pub const _SC_V6_LP64_OFF64: ::c_int = 178;
835pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 179;
836pub const _SC_HOST_NAME_MAX: ::c_int = 180;
837pub const _SC_TRACE: ::c_int = 181;
838pub const _SC_TRACE_EVENT_FILTER: ::c_int = 182;
839pub const _SC_TRACE_INHERIT: ::c_int = 183;
840pub const _SC_TRACE_LOG: ::c_int = 184;
841pub const _SC_IPV6: ::c_int = 235;
842pub const _SC_RAW_SOCKETS: ::c_int = 236;
843pub const _SC_V7_ILP32_OFF32: ::c_int = 237;
844pub const _SC_V7_ILP32_OFFBIG: ::c_int = 238;
845pub const _SC_V7_LP64_OFF64: ::c_int = 239;
846pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 240;
847pub const _SC_SS_REPL_MAX: ::c_int = 241;
848pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 242;
849pub const _SC_TRACE_NAME_MAX: ::c_int = 243;
850pub const _SC_TRACE_SYS_MAX: ::c_int = 244;
851pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 245;
852pub const _SC_XOPEN_STREAMS: ::c_int = 246;
853pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247;
854pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248;
855
856pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
857pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
858
859pub const GLOB_ERR: ::c_int = 1 << 0;
860pub const GLOB_MARK: ::c_int = 1 << 1;
861pub const GLOB_NOSORT: ::c_int = 1 << 2;
862pub const GLOB_DOOFFS: ::c_int = 1 << 3;
863pub const GLOB_NOCHECK: ::c_int = 1 << 4;
864pub const GLOB_APPEND: ::c_int = 1 << 5;
865pub const GLOB_NOESCAPE: ::c_int = 1 << 6;
866
867pub const GLOB_NOSPACE: ::c_int = 1;
868pub const GLOB_ABORTED: ::c_int = 2;
869pub const GLOB_NOMATCH: ::c_int = 3;
870
871pub const POSIX_MADV_NORMAL: ::c_int = 0;
872pub const POSIX_MADV_RANDOM: ::c_int = 1;
873pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
874pub const POSIX_MADV_WILLNEED: ::c_int = 3;
875
876pub const S_IEXEC: mode_t = 64;
877pub const S_IWRITE: mode_t = 128;
878pub const S_IREAD: mode_t = 256;
879
880pub const F_LOCK: ::c_int = 1;
881pub const F_TEST: ::c_int = 3;
882pub const F_TLOCK: ::c_int = 2;
883pub const F_ULOCK: ::c_int = 0;
884
885pub const ST_RDONLY: ::c_ulong = 1;
886pub const ST_NOSUID: ::c_ulong = 2;
887pub const ST_NODEV: ::c_ulong = 4;
888pub const ST_NOEXEC: ::c_ulong = 8;
889pub const ST_SYNCHRONOUS: ::c_ulong = 16;
890pub const ST_MANDLOCK: ::c_ulong = 64;
891pub const ST_WRITE: ::c_ulong = 128;
892pub const ST_APPEND: ::c_ulong = 256;
893pub const ST_IMMUTABLE: ::c_ulong = 512;
894pub const ST_NOATIME: ::c_ulong = 1024;
895pub const ST_NODIRATIME: ::c_ulong = 2048;
896
897pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void;
898pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
899pub const RTLD_NODELETE: ::c_int = 0x1000;
900pub const RTLD_NOW: ::c_int = 0x2;
901
902pub const TCP_MD5SIG: ::c_int = 14;
903
Linus Färnstrand28196342018-07-21 00:47:01 +0200904align_const! {
905 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
906 size: [0; __SIZEOF_PTHREAD_MUTEX_T],
907 };
908 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
909 size: [0; __SIZEOF_PTHREAD_COND_T],
910 };
911 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
912 size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
913 };
914}
915
Alex Crichton22b98de2017-08-26 20:39:46 -0700916pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
917pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
918pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
919pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
920pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
921pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
922pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
923
924pub const SCHED_OTHER: ::c_int = 0;
925pub const SCHED_FIFO: ::c_int = 1;
926pub const SCHED_RR: ::c_int = 2;
927pub const SCHED_BATCH: ::c_int = 3;
928pub const SCHED_IDLE: ::c_int = 5;
929
930pub const AF_IB: ::c_int = 27;
931pub const AF_MPLS: ::c_int = 28;
932pub const AF_NFC: ::c_int = 39;
933pub const AF_VSOCK: ::c_int = 40;
Alex Crichton22b98de2017-08-26 20:39:46 -0700934pub const PF_IB: ::c_int = AF_IB;
935pub const PF_MPLS: ::c_int = AF_MPLS;
936pub const PF_NFC: ::c_int = AF_NFC;
937pub const PF_VSOCK: ::c_int = AF_VSOCK;
Alex Crichton22b98de2017-08-26 20:39:46 -0700938
939// System V IPC
940pub const IPC_PRIVATE: ::key_t = 0;
941
942pub const IPC_CREAT: ::c_int = 0o1000;
943pub const IPC_EXCL: ::c_int = 0o2000;
944pub const IPC_NOWAIT: ::c_int = 0o4000;
945
946pub const IPC_RMID: ::c_int = 0;
947pub const IPC_SET: ::c_int = 1;
948pub const IPC_STAT: ::c_int = 2;
949pub const IPC_INFO: ::c_int = 3;
950pub const MSG_STAT: ::c_int = 11;
951pub const MSG_INFO: ::c_int = 12;
952
953pub const MSG_NOERROR: ::c_int = 0o10000;
954pub const MSG_EXCEPT: ::c_int = 0o20000;
Alex Crichton22b98de2017-08-26 20:39:46 -0700955
956pub const SHM_R: ::c_int = 0o400;
957pub const SHM_W: ::c_int = 0o200;
958
959pub const SHM_RDONLY: ::c_int = 0o10000;
960pub const SHM_RND: ::c_int = 0o20000;
961pub const SHM_REMAP: ::c_int = 0o40000;
962pub const SHM_EXEC: ::c_int = 0o100000;
963
964pub const SHM_LOCK: ::c_int = 11;
965pub const SHM_UNLOCK: ::c_int = 12;
966
967pub const SHM_HUGETLB: ::c_int = 0o4000;
968pub const SHM_NORESERVE: ::c_int = 0o10000;
969
970pub const EPOLLRDHUP: ::c_int = 0x2000;
971pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
972pub const EPOLLONESHOT: ::c_int = 0x40000000;
973
974pub const QFMT_VFS_OLD: ::c_int = 1;
975pub const QFMT_VFS_V0: ::c_int = 2;
976
977pub const EFD_SEMAPHORE: ::c_int = 0x1;
978
979pub const LOG_NFACILITIES: ::c_int = 24;
980
981pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
982
983pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32;
984pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32;
985pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32;
986pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32;
987pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32;
988pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32;
989pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32;
990
991pub const AI_PASSIVE: ::c_int = 0x0001;
992pub const AI_CANONNAME: ::c_int = 0x0002;
993pub const AI_NUMERICHOST: ::c_int = 0x0004;
994pub const AI_V4MAPPED: ::c_int = 0x0008;
995pub const AI_ALL: ::c_int = 0x0010;
996pub const AI_ADDRCONFIG: ::c_int = 0x0020;
997
998pub const AI_NUMERICSERV: ::c_int = 0x0400;
999
1000pub const EAI_BADFLAGS: ::c_int = -1;
1001pub const EAI_NONAME: ::c_int = -2;
1002pub const EAI_AGAIN: ::c_int = -3;
1003pub const EAI_FAIL: ::c_int = -4;
1004pub const EAI_FAMILY: ::c_int = -6;
1005pub const EAI_SOCKTYPE: ::c_int = -7;
1006pub const EAI_SERVICE: ::c_int = -8;
1007pub const EAI_MEMORY: ::c_int = -10;
1008pub const EAI_OVERFLOW: ::c_int = -12;
1009
1010pub const NI_NUMERICHOST: ::c_int = 1;
1011pub const NI_NUMERICSERV: ::c_int = 2;
1012pub const NI_NOFQDN: ::c_int = 4;
1013pub const NI_NAMEREQD: ::c_int = 8;
1014pub const NI_DGRAM: ::c_int = 16;
1015
1016pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
1017pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
1018pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
1019
1020pub const EAI_SYSTEM: ::c_int = -11;
1021
1022pub const AIO_CANCELED: ::c_int = 0;
1023pub const AIO_NOTCANCELED: ::c_int = 1;
1024pub const AIO_ALLDONE: ::c_int = 2;
1025pub const LIO_READ: ::c_int = 0;
1026pub const LIO_WRITE: ::c_int = 1;
1027pub const LIO_NOP: ::c_int = 2;
1028pub const LIO_WAIT: ::c_int = 0;
1029pub const LIO_NOWAIT: ::c_int = 1;
1030
1031pub const MREMAP_MAYMOVE: ::c_int = 1;
1032pub const MREMAP_FIXED: ::c_int = 2;
1033
1034pub const PR_SET_PDEATHSIG: ::c_int = 1;
1035pub const PR_GET_PDEATHSIG: ::c_int = 2;
1036
1037pub const PR_GET_DUMPABLE: ::c_int = 3;
1038pub const PR_SET_DUMPABLE: ::c_int = 4;
1039
1040pub const PR_GET_UNALIGN: ::c_int = 5;
1041pub const PR_SET_UNALIGN: ::c_int = 6;
1042pub const PR_UNALIGN_NOPRINT: ::c_int = 1;
1043pub const PR_UNALIGN_SIGBUS: ::c_int = 2;
1044
1045pub const PR_GET_KEEPCAPS: ::c_int = 7;
1046pub const PR_SET_KEEPCAPS: ::c_int = 8;
1047
1048pub const PR_GET_FPEMU: ::c_int = 9;
1049pub const PR_SET_FPEMU: ::c_int = 10;
1050pub const PR_FPEMU_NOPRINT: ::c_int = 1;
1051pub const PR_FPEMU_SIGFPE: ::c_int = 2;
1052
1053pub const PR_GET_FPEXC: ::c_int = 11;
1054pub const PR_SET_FPEXC: ::c_int = 12;
1055pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80;
1056pub const PR_FP_EXC_DIV: ::c_int = 0x010000;
1057pub const PR_FP_EXC_OVF: ::c_int = 0x020000;
1058pub const PR_FP_EXC_UND: ::c_int = 0x040000;
1059pub const PR_FP_EXC_RES: ::c_int = 0x080000;
1060pub const PR_FP_EXC_INV: ::c_int = 0x100000;
1061pub const PR_FP_EXC_DISABLED: ::c_int = 0;
1062pub const PR_FP_EXC_NONRECOV: ::c_int = 1;
1063pub const PR_FP_EXC_ASYNC: ::c_int = 2;
1064pub const PR_FP_EXC_PRECISE: ::c_int = 3;
1065
1066pub const PR_GET_TIMING: ::c_int = 13;
1067pub const PR_SET_TIMING: ::c_int = 14;
1068pub const PR_TIMING_STATISTICAL: ::c_int = 0;
1069pub const PR_TIMING_TIMESTAMP: ::c_int = 1;
1070
1071pub const PR_SET_NAME: ::c_int = 15;
1072pub const PR_GET_NAME: ::c_int = 16;
1073
1074pub const PR_GET_ENDIAN: ::c_int = 19;
1075pub const PR_SET_ENDIAN: ::c_int = 20;
1076pub const PR_ENDIAN_BIG: ::c_int = 0;
1077pub const PR_ENDIAN_LITTLE: ::c_int = 1;
1078pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2;
1079
1080pub const PR_GET_SECCOMP: ::c_int = 21;
1081pub const PR_SET_SECCOMP: ::c_int = 22;
1082
1083pub const PR_CAPBSET_READ: ::c_int = 23;
1084pub const PR_CAPBSET_DROP: ::c_int = 24;
1085
1086pub const PR_GET_TSC: ::c_int = 25;
1087pub const PR_SET_TSC: ::c_int = 26;
1088pub const PR_TSC_ENABLE: ::c_int = 1;
1089pub const PR_TSC_SIGSEGV: ::c_int = 2;
1090
1091pub const PR_GET_SECUREBITS: ::c_int = 27;
1092pub const PR_SET_SECUREBITS: ::c_int = 28;
1093
1094pub const PR_SET_TIMERSLACK: ::c_int = 29;
1095pub const PR_GET_TIMERSLACK: ::c_int = 30;
1096
1097pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31;
1098pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32;
1099
1100pub const PR_MCE_KILL: ::c_int = 33;
1101pub const PR_MCE_KILL_CLEAR: ::c_int = 0;
1102pub const PR_MCE_KILL_SET: ::c_int = 1;
1103
1104pub const PR_MCE_KILL_LATE: ::c_int = 0;
1105pub const PR_MCE_KILL_EARLY: ::c_int = 1;
1106pub const PR_MCE_KILL_DEFAULT: ::c_int = 2;
1107
1108pub const PR_MCE_KILL_GET: ::c_int = 34;
1109
1110pub const PR_SET_MM: ::c_int = 35;
1111pub const PR_SET_MM_START_CODE: ::c_int = 1;
1112pub const PR_SET_MM_END_CODE: ::c_int = 2;
1113pub const PR_SET_MM_START_DATA: ::c_int = 3;
1114pub const PR_SET_MM_END_DATA: ::c_int = 4;
1115pub const PR_SET_MM_START_STACK: ::c_int = 5;
1116pub const PR_SET_MM_START_BRK: ::c_int = 6;
1117pub const PR_SET_MM_BRK: ::c_int = 7;
1118pub const PR_SET_MM_ARG_START: ::c_int = 8;
1119pub const PR_SET_MM_ARG_END: ::c_int = 9;
1120pub const PR_SET_MM_ENV_START: ::c_int = 10;
1121pub const PR_SET_MM_ENV_END: ::c_int = 11;
1122pub const PR_SET_MM_AUXV: ::c_int = 12;
1123pub const PR_SET_MM_EXE_FILE: ::c_int = 13;
1124pub const PR_SET_MM_MAP: ::c_int = 14;
1125pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
1126
1127pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
1128
1129pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
1130pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
1131
1132pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38;
1133pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
1134
1135pub const PR_GET_TID_ADDRESS: ::c_int = 40;
1136
1137pub const PR_SET_THP_DISABLE: ::c_int = 41;
1138pub const PR_GET_THP_DISABLE: ::c_int = 42;
1139
1140pub const PR_MPX_ENABLE_MANAGEMENT: ::c_int = 43;
1141pub const PR_MPX_DISABLE_MANAGEMENT: ::c_int = 44;
1142
1143pub const PR_SET_FP_MODE: ::c_int = 45;
1144pub const PR_GET_FP_MODE: ::c_int = 46;
1145pub const PR_FP_MODE_FR: ::c_int = 1 << 0;
1146pub const PR_FP_MODE_FRE: ::c_int = 1 << 1;
1147
1148pub const PR_CAP_AMBIENT: ::c_int = 47;
1149pub const PR_CAP_AMBIENT_IS_SET: ::c_int = 1;
1150pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2;
1151pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3;
1152pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
1153
1154pub const ITIMER_REAL: ::c_int = 0;
1155pub const ITIMER_VIRTUAL: ::c_int = 1;
1156pub const ITIMER_PROF: ::c_int = 2;
1157
1158pub const XATTR_CREATE: ::c_int = 0x1;
1159pub const XATTR_REPLACE: ::c_int = 0x2;
1160
1161pub const _POSIX_VDISABLE: ::cc_t = 0;
1162
1163pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
1164pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
Alex Crichton22b98de2017-08-26 20:39:46 -07001165
1166// On Linux, libc doesn't define this constant, libattr does instead.
1167// We still define it for Linux as it's defined by libc on other platforms,
1168// and it's mentioned in the man pages for getxattr and setxattr.
1169pub const SFD_CLOEXEC: ::c_int = 0x080000;
1170
1171pub const NCCS: usize = 32;
1172
1173pub const O_TRUNC: ::c_int = 512;
1174pub const O_NOATIME: ::c_int = 0o1000000;
1175pub const O_CLOEXEC: ::c_int = 0x80000;
1176
1177pub const EBFONT: ::c_int = 59;
1178pub const ENOSTR: ::c_int = 60;
1179pub const ENODATA: ::c_int = 61;
1180pub const ETIME: ::c_int = 62;
1181pub const ENOSR: ::c_int = 63;
1182pub const ENONET: ::c_int = 64;
1183pub const ENOPKG: ::c_int = 65;
1184pub const EREMOTE: ::c_int = 66;
1185pub const ENOLINK: ::c_int = 67;
1186pub const EADV: ::c_int = 68;
1187pub const ESRMNT: ::c_int = 69;
1188pub const ECOMM: ::c_int = 70;
1189pub const EPROTO: ::c_int = 71;
1190pub const EDOTDOT: ::c_int = 73;
1191
1192pub const SA_NODEFER: ::c_int = 0x40000000;
1193pub const SA_RESETHAND: ::c_int = 0x80000000;
1194pub const SA_RESTART: ::c_int = 0x10000000;
1195pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
1196
1197pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
1198
1199pub const EFD_CLOEXEC: ::c_int = 0x80000;
1200
1201pub const BUFSIZ: ::c_uint = 1024;
1202pub const TMP_MAX: ::c_uint = 10000;
1203pub const FOPEN_MAX: ::c_uint = 1000;
1204pub const O_PATH: ::c_int = 0o10000000;
1205pub const O_EXEC: ::c_int = 0o10000000;
1206pub const O_SEARCH: ::c_int = 0o10000000;
1207pub const O_ACCMODE: ::c_int = 0o10000003;
1208pub const O_NDELAY: ::c_int = O_NONBLOCK;
1209pub const NI_MAXHOST: ::socklen_t = 255;
1210pub const PTHREAD_STACK_MIN: ::size_t = 2048;
1211pub const POSIX_FADV_DONTNEED: ::c_int = 4;
1212pub const POSIX_FADV_NOREUSE: ::c_int = 5;
1213
1214pub const POSIX_MADV_DONTNEED: ::c_int = 0;
1215
1216pub const RLIM_INFINITY: ::rlim_t = !0;
gnzlbgcf0bd362019-05-28 14:44:56 +02001217pub const RLIMIT_NLIMITS: ::c_int = 15;
Alex Crichton22b98de2017-08-26 20:39:46 -07001218
1219pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
1220
Alex Crichton22b98de2017-08-26 20:39:46 -07001221pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
1222pub const TCP_THIN_DUPACK: ::c_int = 17;
1223pub const TCP_USER_TIMEOUT: ::c_int = 18;
1224pub const TCP_REPAIR: ::c_int = 19;
1225pub const TCP_REPAIR_QUEUE: ::c_int = 20;
1226pub const TCP_QUEUE_SEQ: ::c_int = 21;
1227pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
1228pub const TCP_FASTOPEN: ::c_int = 23;
1229pub const TCP_TIMESTAMP: ::c_int = 24;
1230
gnzlbg5ede8aa2019-05-28 12:55:30 +02001231#[doc(hidden)]
Matthew Maurere9a2a712020-01-02 15:36:15 -08001232#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
Alex Crichton22b98de2017-08-26 20:39:46 -07001233pub const SIGUNUSED: ::c_int = ::SIGSYS;
1234
1235pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
1236pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
1237pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
1238
1239pub const CPU_SETSIZE: ::c_int = 128;
1240
1241pub const QFMT_VFS_V1: ::c_int = 4;
1242
1243pub const PTRACE_TRACEME: ::c_int = 0;
1244pub const PTRACE_PEEKTEXT: ::c_int = 1;
1245pub const PTRACE_PEEKDATA: ::c_int = 2;
1246pub const PTRACE_PEEKUSER: ::c_int = 3;
1247pub const PTRACE_POKETEXT: ::c_int = 4;
1248pub const PTRACE_POKEDATA: ::c_int = 5;
1249pub const PTRACE_POKEUSER: ::c_int = 6;
1250pub const PTRACE_CONT: ::c_int = 7;
1251pub const PTRACE_KILL: ::c_int = 8;
1252pub const PTRACE_SINGLESTEP: ::c_int = 9;
1253pub const PTRACE_ATTACH: ::c_int = 16;
1254pub const PTRACE_DETACH: ::c_int = 17;
1255pub const PTRACE_SYSCALL: ::c_int = 24;
1256pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
1257pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
1258pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
1259pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
1260pub const PTRACE_GETREGSET: ::c_int = 0x4204;
1261pub const PTRACE_SETREGSET: ::c_int = 0x4205;
1262pub const PTRACE_SEIZE: ::c_int = 0x4206;
1263pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
1264pub const PTRACE_LISTEN: ::c_int = 0x4208;
1265pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
1266
1267pub const EPOLLWAKEUP: ::c_int = 0x20000000;
1268
1269pub const PTRACE_GETFPREGS: ::c_uint = 14;
1270pub const PTRACE_SETFPREGS: ::c_uint = 15;
1271pub const PTRACE_GETFPXREGS: ::c_uint = 18;
1272pub const PTRACE_SETFPXREGS: ::c_uint = 19;
1273pub const PTRACE_GETREGS: ::c_uint = 12;
1274pub const PTRACE_SETREGS: ::c_uint = 13;
1275
1276pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
1277
1278pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
1279
1280pub const TCSANOW: ::c_int = 0;
1281pub const TCSADRAIN: ::c_int = 1;
1282pub const TCSAFLUSH: ::c_int = 2;
1283
1284pub const TIOCINQ: ::c_int = ::FIONREAD;
1285
1286pub const RTLD_GLOBAL: ::c_int = 0x100;
1287pub const RTLD_NOLOAD: ::c_int = 0x4;
1288
1289// TODO(#247) Temporarily musl-specific (available since musl 0.9.12 / Linux
Matthew Maurere9a2a712020-01-02 15:36:15 -08001290// kernel 3.10). See also linux_like/mod.rs
Alex Crichton22b98de2017-08-26 20:39:46 -07001291pub const CLOCK_SGI_CYCLE: ::clockid_t = 10;
1292pub const CLOCK_TAI: ::clockid_t = 11;
1293
1294pub const MCL_CURRENT: ::c_int = 0x0001;
1295pub const MCL_FUTURE: ::c_int = 0x0002;
1296
1297pub const SIGSTKSZ: ::size_t = 8192;
1298pub const MINSIGSTKSZ: ::size_t = 2048;
1299pub const CBAUD: ::tcflag_t = 0o0010017;
1300pub const TAB1: ::c_int = 0x00000800;
1301pub const TAB2: ::c_int = 0x00001000;
1302pub const TAB3: ::c_int = 0x00001800;
Matthew Maurere9a2a712020-01-02 15:36:15 -08001303pub const CR1: ::c_int = 0x00000200;
1304pub const CR2: ::c_int = 0x00000400;
1305pub const CR3: ::c_int = 0x00000600;
1306pub const FF1: ::c_int = 0x00008000;
1307pub const BS1: ::c_int = 0x00002000;
1308pub const VT1: ::c_int = 0x00004000;
Alex Crichton22b98de2017-08-26 20:39:46 -07001309pub const VWERASE: usize = 14;
1310pub const VREPRINT: usize = 12;
1311pub const VSUSP: usize = 10;
1312pub const VSTART: usize = 8;
1313pub const VSTOP: usize = 9;
1314pub const VDISCARD: usize = 13;
1315pub const VTIME: usize = 5;
1316pub const IXON: ::tcflag_t = 0x00000400;
1317pub const IXOFF: ::tcflag_t = 0x00001000;
1318pub const ONLCR: ::tcflag_t = 0x4;
1319pub const CSIZE: ::tcflag_t = 0x00000030;
1320pub const CS6: ::tcflag_t = 0x00000010;
1321pub const CS7: ::tcflag_t = 0x00000020;
1322pub const CS8: ::tcflag_t = 0x00000030;
1323pub const CSTOPB: ::tcflag_t = 0x00000040;
1324pub const CREAD: ::tcflag_t = 0x00000080;
1325pub const PARENB: ::tcflag_t = 0x00000100;
1326pub const PARODD: ::tcflag_t = 0x00000200;
1327pub const HUPCL: ::tcflag_t = 0x00000400;
1328pub const CLOCAL: ::tcflag_t = 0x00000800;
1329pub const ECHOKE: ::tcflag_t = 0x00000800;
1330pub const ECHOE: ::tcflag_t = 0x00000010;
1331pub const ECHOK: ::tcflag_t = 0x00000020;
1332pub const ECHONL: ::tcflag_t = 0x00000040;
1333pub const ECHOPRT: ::tcflag_t = 0x00000400;
1334pub const ECHOCTL: ::tcflag_t = 0x00000200;
1335pub const ISIG: ::tcflag_t = 0x00000001;
1336pub const ICANON: ::tcflag_t = 0x00000002;
1337pub const PENDIN: ::tcflag_t = 0x00004000;
1338pub const NOFLSH: ::tcflag_t = 0x00000080;
1339pub const CBAUDEX: ::tcflag_t = 0o010000;
1340pub const VSWTC: usize = 7;
Matthew Maurere9a2a712020-01-02 15:36:15 -08001341pub const OLCUC: ::tcflag_t = 0o000002;
1342pub const NLDLY: ::tcflag_t = 0o000400;
1343pub const CRDLY: ::tcflag_t = 0o003000;
Alex Crichton22b98de2017-08-26 20:39:46 -07001344pub const TABDLY: ::tcflag_t = 0o014000;
Matthew Maurere9a2a712020-01-02 15:36:15 -08001345pub const BSDLY: ::tcflag_t = 0o020000;
1346pub const FFDLY: ::tcflag_t = 0o100000;
1347pub const VTDLY: ::tcflag_t = 0o040000;
1348pub const XTABS: ::tcflag_t = 0o014000;
Alex Crichton22b98de2017-08-26 20:39:46 -07001349
1350pub const B0: ::speed_t = 0o000000;
1351pub const B50: ::speed_t = 0o000001;
1352pub const B75: ::speed_t = 0o000002;
1353pub const B110: ::speed_t = 0o000003;
1354pub const B134: ::speed_t = 0o000004;
1355pub const B150: ::speed_t = 0o000005;
1356pub const B200: ::speed_t = 0o000006;
1357pub const B300: ::speed_t = 0o000007;
1358pub const B600: ::speed_t = 0o000010;
1359pub const B1200: ::speed_t = 0o000011;
1360pub const B1800: ::speed_t = 0o000012;
1361pub const B2400: ::speed_t = 0o000013;
1362pub const B4800: ::speed_t = 0o000014;
1363pub const B9600: ::speed_t = 0o000015;
1364pub const B19200: ::speed_t = 0o000016;
1365pub const B38400: ::speed_t = 0o000017;
1366pub const B57600: ::speed_t = 0o010001;
1367pub const B115200: ::speed_t = 0o010002;
1368pub const B230400: ::speed_t = 0o010003;
1369pub const B460800: ::speed_t = 0o010004;
1370pub const B500000: ::speed_t = 0o010005;
1371pub const B576000: ::speed_t = 0o010006;
1372pub const B921600: ::speed_t = 0o010007;
1373pub const B1000000: ::speed_t = 0o010010;
1374pub const B1152000: ::speed_t = 0o010011;
1375pub const B1500000: ::speed_t = 0o010012;
1376pub const B2000000: ::speed_t = 0o010013;
1377pub const B2500000: ::speed_t = 0o010014;
1378pub const B3000000: ::speed_t = 0o010015;
1379pub const B3500000: ::speed_t = 0o010016;
1380pub const B4000000: ::speed_t = 0o010017;
1381
1382pub const SO_BINDTODEVICE: ::c_int = 25;
1383pub const SO_TIMESTAMP: ::c_int = 29;
1384pub const SO_MARK: ::c_int = 36;
1385pub const SO_RXQ_OVFL: ::c_int = 40;
1386pub const SO_PEEK_OFF: ::c_int = 42;
1387pub const SO_BUSY_POLL: ::c_int = 46;
1388
1389pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
1390pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 28;
1391
1392pub const O_DIRECT: ::c_int = 0x4000;
1393pub const O_DIRECTORY: ::c_int = 0x10000;
1394pub const O_NOFOLLOW: ::c_int = 0x20000;
1395pub const O_ASYNC: ::c_int = 0x2000;
1396
1397pub const FIOCLEX: ::c_int = 0x5451;
1398pub const FIONBIO: ::c_int = 0x5421;
1399
1400pub const RLIMIT_RSS: ::c_int = 5;
1401pub const RLIMIT_NOFILE: ::c_int = 7;
1402pub const RLIMIT_AS: ::c_int = 9;
1403pub const RLIMIT_NPROC: ::c_int = 6;
1404pub const RLIMIT_MEMLOCK: ::c_int = 8;
gnzlbgf75483a2019-05-31 14:35:46 +02001405pub const RLIMIT_CPU: ::c_int = 0;
1406pub const RLIMIT_FSIZE: ::c_int = 1;
1407pub const RLIMIT_DATA: ::c_int = 2;
1408pub const RLIMIT_STACK: ::c_int = 3;
1409pub const RLIMIT_CORE: ::c_int = 4;
1410pub const RLIMIT_LOCKS: ::c_int = 10;
1411pub const RLIMIT_SIGPENDING: ::c_int = 11;
1412pub const RLIMIT_MSGQUEUE: ::c_int = 12;
1413pub const RLIMIT_NICE: ::c_int = 13;
1414pub const RLIMIT_RTPRIO: ::c_int = 14;
Alex Crichton22b98de2017-08-26 20:39:46 -07001415
1416pub const O_APPEND: ::c_int = 1024;
1417pub const O_CREAT: ::c_int = 64;
1418pub const O_EXCL: ::c_int = 128;
1419pub const O_NOCTTY: ::c_int = 256;
1420pub const O_NONBLOCK: ::c_int = 2048;
1421pub const O_SYNC: ::c_int = 1052672;
1422pub const O_RSYNC: ::c_int = 1052672;
1423pub const O_DSYNC: ::c_int = 4096;
1424
1425pub const SOCK_NONBLOCK: ::c_int = 2048;
1426
1427pub const MAP_ANON: ::c_int = 0x0020;
1428pub const MAP_GROWSDOWN: ::c_int = 0x0100;
1429pub const MAP_DENYWRITE: ::c_int = 0x0800;
1430pub const MAP_EXECUTABLE: ::c_int = 0x01000;
1431pub const MAP_LOCKED: ::c_int = 0x02000;
1432pub const MAP_NORESERVE: ::c_int = 0x04000;
1433pub const MAP_POPULATE: ::c_int = 0x08000;
1434pub const MAP_NONBLOCK: ::c_int = 0x010000;
1435pub const MAP_STACK: ::c_int = 0x020000;
1436
1437pub const SOCK_STREAM: ::c_int = 1;
1438pub const SOCK_DGRAM: ::c_int = 2;
1439pub const SOCK_SEQPACKET: ::c_int = 5;
1440
1441pub const SOL_SOCKET: ::c_int = 1;
1442
1443pub const EDEADLK: ::c_int = 35;
1444pub const ENAMETOOLONG: ::c_int = 36;
1445pub const ENOLCK: ::c_int = 37;
1446pub const ENOSYS: ::c_int = 38;
1447pub const ENOTEMPTY: ::c_int = 39;
1448pub const ELOOP: ::c_int = 40;
1449pub const ENOMSG: ::c_int = 42;
1450pub const EIDRM: ::c_int = 43;
1451pub const ECHRNG: ::c_int = 44;
1452pub const EL2NSYNC: ::c_int = 45;
1453pub const EL3HLT: ::c_int = 46;
1454pub const EL3RST: ::c_int = 47;
1455pub const ELNRNG: ::c_int = 48;
1456pub const EUNATCH: ::c_int = 49;
1457pub const ENOCSI: ::c_int = 50;
1458pub const EL2HLT: ::c_int = 51;
1459pub const EBADE: ::c_int = 52;
1460pub const EBADR: ::c_int = 53;
1461pub const EXFULL: ::c_int = 54;
1462pub const ENOANO: ::c_int = 55;
1463pub const EBADRQC: ::c_int = 56;
1464pub const EBADSLT: ::c_int = 57;
1465pub const EDEADLOCK: ::c_int = EDEADLK;
1466pub const EMULTIHOP: ::c_int = 72;
1467pub const EBADMSG: ::c_int = 74;
1468pub const EOVERFLOW: ::c_int = 75;
1469pub const ENOTUNIQ: ::c_int = 76;
1470pub const EBADFD: ::c_int = 77;
1471pub const EREMCHG: ::c_int = 78;
1472pub const ELIBACC: ::c_int = 79;
1473pub const ELIBBAD: ::c_int = 80;
1474pub const ELIBSCN: ::c_int = 81;
1475pub const ELIBMAX: ::c_int = 82;
1476pub const ELIBEXEC: ::c_int = 83;
1477pub const EILSEQ: ::c_int = 84;
1478pub const ERESTART: ::c_int = 85;
1479pub const ESTRPIPE: ::c_int = 86;
1480pub const EUSERS: ::c_int = 87;
1481pub const ENOTSOCK: ::c_int = 88;
1482pub const EDESTADDRREQ: ::c_int = 89;
1483pub const EMSGSIZE: ::c_int = 90;
1484pub const EPROTOTYPE: ::c_int = 91;
1485pub const ENOPROTOOPT: ::c_int = 92;
1486pub const EPROTONOSUPPORT: ::c_int = 93;
1487pub const ESOCKTNOSUPPORT: ::c_int = 94;
1488pub const EOPNOTSUPP: ::c_int = 95;
1489pub const ENOTSUP: ::c_int = EOPNOTSUPP;
1490pub const EPFNOSUPPORT: ::c_int = 96;
1491pub const EAFNOSUPPORT: ::c_int = 97;
1492pub const EADDRINUSE: ::c_int = 98;
1493pub const EADDRNOTAVAIL: ::c_int = 99;
1494pub const ENETDOWN: ::c_int = 100;
1495pub const ENETUNREACH: ::c_int = 101;
1496pub const ENETRESET: ::c_int = 102;
1497pub const ECONNABORTED: ::c_int = 103;
1498pub const ECONNRESET: ::c_int = 104;
1499pub const ENOBUFS: ::c_int = 105;
1500pub const EISCONN: ::c_int = 106;
1501pub const ENOTCONN: ::c_int = 107;
1502pub const ESHUTDOWN: ::c_int = 108;
1503pub const ETOOMANYREFS: ::c_int = 109;
1504pub const ETIMEDOUT: ::c_int = 110;
1505pub const ECONNREFUSED: ::c_int = 111;
1506pub const EHOSTDOWN: ::c_int = 112;
1507pub const EHOSTUNREACH: ::c_int = 113;
1508pub const EALREADY: ::c_int = 114;
1509pub const EINPROGRESS: ::c_int = 115;
1510pub const ESTALE: ::c_int = 116;
1511pub const EUCLEAN: ::c_int = 117;
1512pub const ENOTNAM: ::c_int = 118;
1513pub const ENAVAIL: ::c_int = 119;
1514pub const EISNAM: ::c_int = 120;
1515pub const EREMOTEIO: ::c_int = 121;
1516pub const EDQUOT: ::c_int = 122;
1517pub const ENOMEDIUM: ::c_int = 123;
1518pub const EMEDIUMTYPE: ::c_int = 124;
1519pub const ECANCELED: ::c_int = 125;
1520pub const ENOKEY: ::c_int = 126;
1521pub const EKEYEXPIRED: ::c_int = 127;
1522pub const EKEYREVOKED: ::c_int = 128;
1523pub const EKEYREJECTED: ::c_int = 129;
1524pub const EOWNERDEAD: ::c_int = 130;
1525pub const ENOTRECOVERABLE: ::c_int = 131;
1526pub const ERFKILL: ::c_int = 132;
1527pub const EHWPOISON: ::c_int = 133;
1528
1529pub const SO_REUSEADDR: ::c_int = 2;
1530pub const SO_TYPE: ::c_int = 3;
1531pub const SO_ERROR: ::c_int = 4;
1532pub const SO_DONTROUTE: ::c_int = 5;
1533pub const SO_BROADCAST: ::c_int = 6;
1534pub const SO_SNDBUF: ::c_int = 7;
1535pub const SO_RCVBUF: ::c_int = 8;
1536pub const SO_KEEPALIVE: ::c_int = 9;
1537pub const SO_OOBINLINE: ::c_int = 10;
1538pub const SO_LINGER: ::c_int = 13;
1539pub const SO_REUSEPORT: ::c_int = 15;
1540pub const SO_RCVLOWAT: ::c_int = 18;
1541pub const SO_SNDLOWAT: ::c_int = 19;
1542pub const SO_RCVTIMEO: ::c_int = 20;
1543pub const SO_SNDTIMEO: ::c_int = 21;
1544pub const SO_ACCEPTCONN: ::c_int = 30;
1545
1546pub const SA_ONSTACK: ::c_int = 0x08000000;
1547pub const SA_SIGINFO: ::c_int = 0x00000004;
1548pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
1549
1550pub const SIGCHLD: ::c_int = 17;
1551pub const SIGBUS: ::c_int = 7;
1552pub const SIGTTIN: ::c_int = 21;
1553pub const SIGTTOU: ::c_int = 22;
1554pub const SIGXCPU: ::c_int = 24;
1555pub const SIGXFSZ: ::c_int = 25;
1556pub const SIGVTALRM: ::c_int = 26;
1557pub const SIGPROF: ::c_int = 27;
1558pub const SIGWINCH: ::c_int = 28;
1559pub const SIGUSR1: ::c_int = 10;
1560pub const SIGUSR2: ::c_int = 12;
1561pub const SIGCONT: ::c_int = 18;
1562pub const SIGSTOP: ::c_int = 19;
1563pub const SIGTSTP: ::c_int = 20;
1564pub const SIGURG: ::c_int = 23;
1565pub const SIGIO: ::c_int = 29;
1566pub const SIGSYS: ::c_int = 31;
1567pub const SIGSTKFLT: ::c_int = 16;
1568pub const SIGPOLL: ::c_int = 29;
1569pub const SIGPWR: ::c_int = 30;
1570pub const SIG_SETMASK: ::c_int = 2;
1571pub const SIG_BLOCK: ::c_int = 0x000000;
1572pub const SIG_UNBLOCK: ::c_int = 0x01;
1573
1574pub const EXTPROC: ::tcflag_t = 0x00010000;
1575
1576pub const MAP_HUGETLB: ::c_int = 0x040000;
1577
1578pub const F_GETLK: ::c_int = 12;
1579pub const F_GETOWN: ::c_int = 9;
1580pub const F_SETLK: ::c_int = 13;
1581pub const F_SETLKW: ::c_int = 14;
1582pub const F_SETOWN: ::c_int = 8;
1583
1584pub const VEOF: usize = 4;
1585pub const VEOL: usize = 11;
1586pub const VEOL2: usize = 16;
1587pub const VMIN: usize = 6;
1588pub const IEXTEN: ::tcflag_t = 0x00008000;
1589pub const TOSTOP: ::tcflag_t = 0x00000100;
1590pub const FLUSHO: ::tcflag_t = 0x00001000;
1591
1592pub const TCGETS: ::c_int = 0x5401;
1593pub const TCSETS: ::c_int = 0x5402;
1594pub const TCSETSW: ::c_int = 0x5403;
1595pub const TCSETSF: ::c_int = 0x5404;
1596pub const TCGETA: ::c_int = 0x5405;
1597pub const TCSETA: ::c_int = 0x5406;
1598pub const TCSETAW: ::c_int = 0x5407;
1599pub const TCSETAF: ::c_int = 0x5408;
1600pub const TCSBRK: ::c_int = 0x5409;
1601pub const TCXONC: ::c_int = 0x540A;
1602pub const TCFLSH: ::c_int = 0x540B;
1603pub const TIOCGSOFTCAR: ::c_int = 0x5419;
1604pub const TIOCSSOFTCAR: ::c_int = 0x541A;
1605pub const TIOCLINUX: ::c_int = 0x541C;
1606pub const TIOCGSERIAL: ::c_int = 0x541E;
1607pub const TIOCEXCL: ::c_int = 0x540C;
1608pub const TIOCNXCL: ::c_int = 0x540D;
1609pub const TIOCSCTTY: ::c_int = 0x540E;
1610pub const TIOCGPGRP: ::c_int = 0x540F;
1611pub const TIOCSPGRP: ::c_int = 0x5410;
1612pub const TIOCOUTQ: ::c_int = 0x5411;
1613pub const TIOCSTI: ::c_int = 0x5412;
1614pub const TIOCGWINSZ: ::c_int = 0x5413;
1615pub const TIOCSWINSZ: ::c_int = 0x5414;
1616pub const TIOCMGET: ::c_int = 0x5415;
1617pub const TIOCMBIS: ::c_int = 0x5416;
1618pub const TIOCMBIC: ::c_int = 0x5417;
1619pub const TIOCMSET: ::c_int = 0x5418;
1620pub const FIONREAD: ::c_int = 0x541B;
1621pub const TIOCCONS: ::c_int = 0x541D;
1622
1623pub const SYS_gettid: ::c_long = 224; // Valid for arm (32-bit) and x86 (32-bit)
1624
1625pub const POLLWRNORM: ::c_short = 0x100;
1626pub const POLLWRBAND: ::c_short = 0x200;
1627
1628pub const TIOCM_LE: ::c_int = 0x001;
1629pub const TIOCM_DTR: ::c_int = 0x002;
1630pub const TIOCM_RTS: ::c_int = 0x004;
1631pub const TIOCM_ST: ::c_int = 0x008;
1632pub const TIOCM_SR: ::c_int = 0x010;
1633pub const TIOCM_CTS: ::c_int = 0x020;
1634pub const TIOCM_CAR: ::c_int = 0x040;
1635pub const TIOCM_RNG: ::c_int = 0x080;
1636pub const TIOCM_DSR: ::c_int = 0x100;
1637pub const TIOCM_CD: ::c_int = TIOCM_CAR;
1638pub const TIOCM_RI: ::c_int = TIOCM_RNG;
1639pub const O_TMPFILE: ::c_int = 0x400000;
1640
Andrew Cann1cc2f1e2018-05-29 16:44:06 +08001641pub const MAX_ADDR_LEN: usize = 7;
1642pub const ARPD_UPDATE: ::c_ushort = 0x01;
1643pub const ARPD_LOOKUP: ::c_ushort = 0x02;
1644pub const ARPD_FLUSH: ::c_ushort = 0x03;
1645pub const ATF_MAGIC: ::c_int = 0x80;
1646
Alex Crichton22b98de2017-08-26 20:39:46 -07001647f! {
Alan Somerseddc8d32019-02-05 08:00:26 -07001648 pub fn CMSG_NXTHDR(mhdr: *const msghdr,
1649 cmsg: *const cmsghdr) -> *mut cmsghdr {
gnzlbg7ac0fe52019-02-13 10:38:54 +01001650 if ((*cmsg).cmsg_len as usize) < ::mem::size_of::<cmsghdr>() {
Alan Somerseddc8d32019-02-05 08:00:26 -07001651 return 0 as *mut cmsghdr;
1652 };
1653 let next = (cmsg as usize +
1654 super::CMSG_ALIGN((*cmsg).cmsg_len as usize))
1655 as *mut cmsghdr;
1656 let max = (*mhdr).msg_control as usize
1657 + (*mhdr).msg_controllen as usize;
1658 if (next.offset(1)) as usize > max {
1659 0 as *mut cmsghdr
1660 } else {
1661 next as *mut cmsghdr
1662 }
1663 }
1664
Alex Crichton22b98de2017-08-26 20:39:46 -07001665 pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
1666 for slot in cpuset.bits.iter_mut() {
1667 *slot = 0;
1668 }
1669 }
1670
1671 pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
gnzlbg7ac0fe52019-02-13 10:38:54 +01001672 let size_in_bits
1673 = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
Alex Crichton22b98de2017-08-26 20:39:46 -07001674 let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
1675 cpuset.bits[idx] |= 1 << offset;
1676 ()
1677 }
1678
1679 pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
gnzlbg7ac0fe52019-02-13 10:38:54 +01001680 let size_in_bits
1681 = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
Alex Crichton22b98de2017-08-26 20:39:46 -07001682 let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
1683 cpuset.bits[idx] &= !(1 << offset);
1684 ()
1685 }
1686
1687 pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
gnzlbg7ac0fe52019-02-13 10:38:54 +01001688 let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]);
Alex Crichton22b98de2017-08-26 20:39:46 -07001689 let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
1690 0 != (cpuset.bits[idx] & (1 << offset))
1691 }
1692
1693 pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
1694 set1.bits == set2.bits
1695 }
1696
1697 pub fn major(dev: ::dev_t) -> ::c_uint {
Alex Crichton1ee80562017-08-27 08:33:58 -07001698 // see
1699 // https://github.com/kripken/emscripten/blob/
1700 // master/system/include/libc/sys/sysmacros.h
1701 let mut major = 0;
1702 major |= (dev & 0x00000fff) >> 8;
1703 major |= (dev & 0xfffff000) >> 31 >> 1;
1704 major as ::c_uint
Alex Crichton22b98de2017-08-26 20:39:46 -07001705 }
1706
1707 pub fn minor(dev: ::dev_t) -> ::c_uint {
Alex Crichton1ee80562017-08-27 08:33:58 -07001708 // see
1709 // https://github.com/kripken/emscripten/blob/
1710 // master/system/include/libc/sys/sysmacros.h
1711 let mut minor = 0;
1712 minor |= (dev & 0x000000ff) >> 0;
1713 minor |= (dev & 0xffffff00) >> 12;
1714 minor as ::c_uint
Alex Crichton22b98de2017-08-26 20:39:46 -07001715 }
1716
1717 pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
1718 let major = major as ::dev_t;
1719 let minor = minor as ::dev_t;
1720 let mut dev = 0;
1721 dev |= (major & 0x00000fff) << 8;
1722 dev |= (major & 0xfffff000) << 31 << 1;
1723 dev |= (minor & 0x000000ff) << 0;
1724 dev |= (minor & 0xffffff00) << 12;
1725 dev
1726 }
1727}
1728
Matthew Maurere9a2a712020-01-02 15:36:15 -08001729extern "C" {
1730 pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
1731 pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
gnzlbg8f403e52019-05-24 14:57:28 +02001732 pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
1733 pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
Matthew Maurere9a2a712020-01-02 15:36:15 -08001734 pub fn strerror_r(
1735 errnum: ::c_int,
1736 buf: *mut c_char,
1737 buflen: ::size_t,
1738 ) -> ::c_int;
gnzlbgd5273252019-05-23 11:28:15 +02001739
gnzlbg5c1a6b82018-11-21 20:34:50 +01001740 pub fn abs(i: ::c_int) -> ::c_int;
1741 pub fn atof(s: *const ::c_char) -> ::c_double;
1742 pub fn labs(i: ::c_long) -> ::c_long;
1743 pub fn rand() -> ::c_int;
1744 pub fn srand(seed: ::c_uint);
1745
Matthew Maurere9a2a712020-01-02 15:36:15 -08001746 pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
gnzlbg759c8372019-05-21 13:41:49 +02001747
Alex Crichton22b98de2017-08-26 20:39:46 -07001748 pub fn setpwent();
1749 pub fn endpwent();
1750 pub fn getpwent() -> *mut passwd;
1751
Matthew Maurere9a2a712020-01-02 15:36:15 -08001752 pub fn shm_open(
1753 name: *const c_char,
1754 oflag: ::c_int,
1755 mode: mode_t,
1756 ) -> ::c_int;
Alex Crichton22b98de2017-08-26 20:39:46 -07001757
Matthew Maurere9a2a712020-01-02 15:36:15 -08001758 pub fn mprotect(
1759 addr: *mut ::c_void,
1760 len: ::size_t,
1761 prot: ::c_int,
1762 ) -> ::c_int;
Alex Crichton22b98de2017-08-26 20:39:46 -07001763 pub fn __errno_location() -> *mut ::c_int;
1764
Matthew Maurere9a2a712020-01-02 15:36:15 -08001765 pub fn fopen64(
1766 filename: *const c_char,
1767 mode: *const c_char,
1768 ) -> *mut ::FILE;
1769 pub fn freopen64(
1770 filename: *const c_char,
1771 mode: *const c_char,
1772 file: *mut ::FILE,
1773 ) -> *mut ::FILE;
Alex Crichton22b98de2017-08-26 20:39:46 -07001774 pub fn tmpfile64() -> *mut ::FILE;
1775 pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
1776 pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
Matthew Maurere9a2a712020-01-02 15:36:15 -08001777 pub fn fseeko64(
1778 stream: *mut ::FILE,
1779 offset: ::off64_t,
1780 whence: ::c_int,
1781 ) -> ::c_int;
Alex Crichton22b98de2017-08-26 20:39:46 -07001782 pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
Matthew Maurere9a2a712020-01-02 15:36:15 -08001783 pub fn posix_fallocate(
1784 fd: ::c_int,
1785 offset: ::off_t,
1786 len: ::off_t,
1787 ) -> ::c_int;
1788 pub fn pwritev(
1789 fd: ::c_int,
1790 iov: *const ::iovec,
1791 iovcnt: ::c_int,
1792 offset: ::off_t,
1793 ) -> ::ssize_t;
1794 pub fn preadv(
1795 fd: ::c_int,
1796 iov: *const ::iovec,
1797 iovcnt: ::c_int,
1798 offset: ::off_t,
1799 ) -> ::ssize_t;
Alex Crichton22b98de2017-08-26 20:39:46 -07001800 pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
1801 pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
Matthew Maurere9a2a712020-01-02 15:36:15 -08001802 pub fn mkostemps(
1803 template: *mut ::c_char,
1804 suffixlen: ::c_int,
1805 flags: ::c_int,
1806 ) -> ::c_int;
1807 pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t)
1808 -> *mut ::c_char;
1809 pub fn getnameinfo(
1810 sa: *const ::sockaddr,
1811 salen: ::socklen_t,
1812 host: *mut ::c_char,
1813 hostlen: ::socklen_t,
1814 serv: *mut ::c_char,
1815 sevlen: ::socklen_t,
1816 flags: ::c_int,
1817 ) -> ::c_int;
Alex Crichton22b98de2017-08-26 20:39:46 -07001818 pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
1819
1820 // Not available now on Android
Matthew Maurere9a2a712020-01-02 15:36:15 -08001821 pub fn mkfifoat(
1822 dirfd: ::c_int,
1823 pathname: *const ::c_char,
1824 mode: ::mode_t,
1825 ) -> ::c_int;
Alex Crichton22b98de2017-08-26 20:39:46 -07001826 pub fn if_nameindex() -> *mut if_nameindex;
1827 pub fn if_freenameindex(ptr: *mut if_nameindex);
Alex Crichton22b98de2017-08-26 20:39:46 -07001828
Matthew Maurere9a2a712020-01-02 15:36:15 -08001829 pub fn mremap(
1830 addr: *mut ::c_void,
1831 len: ::size_t,
1832 new_len: ::size_t,
1833 flags: ::c_int,
1834 ...
1835 ) -> *mut ::c_void;
Alex Crichton22b98de2017-08-26 20:39:46 -07001836
Matthew Maurere9a2a712020-01-02 15:36:15 -08001837 pub fn glob(
1838 pattern: *const c_char,
1839 flags: ::c_int,
1840 errfunc: ::Option<
1841 extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int,
1842 >,
1843 pglob: *mut ::glob_t,
1844 ) -> ::c_int;
Alex Crichton22b98de2017-08-26 20:39:46 -07001845 pub fn globfree(pglob: *mut ::glob_t);
1846
Matthew Maurere9a2a712020-01-02 15:36:15 -08001847 pub fn posix_madvise(
1848 addr: *mut ::c_void,
1849 len: ::size_t,
1850 advice: ::c_int,
1851 ) -> ::c_int;
Alex Crichton22b98de2017-08-26 20:39:46 -07001852
1853 pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
1854
1855 pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
1856
1857 pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
Matthew Maurere9a2a712020-01-02 15:36:15 -08001858 pub fn madvise(
1859 addr: *mut ::c_void,
1860 len: ::size_t,
1861 advice: ::c_int,
1862 ) -> ::c_int;
Alex Crichton22b98de2017-08-26 20:39:46 -07001863
Matthew Maurere9a2a712020-01-02 15:36:15 -08001864 pub fn msync(
1865 addr: *mut ::c_void,
1866 len: ::size_t,
1867 flags: ::c_int,
1868 ) -> ::c_int;
Alex Crichton22b98de2017-08-26 20:39:46 -07001869
Matthew Maurere9a2a712020-01-02 15:36:15 -08001870 pub fn recvfrom(
1871 socket: ::c_int,
1872 buf: *mut ::c_void,
1873 len: ::size_t,
1874 flags: ::c_int,
1875 addr: *mut ::sockaddr,
1876 addrlen: *mut ::socklen_t,
1877 ) -> ::ssize_t;
Alex Crichton22b98de2017-08-26 20:39:46 -07001878 pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
1879 pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
1880
Alex Crichton22b98de2017-08-26 20:39:46 -07001881 pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
1882 pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
Matthew Maurere9a2a712020-01-02 15:36:15 -08001883 pub fn sendmmsg(
1884 sockfd: ::c_int,
1885 msgvec: *mut ::mmsghdr,
1886 vlen: ::c_uint,
1887 flags: ::c_uint,
1888 ) -> ::c_int;
1889 pub fn recvmmsg(
1890 sockfd: ::c_int,
1891 msgvec: *mut ::mmsghdr,
1892 vlen: ::c_uint,
1893 flags: ::c_uint,
1894 timeout: *mut ::timespec,
1895 ) -> ::c_int;
Alex Crichton22b98de2017-08-26 20:39:46 -07001896 pub fn sync();
1897 pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
1898 pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
1899 pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
Matthew Maurere9a2a712020-01-02 15:36:15 -08001900 pub fn pthread_create(
1901 native: *mut ::pthread_t,
1902 attr: *const ::pthread_attr_t,
1903 f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
1904 value: *mut ::c_void,
1905 ) -> ::c_int;
Alex Crichton22b98de2017-08-26 20:39:46 -07001906}
gnzlbga17a91c2019-02-07 11:37:21 +01001907
1908cfg_if! {
1909 if #[cfg(libc_align)] {
1910 #[macro_use]
1911 mod align;
1912 } else {
1913 #[macro_use]
1914 mod no_align;
1915 }
1916}
1917expand_align!();