]> git.proxmox.com Git - rustc.git/blob - src/liblibc/src/unix/solaris/mod.rs
5a31e5269bbb327ad532ddce0516a2bbb20e859c
[rustc.git] / src / liblibc / src / unix / solaris / mod.rs
1 pub type c_char = i8;
2 pub type c_long = i64;
3 pub type c_ulong = u64;
4 pub type clockid_t = ::c_int;
5
6 pub type blkcnt_t = i64;
7 pub type clock_t = i64;
8 pub type daddr_t = i64;
9 pub type dev_t = u64;
10 pub type fsblkcnt_t = u64;
11 pub type fsfilcnt_t = u64;
12 pub type ino_t = i64;
13 pub type key_t = i32;
14 pub type major_t = u32;
15 pub type minor_t = u32;
16 pub type mode_t = u32;
17 pub type nlink_t = u32;
18 pub type rlim_t = u64;
19 pub type speed_t = u32;
20 pub type tcflag_t = u32;
21 pub type time_t = i64;
22 pub type wchar_t = i32;
23 pub type nfds_t = ::c_ulong;
24
25 pub type suseconds_t = ::c_long;
26 pub type off_t = i64;
27 pub type useconds_t = ::c_uint;
28 pub type socklen_t = u32;
29 pub type sa_family_t = u8;
30 pub type pthread_t = ::uintptr_t;
31 pub type pthread_key_t = ::c_uint;
32 pub type blksize_t = u32;
33 pub type fflags_t = u32;
34 pub type nl_item = ::c_int;
35
36 pub enum timezone {}
37
38 s! {
39 pub struct sockaddr {
40 pub sa_family: sa_family_t,
41 pub sa_data: [::c_char; 14],
42 }
43
44 pub struct sockaddr_in {
45 pub sin_family: sa_family_t,
46 pub sin_port: ::in_port_t,
47 pub sin_addr: ::in_addr,
48 pub sin_zero: [::c_char; 8]
49 }
50
51 pub struct sockaddr_in6 {
52 pub sin6_family: sa_family_t,
53 pub sin6_port: ::in_port_t,
54 pub sin6_flowinfo: u32,
55 pub sin6_addr: ::in6_addr,
56 pub sin6_scope_id: u32,
57 pub __sin6_src_id: u32
58 }
59
60 pub struct sockaddr_un {
61 pub sun_family: sa_family_t,
62 pub sun_path: [c_char; 108]
63 }
64
65 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_age: *mut ::c_char,
71 pub pw_comment: *mut ::c_char,
72 pub pw_gecos: *mut ::c_char,
73 pub pw_dir: *mut ::c_char,
74 pub pw_shell: *mut ::c_char
75 }
76
77 pub struct ifaddrs {
78 pub ifa_next: *mut ifaddrs,
79 pub ifa_name: *mut ::c_char,
80 pub ifa_flags: ::c_ulong,
81 pub ifa_addr: *mut ::sockaddr,
82 pub ifa_netmask: *mut ::sockaddr,
83 pub ifa_dstaddr: *mut ::sockaddr,
84 pub ifa_data: *mut ::c_void
85 }
86
87 pub struct tm {
88 pub tm_sec: ::c_int,
89 pub tm_min: ::c_int,
90 pub tm_hour: ::c_int,
91 pub tm_mday: ::c_int,
92 pub tm_mon: ::c_int,
93 pub tm_year: ::c_int,
94 pub tm_wday: ::c_int,
95 pub tm_yday: ::c_int,
96 pub tm_isdst: ::c_int
97 }
98
99 pub struct utsname {
100 pub sysname: [::c_char; 257],
101 pub nodename: [::c_char; 257],
102 pub release: [::c_char; 257],
103 pub version: [::c_char; 257],
104 pub machine: [::c_char; 257],
105 }
106
107 pub struct msghdr {
108 pub msg_name: *mut ::c_void,
109 pub msg_namelen: ::socklen_t,
110 pub msg_iov: *mut ::iovec,
111 pub msg_iovlen: ::c_int,
112 pub msg_control: *mut ::c_void,
113 pub msg_controllen: ::socklen_t,
114 pub msg_flags: ::c_int,
115 }
116
117 pub struct fd_set {
118 fds_bits: [i32; FD_SETSIZE / 32],
119 }
120
121 pub struct pthread_attr_t {
122 __pthread_attrp: *mut ::c_void
123 }
124
125 pub struct pthread_mutex_t {
126 __pthread_mutex_flag1: u16,
127 __pthread_mutex_flag2: u8,
128 __pthread_mutex_ceiling: u8,
129 __pthread_mutex_type: u16,
130 __pthread_mutex_magic: u16,
131 __pthread_mutex_lock: u64,
132 __pthread_mutex_data: u64
133 }
134
135 pub struct pthread_mutexattr_t {
136 __pthread_mutexattrp: *mut ::c_void
137 }
138
139 pub struct pthread_cond_t {
140 __pthread_cond_flag: [u8; 4],
141 __pthread_cond_type: u16,
142 __pthread_cond_magic: u16,
143 __pthread_cond_data: u64
144 }
145
146 pub struct pthread_condattr_t {
147 __pthread_condattrp: *mut ::c_void,
148 }
149
150 pub struct pthread_rwlock_t {
151 __pthread_rwlock_readers: i32,
152 __pthread_rwlock_type: u16,
153 __pthread_rwlock_magic: u16,
154 __pthread_rwlock_mutex: ::pthread_mutex_t,
155 __pthread_rwlock_readercv: ::pthread_cond_t,
156 __pthread_rwlock_writercv: ::pthread_cond_t
157 }
158
159 pub struct dirent {
160 pub d_ino: ::ino_t,
161 pub d_off: ::off_t,
162 pub d_reclen: u16,
163 pub d_name: [::c_char; 1]
164 }
165
166 pub struct glob_t {
167 pub gl_pathc: ::size_t,
168 pub gl_pathv: *mut *mut ::c_char,
169 pub gl_offs: ::size_t,
170 __unused1: *mut ::c_void,
171 __unused2: ::c_int,
172 __unused3: ::c_int,
173 __unused4: ::c_int,
174 __unused5: *mut ::c_void,
175 __unused6: *mut ::c_void,
176 __unused7: *mut ::c_void,
177 __unused8: *mut ::c_void,
178 __unused9: *mut ::c_void,
179 __unused10: *mut ::c_void,
180 }
181
182 pub struct sockaddr_storage {
183 pub ss_family: ::sa_family_t,
184 __ss_pad1: [u8; 6],
185 __ss_align: i64,
186 __ss_pad2: [u8; 240],
187 }
188
189 pub struct addrinfo {
190 pub ai_flags: ::c_int,
191 pub ai_family: ::c_int,
192 pub ai_socktype: ::c_int,
193 pub ai_protocol: ::c_int,
194 pub ai_addrlen: ::socklen_t,
195 pub ai_canonname: *mut ::c_char,
196 pub ai_addr: *mut ::sockaddr,
197 pub ai_next: *mut addrinfo,
198 }
199
200 pub struct sigset_t {
201 bits: [u32; 4],
202 }
203
204 pub struct siginfo_t {
205 pub si_signo: ::c_int,
206 pub si_code: ::c_int,
207 pub si_errno: ::c_int,
208 pub si_pad: ::c_int,
209 pub si_addr: *mut ::c_void,
210 __pad: [u8; 232],
211 }
212
213 pub struct sigaction {
214 pub sa_flags: ::c_int,
215 pub sa_sigaction: ::sighandler_t,
216 pub sa_mask: sigset_t,
217 }
218
219 pub struct stack_t {
220 pub ss_sp: *mut ::c_void,
221 pub ss_size: ::size_t,
222 pub ss_flags: ::c_int,
223 }
224
225 pub struct statvfs {
226 pub f_bsize: ::c_ulong,
227 pub f_frsize: ::c_ulong,
228 pub f_blocks: ::fsblkcnt_t,
229 pub f_bfree: ::fsblkcnt_t,
230 pub f_bavail: ::fsblkcnt_t,
231 pub f_files: ::fsfilcnt_t,
232 pub f_ffree: ::fsfilcnt_t,
233 pub f_favail: ::fsfilcnt_t,
234 pub f_fsid: ::c_ulong,
235 pub f_basetype: [::c_char; 16],
236 pub f_flag: ::c_ulong,
237 pub f_namemax: ::c_ulong,
238 pub f_fstr: [::c_char; 32]
239 }
240
241 pub struct sched_param {
242 pub sched_priority: ::c_int,
243 sched_pad: [::c_int; 8]
244 }
245
246 pub struct Dl_info {
247 pub dli_fname: *const ::c_char,
248 pub dli_fbase: *mut ::c_void,
249 pub dli_sname: *const ::c_char,
250 pub dli_saddr: *mut ::c_void,
251 }
252
253 pub struct stat {
254 pub st_dev: ::dev_t,
255 pub st_ino: ::ino_t,
256 pub st_mode: ::mode_t,
257 pub st_nlink: ::nlink_t,
258 pub st_uid: ::uid_t,
259 pub st_gid: ::gid_t,
260 pub st_rdev: ::dev_t,
261 pub st_size: ::off_t,
262 pub st_atime: ::time_t,
263 pub st_atime_nsec: ::c_long,
264 pub st_mtime: ::time_t,
265 pub st_mtime_nsec: ::c_long,
266 pub st_ctime: ::time_t,
267 pub st_ctime_nsec: ::c_long,
268 pub st_blksize: ::blksize_t,
269 pub st_blocks: ::blkcnt_t,
270 __unused: [::c_char; 16]
271 }
272
273 pub struct termios {
274 pub c_iflag: ::tcflag_t,
275 pub c_oflag: ::tcflag_t,
276 pub c_cflag: ::tcflag_t,
277 pub c_lflag: ::tcflag_t,
278 pub c_cc: [::cc_t; ::NCCS]
279 }
280
281 pub struct lconv {
282 pub decimal_point: *mut ::c_char,
283 pub thousands_sep: *mut ::c_char,
284 pub grouping: *mut ::c_char,
285 pub int_curr_symbol: *mut ::c_char,
286 pub currency_symbol: *mut ::c_char,
287 pub mon_decimal_point: *mut ::c_char,
288 pub mon_thousands_sep: *mut ::c_char,
289 pub mon_grouping: *mut ::c_char,
290 pub positive_sign: *mut ::c_char,
291 pub negative_sign: *mut ::c_char,
292 pub int_frac_digits: ::c_char,
293 pub frac_digits: ::c_char,
294 pub p_cs_precedes: ::c_char,
295 pub p_sep_by_space: ::c_char,
296 pub n_cs_precedes: ::c_char,
297 pub n_sep_by_space: ::c_char,
298 pub p_sign_posn: ::c_char,
299 pub n_sign_posn: ::c_char,
300 pub int_p_cs_precedes: ::c_char,
301 pub int_p_sep_by_space: ::c_char,
302 pub int_n_cs_precedes: ::c_char,
303 pub int_n_sep_by_space: ::c_char,
304 pub int_p_sign_posn: ::c_char,
305 pub int_n_sign_posn: ::c_char,
306 }
307
308 pub struct sem_t {
309 pub sem_count: u32,
310 pub sem_type: u16,
311 pub sem_magic: u16,
312 pub sem_pad1: [u64; 3],
313 pub sem_pad2: [u64; 2]
314 }
315
316 pub struct flock {
317 pub l_type: ::c_short,
318 pub l_whence: ::c_short,
319 pub l_start: ::off_t,
320 pub l_len: ::off_t,
321 pub l_sysid: ::c_int,
322 pub l_pid: ::pid_t,
323 pub l_pad: [::c_long; 4]
324 }
325
326 pub struct if_nameindex {
327 pub if_index: ::c_uint,
328 pub if_name: *mut ::c_char,
329 }
330 }
331
332 pub const LC_CTYPE: ::c_int = 0;
333 pub const LC_NUMERIC: ::c_int = 1;
334 pub const LC_TIME: ::c_int = 2;
335 pub const LC_COLLATE: ::c_int = 3;
336 pub const LC_MONETARY: ::c_int = 4;
337 pub const LC_MESSAGES: ::c_int = 5;
338 pub const LC_ALL: ::c_int = 6;
339 pub const LC_CTYPE_MASK: ::c_int = (1 << LC_CTYPE);
340 pub const LC_NUMERIC_MASK: ::c_int = (1 << LC_NUMERIC);
341 pub const LC_TIME_MASK: ::c_int = (1 << LC_TIME);
342 pub const LC_COLLATE_MASK: ::c_int = (1 << LC_COLLATE);
343 pub const LC_MONETARY_MASK: ::c_int = (1 << LC_MONETARY);
344 pub const LC_MESSAGES_MASK: ::c_int = (1 << LC_MESSAGES);
345 pub const LC_ALL_MASK: ::c_int = LC_CTYPE_MASK
346 | LC_NUMERIC_MASK
347 | LC_TIME_MASK
348 | LC_COLLATE_MASK
349 | LC_MONETARY_MASK
350 | LC_MESSAGES_MASK;
351
352 pub const DAY_1: ::nl_item = 1;
353 pub const DAY_2: ::nl_item = 2;
354 pub const DAY_3: ::nl_item = 3;
355 pub const DAY_4: ::nl_item = 4;
356 pub const DAY_5: ::nl_item = 5;
357 pub const DAY_6: ::nl_item = 6;
358 pub const DAY_7: ::nl_item = 7;
359
360 pub const ABDAY_1: ::nl_item = 8;
361 pub const ABDAY_2: ::nl_item = 9;
362 pub const ABDAY_3: ::nl_item = 10;
363 pub const ABDAY_4: ::nl_item = 11;
364 pub const ABDAY_5: ::nl_item = 12;
365 pub const ABDAY_6: ::nl_item = 13;
366 pub const ABDAY_7: ::nl_item = 14;
367
368 pub const MON_1: ::nl_item = 15;
369 pub const MON_2: ::nl_item = 16;
370 pub const MON_3: ::nl_item = 17;
371 pub const MON_4: ::nl_item = 18;
372 pub const MON_5: ::nl_item = 19;
373 pub const MON_6: ::nl_item = 20;
374 pub const MON_7: ::nl_item = 21;
375 pub const MON_8: ::nl_item = 22;
376 pub const MON_9: ::nl_item = 23;
377 pub const MON_10: ::nl_item = 24;
378 pub const MON_11: ::nl_item = 25;
379 pub const MON_12: ::nl_item = 26;
380
381 pub const ABMON_1: ::nl_item = 27;
382 pub const ABMON_2: ::nl_item = 28;
383 pub const ABMON_3: ::nl_item = 29;
384 pub const ABMON_4: ::nl_item = 30;
385 pub const ABMON_5: ::nl_item = 31;
386 pub const ABMON_6: ::nl_item = 32;
387 pub const ABMON_7: ::nl_item = 33;
388 pub const ABMON_8: ::nl_item = 34;
389 pub const ABMON_9: ::nl_item = 35;
390 pub const ABMON_10: ::nl_item = 36;
391 pub const ABMON_11: ::nl_item = 37;
392 pub const ABMON_12: ::nl_item = 38;
393
394 pub const RADIXCHAR: ::nl_item = 39;
395 pub const THOUSEP: ::nl_item = 40;
396 pub const YESSTR: ::nl_item = 41;
397 pub const NOSTR: ::nl_item = 42;
398 pub const CRNCYSTR: ::nl_item = 43;
399
400 pub const D_T_FMT: ::nl_item = 44;
401 pub const D_FMT: ::nl_item = 45;
402 pub const T_FMT: ::nl_item = 46;
403 pub const AM_STR: ::nl_item = 47;
404 pub const PM_STR: ::nl_item = 48;
405
406 pub const CODESET: ::nl_item = 49;
407 pub const T_FMT_AMPM: ::nl_item = 50;
408 pub const ERA: ::nl_item = 51;
409 pub const ERA_D_FMT: ::nl_item = 52;
410 pub const ERA_D_T_FMT: ::nl_item = 53;
411 pub const ERA_T_FMT: ::nl_item = 54;
412 pub const ALT_DIGITS: ::nl_item = 55;
413 pub const YESEXPR: ::nl_item = 56;
414 pub const NOEXPR: ::nl_item = 57;
415 pub const _DATE_FMT: ::nl_item = 58;
416 pub const MAXSTRMSG: ::nl_item = 58;
417
418 pub const PATH_MAX: ::c_int = 1024;
419
420 pub const SA_ONSTACK: ::c_int = 0x00000001;
421 pub const SA_RESETHAND: ::c_int = 0x00000002;
422 pub const SA_RESTART: ::c_int = 0x00000004;
423 pub const SA_SIGINFO: ::c_int = 0x00000008;
424 pub const SA_NODEFER: ::c_int = 0x00000010;
425 pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
426 pub const SA_NOCLDSTOP: ::c_int = 0x00020000;
427
428 pub const SS_ONSTACK: ::c_int = 1;
429 pub const SS_DISABLE: ::c_int = 2;
430
431 pub const FIONBIO: ::c_int = 0x8004667e;
432
433 pub const SIGCHLD: ::c_int = 18;
434 pub const SIGBUS: ::c_int = 10;
435 pub const SIG_BLOCK: ::c_int = 1;
436 pub const SIG_UNBLOCK: ::c_int = 2;
437 pub const SIG_SETMASK: ::c_int = 3;
438
439 pub const IPV6_MULTICAST_LOOP: ::c_int = 0x8;
440 pub const IPV6_V6ONLY: ::c_int = 0x27;
441
442 pub const FD_SETSIZE: usize = 1024;
443
444 pub const ST_RDONLY: ::c_ulong = 1;
445 pub const ST_NOSUID: ::c_ulong = 2;
446
447 pub const NI_MAXHOST: ::socklen_t = 1025;
448
449 pub const EXIT_FAILURE: ::c_int = 1;
450 pub const EXIT_SUCCESS: ::c_int = 0;
451 pub const RAND_MAX: ::c_int = 32767;
452 pub const EOF: ::c_int = -1;
453 pub const SEEK_SET: ::c_int = 0;
454 pub const SEEK_CUR: ::c_int = 1;
455 pub const SEEK_END: ::c_int = 2;
456 pub const _IOFBF: ::c_int = 0;
457 pub const _IONBF: ::c_int = 4;
458 pub const _IOLBF: ::c_int = 64;
459 pub const BUFSIZ: ::c_uint = 1024;
460 pub const FOPEN_MAX: ::c_uint = 20;
461 pub const FILENAME_MAX: ::c_uint = 1024;
462 pub const L_tmpnam: ::c_uint = 25;
463 pub const TMP_MAX: ::c_uint = 17576;
464
465 pub const O_RDONLY: ::c_int = 0;
466 pub const O_WRONLY: ::c_int = 1;
467 pub const O_RDWR: ::c_int = 2;
468 pub const O_APPEND: ::c_int = 8;
469 pub const O_CREAT: ::c_int = 256;
470 pub const O_EXCL: ::c_int = 1024;
471 pub const O_NOCTTY: ::c_int = 2048;
472 pub const O_TRUNC: ::c_int = 512;
473 pub const O_CLOEXEC: ::c_int = 0x800000;
474 pub const O_ACCMODE: ::c_int = 0x600003;
475 pub const S_IFIFO: mode_t = 4096;
476 pub const S_IFCHR: mode_t = 8192;
477 pub const S_IFBLK: mode_t = 24576;
478 pub const S_IFDIR: mode_t = 16384;
479 pub const S_IFREG: mode_t = 32768;
480 pub const S_IFLNK: mode_t = 40960;
481 pub const S_IFSOCK: mode_t = 49152;
482 pub const S_IFMT: mode_t = 61440;
483 pub const S_IEXEC: mode_t = 64;
484 pub const S_IWRITE: mode_t = 128;
485 pub const S_IREAD: mode_t = 256;
486 pub const S_IRWXU: mode_t = 448;
487 pub const S_IXUSR: mode_t = 64;
488 pub const S_IWUSR: mode_t = 128;
489 pub const S_IRUSR: mode_t = 256;
490 pub const S_IRWXG: mode_t = 56;
491 pub const S_IXGRP: mode_t = 8;
492 pub const S_IWGRP: mode_t = 16;
493 pub const S_IRGRP: mode_t = 32;
494 pub const S_IRWXO: mode_t = 7;
495 pub const S_IXOTH: mode_t = 1;
496 pub const S_IWOTH: mode_t = 2;
497 pub const S_IROTH: mode_t = 4;
498 pub const F_OK: ::c_int = 0;
499 pub const R_OK: ::c_int = 4;
500 pub const W_OK: ::c_int = 2;
501 pub const X_OK: ::c_int = 1;
502 pub const STDIN_FILENO: ::c_int = 0;
503 pub const STDOUT_FILENO: ::c_int = 1;
504 pub const STDERR_FILENO: ::c_int = 2;
505 pub const F_LOCK: ::c_int = 1;
506 pub const F_TEST: ::c_int = 3;
507 pub const F_TLOCK: ::c_int = 2;
508 pub const F_ULOCK: ::c_int = 0;
509 pub const F_DUPFD_CLOEXEC: ::c_int = 37;
510 pub const F_SETLK: ::c_int = 6;
511 pub const F_SETLKW: ::c_int = 7;
512 pub const F_GETLK: ::c_int = 14;
513 pub const SIGHUP: ::c_int = 1;
514 pub const SIGINT: ::c_int = 2;
515 pub const SIGQUIT: ::c_int = 3;
516 pub const SIGILL: ::c_int = 4;
517 pub const SIGABRT: ::c_int = 6;
518 pub const SIGEMT: ::c_int = 7;
519 pub const SIGFPE: ::c_int = 8;
520 pub const SIGKILL: ::c_int = 9;
521 pub const SIGSEGV: ::c_int = 11;
522 pub const SIGSYS: ::c_int = 12;
523 pub const SIGPIPE: ::c_int = 13;
524 pub const SIGALRM: ::c_int = 14;
525 pub const SIGTERM: ::c_int = 15;
526 pub const SIGUSR1: ::c_int = 16;
527 pub const SIGUSR2: ::c_int = 17;
528 pub const SIGPWR: ::c_int = 19;
529 pub const SIGWINCH: ::c_int = 20;
530 pub const SIGURG: ::c_int = 21;
531 pub const SIGPOLL: ::c_int = 22;
532 pub const SIGIO: ::c_int = SIGPOLL;
533 pub const SIGSTOP: ::c_int = 23;
534 pub const SIGTSTP: ::c_int = 24;
535 pub const SIGCONT: ::c_int = 25;
536 pub const SIGTTIN: ::c_int = 26;
537 pub const SIGTTOU: ::c_int = 27;
538 pub const SIGVTALRM: ::c_int = 28;
539 pub const SIGPROF: ::c_int = 29;
540 pub const SIGXCPU: ::c_int = 30;
541 pub const SIGXFSZ: ::c_int = 31;
542
543 pub const WNOHANG: ::c_int = 0x40;
544
545 pub const PROT_NONE: ::c_int = 0;
546 pub const PROT_READ: ::c_int = 1;
547 pub const PROT_WRITE: ::c_int = 2;
548 pub const PROT_EXEC: ::c_int = 4;
549
550 pub const MAP_SHARED: ::c_int = 0x0001;
551 pub const MAP_PRIVATE: ::c_int = 0x0002;
552 pub const MAP_FIXED: ::c_int = 0x0010;
553 pub const MAP_NORESERVE: ::c_int = 0x40;
554 pub const MAP_ANON: ::c_int = 0x0100;
555 pub const MAP_RENAME: ::c_int = 0x20;
556 pub const MAP_ALIGN: ::c_int = 0x200;
557 pub const MAP_TEXT: ::c_int = 0x400;
558 pub const MAP_INITDATA: ::c_int = 0x800;
559 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
560
561 pub const MCL_CURRENT: ::c_int = 0x0001;
562 pub const MCL_FUTURE: ::c_int = 0x0002;
563
564 pub const MS_SYNC: ::c_int = 0x0004;
565 pub const MS_ASYNC: ::c_int = 0x0001;
566 pub const MS_INVALIDATE: ::c_int = 0x0002;
567 pub const MS_INVALCURPROC: ::c_int = 0x0008;
568
569 pub const EPERM: ::c_int = 1;
570 pub const ENOENT: ::c_int = 2;
571 pub const ESRCH: ::c_int = 3;
572 pub const EINTR: ::c_int = 4;
573 pub const EIO: ::c_int = 5;
574 pub const ENXIO: ::c_int = 6;
575 pub const E2BIG: ::c_int = 7;
576 pub const ENOEXEC: ::c_int = 8;
577 pub const EBADF: ::c_int = 9;
578 pub const ECHILD: ::c_int = 10;
579 pub const EDEADLK: ::c_int = 45;
580 pub const ENOMEM: ::c_int = 12;
581 pub const EACCES: ::c_int = 13;
582 pub const EFAULT: ::c_int = 14;
583 pub const ENOTBLK: ::c_int = 15;
584 pub const EBUSY: ::c_int = 16;
585 pub const EEXIST: ::c_int = 17;
586 pub const EXDEV: ::c_int = 18;
587 pub const ENODEV: ::c_int = 19;
588 pub const ENOTDIR: ::c_int = 20;
589 pub const EISDIR: ::c_int = 21;
590 pub const EINVAL: ::c_int = 22;
591 pub const ENFILE: ::c_int = 23;
592 pub const EMFILE: ::c_int = 24;
593 pub const ENOTTY: ::c_int = 25;
594 pub const ETXTBSY: ::c_int = 26;
595 pub const EFBIG: ::c_int = 27;
596 pub const ENOSPC: ::c_int = 28;
597 pub const ESPIPE: ::c_int = 29;
598 pub const EROFS: ::c_int = 30;
599 pub const EMLINK: ::c_int = 31;
600 pub const EPIPE: ::c_int = 32;
601 pub const EDOM: ::c_int = 33;
602 pub const ERANGE: ::c_int = 34;
603 pub const EAGAIN: ::c_int = 11;
604 pub const EWOULDBLOCK: ::c_int = 11;
605 pub const EINPROGRESS: ::c_int = 150;
606 pub const EALREADY: ::c_int = 149;
607 pub const ENOTSOCK: ::c_int = 95;
608 pub const EDESTADDRREQ: ::c_int = 96;
609 pub const EMSGSIZE: ::c_int = 97;
610 pub const EPROTOTYPE: ::c_int = 98;
611 pub const ENOPROTOOPT: ::c_int = 99;
612 pub const EPROTONOSUPPORT: ::c_int = 120;
613 pub const ESOCKTNOSUPPORT: ::c_int = 121;
614 pub const EOPNOTSUPP: ::c_int = 122;
615 pub const EPFNOSUPPORT: ::c_int = 123;
616 pub const EAFNOSUPPORT: ::c_int = 124;
617 pub const EADDRINUSE: ::c_int = 125;
618 pub const EADDRNOTAVAIL: ::c_int = 126;
619 pub const ENETDOWN: ::c_int = 127;
620 pub const ENETUNREACH: ::c_int = 128;
621 pub const ENETRESET: ::c_int = 129;
622 pub const ECONNABORTED: ::c_int = 130;
623 pub const ECONNRESET: ::c_int = 131;
624 pub const ENOBUFS: ::c_int = 132;
625 pub const EISCONN: ::c_int = 133;
626 pub const ENOTCONN: ::c_int = 134;
627 pub const ESHUTDOWN: ::c_int = 143;
628 pub const ETOOMANYREFS: ::c_int = 144;
629 pub const ETIMEDOUT: ::c_int = 145;
630 pub const ECONNREFUSED: ::c_int = 146;
631 pub const ELOOP: ::c_int = 90;
632 pub const ENAMETOOLONG: ::c_int = 78;
633 pub const EHOSTDOWN: ::c_int = 147;
634 pub const EHOSTUNREACH: ::c_int = 148;
635 pub const ENOTEMPTY: ::c_int = 93;
636 pub const EUSERS: ::c_int = 94;
637 pub const EDQUOT: ::c_int = 49;
638 pub const ESTALE: ::c_int = 151;
639 pub const EREMOTE: ::c_int = 66;
640 pub const ENOLCK: ::c_int = 46;
641 pub const ENOSYS: ::c_int = 89;
642 pub const EIDRM: ::c_int = 36;
643 pub const ENOMSG: ::c_int = 35;
644 pub const EOVERFLOW: ::c_int = 79;
645 pub const ECANCELED: ::c_int = 47;
646 pub const EILSEQ: ::c_int = 88;
647 pub const EBADMSG: ::c_int = 77;
648 pub const EMULTIHOP: ::c_int = 74;
649 pub const ENOLINK: ::c_int = 67;
650 pub const EPROTO: ::c_int = 71;
651
652 pub const F_DUPFD: ::c_int = 0;
653 pub const F_GETFD: ::c_int = 1;
654 pub const F_SETFD: ::c_int = 2;
655 pub const F_GETFL: ::c_int = 3;
656 pub const F_SETFL: ::c_int = 4;
657
658 pub const SIGTRAP: ::c_int = 5;
659
660 pub const GLOB_APPEND : ::c_int = 32;
661 pub const GLOB_DOOFFS : ::c_int = 16;
662 pub const GLOB_ERR : ::c_int = 1;
663 pub const GLOB_MARK : ::c_int = 2;
664 pub const GLOB_NOCHECK : ::c_int = 8;
665 pub const GLOB_NOSORT : ::c_int = 4;
666 pub const GLOB_NOESCAPE: ::c_int = 64;
667
668 pub const GLOB_NOSPACE : ::c_int = -2;
669 pub const GLOB_ABORTED : ::c_int = -1;
670 pub const GLOB_NOMATCH : ::c_int = -3;
671
672 pub const POSIX_MADV_NORMAL: ::c_int = 0;
673 pub const POSIX_MADV_RANDOM: ::c_int = 1;
674 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
675 pub const POSIX_MADV_WILLNEED: ::c_int = 3;
676 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
677
678 pub const _SC_IOV_MAX: ::c_int = 77;
679 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 569;
680 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 570;
681 pub const _SC_LOGIN_NAME_MAX: ::c_int = 571;
682 pub const _SC_MQ_PRIO_MAX: ::c_int = 30;
683 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 577;
684 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 578;
685 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 568;
686 pub const _SC_THREAD_KEYS_MAX: ::c_int = 572;
687 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 580;
688 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 581;
689 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 579;
690 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 582;
691 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 583;
692 pub const _SC_THREAD_STACK_MIN: ::c_int = 573;
693 pub const _SC_THREAD_THREADS_MAX: ::c_int = 574;
694 pub const _SC_THREADS: ::c_int = 576;
695 pub const _SC_TTY_NAME_MAX: ::c_int = 575;
696 pub const _SC_ATEXIT_MAX: ::c_int = 76;
697 pub const _SC_XOPEN_CRYPT: ::c_int = 62;
698 pub const _SC_XOPEN_ENH_I18N: ::c_int = 63;
699 pub const _SC_XOPEN_LEGACY: ::c_int = 717;
700 pub const _SC_XOPEN_REALTIME: ::c_int = 718;
701 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 719;
702 pub const _SC_XOPEN_SHM: ::c_int = 64;
703 pub const _SC_XOPEN_UNIX: ::c_int = 78;
704 pub const _SC_XOPEN_VERSION: ::c_int = 12;
705 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 67;
706
707 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
708 pub const PTHREAD_CREATE_DETACHED: ::c_int = 0x40;
709 pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
710 pub const PTHREAD_PROCESS_PRIVATE: u16 = 0;
711 pub const PTHREAD_STACK_MIN: ::size_t = 4096;
712
713 pub const SIGSTKSZ: ::size_t = 8192;
714
715 // https://illumos.org/man/3c/clock_gettime
716 // https://github.com/illumos/illumos-gate/
717 // blob/HEAD/usr/src/lib/libc/amd64/sys/__clock_gettime.s
718 // clock_gettime(3c) doesn't seem to accept anything other than CLOCK_REALTIME
719 // or __CLOCK_REALTIME0
720 //
721 // https://github.com/illumos/illumos-gate/
722 // blob/HEAD/usr/src/uts/common/sys/time_impl.h
723 // Confusing! CLOCK_HIGHRES==CLOCK_MONOTONIC==4
724 // __CLOCK_REALTIME0==0 is an obsoleted version of CLOCK_REALTIME==3
725 pub const CLOCK_REALTIME: clockid_t = 3;
726 pub const CLOCK_MONOTONIC: clockid_t = 4;
727
728 pub const RLIMIT_CPU: ::c_int = 0;
729 pub const RLIMIT_FSIZE: ::c_int = 1;
730 pub const RLIMIT_DATA: ::c_int = 2;
731 pub const RLIMIT_STACK: ::c_int = 3;
732 pub const RLIMIT_CORE: ::c_int = 4;
733 pub const RLIMIT_NOFILE: ::c_int = 5;
734 pub const RLIMIT_VMEM: ::c_int = 6;
735 pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM;
736
737 pub const RLIM_NLIMITS: rlim_t = 7;
738 pub const RLIM_INFINITY: rlim_t = 0x7fffffff;
739
740 pub const RUSAGE_SELF: ::c_int = 0;
741 pub const RUSAGE_CHILDREN: ::c_int = -1;
742
743 pub const MADV_NORMAL: ::c_int = 0;
744 pub const MADV_RANDOM: ::c_int = 1;
745 pub const MADV_SEQUENTIAL: ::c_int = 2;
746 pub const MADV_WILLNEED: ::c_int = 3;
747 pub const MADV_DONTNEED: ::c_int = 4;
748 pub const MADV_FREE: ::c_int = 5;
749
750 pub const AF_INET: ::c_int = 2;
751 pub const AF_INET6: ::c_int = 26;
752 pub const AF_UNIX: ::c_int = 1;
753 pub const SOCK_DGRAM: ::c_int = 1;
754 pub const SOCK_STREAM: ::c_int = 2;
755 pub const SOCK_RAW: ::c_int = 4;
756 pub const SOCK_RDM: ::c_int = 5;
757 pub const SOCK_SEQPACKET: ::c_int = 6;
758 pub const IPPROTO_TCP: ::c_int = 6;
759 pub const IPPROTO_IP: ::c_int = 0;
760 pub const IPPROTO_IPV6: ::c_int = 41;
761 pub const IP_MULTICAST_TTL: ::c_int = 17;
762 pub const IP_MULTICAST_LOOP: ::c_int = 18;
763 pub const IP_TTL: ::c_int = 4;
764 pub const IP_HDRINCL: ::c_int = 2;
765 pub const IP_ADD_MEMBERSHIP: ::c_int = 19;
766 pub const IP_DROP_MEMBERSHIP: ::c_int = 20;
767 pub const IPV6_JOIN_GROUP: ::c_int = 9;
768 pub const IPV6_LEAVE_GROUP: ::c_int = 10;
769
770 pub const TCP_NODELAY: ::c_int = 1;
771 pub const TCP_KEEPIDLE: ::c_int = 34;
772 pub const SOL_SOCKET: ::c_int = 0xffff;
773 pub const SO_DEBUG: ::c_int = 0x01;
774 pub const SO_ACCEPTCONN: ::c_int = 0x0002;
775 pub const SO_REUSEADDR: ::c_int = 0x0004;
776 pub const SO_KEEPALIVE: ::c_int = 0x0008;
777 pub const SO_DONTROUTE: ::c_int = 0x0010;
778 pub const SO_BROADCAST: ::c_int = 0x0020;
779 pub const SO_USELOOPBACK: ::c_int = 0x0040;
780 pub const SO_LINGER: ::c_int = 0x0080;
781 pub const SO_OOBINLINE: ::c_int = 0x0100;
782 pub const SO_SNDBUF: ::c_int = 0x1001;
783 pub const SO_RCVBUF: ::c_int = 0x1002;
784 pub const SO_SNDLOWAT: ::c_int = 0x1003;
785 pub const SO_RCVLOWAT: ::c_int = 0x1004;
786 pub const SO_SNDTIMEO: ::c_int = 0x1005;
787 pub const SO_RCVTIMEO: ::c_int = 0x1006;
788 pub const SO_ERROR: ::c_int = 0x1007;
789 pub const SO_TYPE: ::c_int = 0x1008;
790
791 pub const IFF_LOOPBACK: ::c_int = 0x8;
792
793 pub const SHUT_RD: ::c_int = 0;
794 pub const SHUT_WR: ::c_int = 1;
795 pub const SHUT_RDWR: ::c_int = 2;
796
797 pub const LOCK_SH: ::c_int = 1;
798 pub const LOCK_EX: ::c_int = 2;
799 pub const LOCK_NB: ::c_int = 4;
800 pub const LOCK_UN: ::c_int = 8;
801
802 pub const O_SYNC: ::c_int = 16;
803 pub const O_NONBLOCK: ::c_int = 128;
804
805 pub const IPPROTO_RAW: ::c_int = 255;
806
807 pub const _SC_ARG_MAX: ::c_int = 1;
808 pub const _SC_CHILD_MAX: ::c_int = 2;
809 pub const _SC_CLK_TCK: ::c_int = 3;
810 pub const _SC_NGROUPS_MAX: ::c_int = 4;
811 pub const _SC_OPEN_MAX: ::c_int = 5;
812 pub const _SC_JOB_CONTROL: ::c_int = 6;
813 pub const _SC_SAVED_IDS: ::c_int = 7;
814 pub const _SC_VERSION: ::c_int = 8;
815 pub const _SC_PAGESIZE: ::c_int = 11;
816 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
817 pub const _SC_NPROCESSORS_ONLN: ::c_int = 15;
818 pub const _SC_STREAM_MAX: ::c_int = 16;
819 pub const _SC_TZNAME_MAX: ::c_int = 17;
820 pub const _SC_AIO_LISTIO_MAX: ::c_int = 18;
821 pub const _SC_AIO_MAX: ::c_int = 19;
822 pub const _SC_BC_BASE_MAX: ::c_int = 54;
823 pub const _SC_BC_DIM_MAX: ::c_int = 55;
824 pub const _SC_BC_SCALE_MAX: ::c_int = 56;
825 pub const _SC_BC_STRING_MAX: ::c_int = 57;
826 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 58;
827 pub const _SC_EXPR_NEST_MAX: ::c_int = 59;
828 pub const _SC_LINE_MAX: ::c_int = 60;
829 pub const _SC_RE_DUP_MAX: ::c_int = 61;
830 pub const _SC_2_VERSION: ::c_int = 53;
831 pub const _SC_2_C_BIND: ::c_int = 45;
832 pub const _SC_2_C_DEV: ::c_int = 46;
833 pub const _SC_2_CHAR_TERM: ::c_int = 66;
834 pub const _SC_2_FORT_DEV: ::c_int = 48;
835 pub const _SC_2_FORT_RUN: ::c_int = 49;
836 pub const _SC_2_LOCALEDEF: ::c_int = 50;
837 pub const _SC_2_SW_DEV: ::c_int = 51;
838 pub const _SC_2_UPE: ::c_int = 52;
839 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 21;
840 pub const _SC_MAPPED_FILES: ::c_int = 24;
841 pub const _SC_MEMLOCK: ::c_int = 25;
842 pub const _SC_MEMLOCK_RANGE: ::c_int = 26;
843 pub const _SC_MEMORY_PROTECTION: ::c_int = 27;
844 pub const _SC_MESSAGE_PASSING: ::c_int = 28;
845 pub const _SC_PRIORITIZED_IO: ::c_int = 31;
846 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 32;
847 pub const _SC_REALTIME_SIGNALS: ::c_int = 33;
848 pub const _SC_SEMAPHORES: ::c_int = 35;
849 pub const _SC_FSYNC: ::c_int = 23;
850 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 38;
851 pub const _SC_SYNCHRONIZED_IO: ::c_int = 42;
852 pub const _SC_TIMERS: ::c_int = 43;
853 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 20;
854 pub const _SC_DELAYTIMER_MAX: ::c_int = 22;
855 pub const _SC_MQ_OPEN_MAX: ::c_int = 29;
856 pub const _SC_RTSIG_MAX: ::c_int = 34;
857 pub const _SC_SEM_NSEMS_MAX: ::c_int = 36;
858 pub const _SC_SEM_VALUE_MAX: ::c_int = 37;
859 pub const _SC_SIGQUEUE_MAX: ::c_int = 39;
860 pub const _SC_TIMER_MAX: ::c_int = 44;
861
862 pub const _MUTEX_MAGIC: u16 = 0x4d58; // MX
863 pub const _COND_MAGIC: u16 = 0x4356; // CV
864 pub const _RWL_MAGIC: u16 = 0x5257; // RW
865
866 pub const NCCS: usize = 19;
867
868 pub const LOG_CRON: ::c_int = 15 << 3;
869
870 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
871 __pthread_mutex_flag1: 0,
872 __pthread_mutex_flag2: 0,
873 __pthread_mutex_ceiling: 0,
874 __pthread_mutex_type: PTHREAD_PROCESS_PRIVATE,
875 __pthread_mutex_magic: _MUTEX_MAGIC,
876 __pthread_mutex_lock: 0,
877 __pthread_mutex_data: 0
878 };
879 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
880 __pthread_cond_flag: [0; 4],
881 __pthread_cond_type: PTHREAD_PROCESS_PRIVATE,
882 __pthread_cond_magic: _COND_MAGIC,
883 __pthread_cond_data: 0
884 };
885 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
886 __pthread_rwlock_readers: 0,
887 __pthread_rwlock_type: PTHREAD_PROCESS_PRIVATE,
888 __pthread_rwlock_magic: _RWL_MAGIC,
889 __pthread_rwlock_mutex: PTHREAD_MUTEX_INITIALIZER,
890 __pthread_rwlock_readercv: PTHREAD_COND_INITIALIZER,
891 __pthread_rwlock_writercv: PTHREAD_COND_INITIALIZER
892 };
893 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
894 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
895 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 4;
896 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
897
898 pub const RTLD_NEXT: *mut ::c_void = -1isize as *mut ::c_void;
899 pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void;
900 pub const RTLD_SELF: *mut ::c_void = -3isize as *mut ::c_void;
901 pub const RTLD_PROBE: *mut ::c_void = -4isize as *mut ::c_void;
902
903 pub const RTLD_NOW: ::c_int = 0x2;
904 pub const RTLD_NOLOAD: ::c_int = 0x4;
905 pub const RTLD_GLOBAL: ::c_int = 0x100;
906 pub const RTLD_LOCAL: ::c_int = 0x0;
907 pub const RTLD_PARENT: ::c_int = 0x200;
908 pub const RTLD_GROUP: ::c_int = 0x400;
909 pub const RTLD_WORLD: ::c_int = 0x800;
910 pub const RTLD_NODELETE: ::c_int = 0x1000;
911 pub const RTLD_FIRST: ::c_int = 0x2000;
912 pub const RTLD_CONFGEN: ::c_int = 0x10000;
913
914 f! {
915 pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
916 let fd = fd as usize;
917 (*set).fds_bits[fd / 32] &= !(1 << (fd % 32));
918 return
919 }
920
921 pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
922 let fd = fd as usize;
923 return ((*set).fds_bits[fd / 32] & (1 << (fd % 32))) != 0
924 }
925
926 pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
927 let fd = fd as usize;
928 (*set).fds_bits[fd / 32] |= 1 << (fd % 32);
929 return
930 }
931
932 pub fn FD_ZERO(set: *mut fd_set) -> () {
933 for slot in (*set).fds_bits.iter_mut() {
934 *slot = 0;
935 }
936 }
937
938 pub fn WIFEXITED(status: ::c_int) -> bool {
939 (status & 0xFF) == 0
940 }
941
942 pub fn WEXITSTATUS(status: ::c_int) -> ::c_int {
943 (status >> 8) & 0xFF
944 }
945
946 pub fn WTERMSIG(status: ::c_int) -> ::c_int {
947 status & 0x7F
948 }
949 }
950
951 extern {
952 pub fn stack_getbounds(sp: *mut ::stack_t) -> ::c_int;
953 pub fn mincore(addr: *const ::c_void, len: ::size_t,
954 vec: *mut c_char) -> ::c_int;
955 pub fn setgroups(ngroups: ::c_int,
956 ptr: *const ::gid_t) -> ::c_int;
957 pub fn ioctl(fildes: ::c_int, request: ::c_int, ...) -> ::c_int;
958 pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
959 -> ::c_int;
960 pub fn clock_getres(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
961 pub fn clock_gettime(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
962 pub fn getnameinfo(sa: *const ::sockaddr,
963 salen: ::socklen_t,
964 host: *mut ::c_char,
965 hostlen: ::socklen_t,
966 serv: *mut ::c_char,
967 sevlen: ::socklen_t,
968 flags: ::c_int) -> ::c_int;
969 pub fn getpwuid_r(uid: ::uid_t,
970 pwd: *mut passwd,
971 buf: *mut ::c_char,
972 buflen: ::size_t) -> *const passwd;
973 pub fn readdir(dirp: *mut ::DIR) -> *const ::dirent;
974 pub fn fdatasync(fd: ::c_int) -> ::c_int;
975 pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
976 pub fn duplocale(base: ::locale_t) -> ::locale_t;
977 pub fn freelocale(loc: ::locale_t);
978 pub fn newlocale(mask: ::c_int,
979 locale: *const ::c_char,
980 base: ::locale_t) -> ::locale_t;
981 pub fn uselocale(loc: ::locale_t) -> ::locale_t;
982 pub fn getprogname() -> *const ::c_char;
983 pub fn setprogname(name: *const ::c_char);
984 pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
985 pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
986 pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
987
988 pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
989 flags: ::c_int, ...) -> ::c_int;
990 pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
991 mode: ::c_int, flags: ::c_int) -> ::c_int;
992 pub fn fchmodat(dirfd: ::c_int, pathname: *const ::c_char,
993 mode: ::mode_t, flags: ::c_int) -> ::c_int;
994 pub fn fchownat(dirfd: ::c_int, pathname: *const ::c_char,
995 owner: ::uid_t, group: ::gid_t,
996 flags: ::c_int) -> ::c_int;
997 pub fn fstatat(dirfd: ::c_int, pathname: *const ::c_char,
998 buf: *mut stat, flags: ::c_int) -> ::c_int;
999 pub fn linkat(olddirfd: ::c_int, oldpath: *const ::c_char,
1000 newdirfd: ::c_int, newpath: *const ::c_char,
1001 flags: ::c_int) -> ::c_int;
1002 pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
1003 mode: ::mode_t) -> ::c_int;
1004 pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
1005 mode: ::mode_t, dev: dev_t) -> ::c_int;
1006 pub fn readlinkat(dirfd: ::c_int, pathname: *const ::c_char,
1007 buf: *mut ::c_char, bufsiz: ::size_t) -> ::ssize_t;
1008 pub fn renameat(olddirfd: ::c_int, oldpath: *const ::c_char,
1009 newdirfd: ::c_int, newpath: *const ::c_char)
1010 -> ::c_int;
1011 pub fn symlinkat(target: *const ::c_char, newdirfd: ::c_int,
1012 linkpath: *const ::c_char) -> ::c_int;
1013 pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char,
1014 flags: ::c_int) -> ::c_int;
1015 pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
1016 mode: ::mode_t) -> ::c_int;
1017 pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
1018 pub fn if_nameindex() -> *mut if_nameindex;
1019 pub fn if_freenameindex(ptr: *mut if_nameindex);
1020 pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t,
1021 clock_id: *mut clockid_t) -> ::c_int;
1022 pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
1023 clock_id: clockid_t) -> ::c_int;
1024 }
1025