]> git.proxmox.com Git - rustc.git/blob - src/vendor/libc/src/unix/bsd/netbsdlike/mod.rs
6604ec03b2cb23be55191fcd2841523b73f48b5f
[rustc.git] / src / vendor / libc / src / unix / bsd / netbsdlike / mod.rs
1 pub type time_t = i64;
2 pub type mode_t = u32;
3 pub type nlink_t = ::uint32_t;
4 pub type ino_t = ::uint64_t;
5 pub type pthread_key_t = ::c_int;
6 pub type rlim_t = u64;
7 pub type speed_t = ::c_uint;
8 pub type tcflag_t = ::c_uint;
9 pub type nl_item = c_long;
10 pub type clockid_t = ::c_int;
11 pub type id_t = ::uint32_t;
12 pub type sem_t = *mut sem;
13
14 pub enum timezone {}
15 pub enum sem {}
16
17 s! {
18 pub struct sigaction {
19 pub sa_sigaction: ::sighandler_t,
20 pub sa_mask: ::sigset_t,
21 pub sa_flags: ::c_int,
22 }
23
24 pub struct stack_t {
25 pub ss_sp: *mut ::c_void,
26 pub ss_size: ::size_t,
27 pub ss_flags: ::c_int,
28 }
29
30 pub struct sockaddr_in {
31 pub sin_len: u8,
32 pub sin_family: ::sa_family_t,
33 pub sin_port: ::in_port_t,
34 pub sin_addr: ::in_addr,
35 pub sin_zero: [::int8_t; 8],
36 }
37
38 pub struct termios {
39 pub c_iflag: ::tcflag_t,
40 pub c_oflag: ::tcflag_t,
41 pub c_cflag: ::tcflag_t,
42 pub c_lflag: ::tcflag_t,
43 pub c_cc: [::cc_t; ::NCCS],
44 pub c_ispeed: ::c_int,
45 pub c_ospeed: ::c_int,
46 }
47
48 pub struct flock {
49 pub l_start: ::off_t,
50 pub l_len: ::off_t,
51 pub l_pid: ::pid_t,
52 pub l_type: ::c_short,
53 pub l_whence: ::c_short,
54 }
55 }
56
57 pub const D_T_FMT: ::nl_item = 0;
58 pub const D_FMT: ::nl_item = 1;
59 pub const T_FMT: ::nl_item = 2;
60 pub const T_FMT_AMPM: ::nl_item = 3;
61 pub const AM_STR: ::nl_item = 4;
62 pub const PM_STR: ::nl_item = 5;
63
64 pub const DAY_1: ::nl_item = 6;
65 pub const DAY_2: ::nl_item = 7;
66 pub const DAY_3: ::nl_item = 8;
67 pub const DAY_4: ::nl_item = 9;
68 pub const DAY_5: ::nl_item = 10;
69 pub const DAY_6: ::nl_item = 11;
70 pub const DAY_7: ::nl_item = 12;
71
72 pub const ABDAY_1: ::nl_item = 13;
73 pub const ABDAY_2: ::nl_item = 14;
74 pub const ABDAY_3: ::nl_item = 15;
75 pub const ABDAY_4: ::nl_item = 16;
76 pub const ABDAY_5: ::nl_item = 17;
77 pub const ABDAY_6: ::nl_item = 18;
78 pub const ABDAY_7: ::nl_item = 19;
79
80 pub const MON_1: ::nl_item = 20;
81 pub const MON_2: ::nl_item = 21;
82 pub const MON_3: ::nl_item = 22;
83 pub const MON_4: ::nl_item = 23;
84 pub const MON_5: ::nl_item = 24;
85 pub const MON_6: ::nl_item = 25;
86 pub const MON_7: ::nl_item = 26;
87 pub const MON_8: ::nl_item = 27;
88 pub const MON_9: ::nl_item = 28;
89 pub const MON_10: ::nl_item = 29;
90 pub const MON_11: ::nl_item = 30;
91 pub const MON_12: ::nl_item = 31;
92
93 pub const ABMON_1: ::nl_item = 32;
94 pub const ABMON_2: ::nl_item = 33;
95 pub const ABMON_3: ::nl_item = 34;
96 pub const ABMON_4: ::nl_item = 35;
97 pub const ABMON_5: ::nl_item = 36;
98 pub const ABMON_6: ::nl_item = 37;
99 pub const ABMON_7: ::nl_item = 38;
100 pub const ABMON_8: ::nl_item = 39;
101 pub const ABMON_9: ::nl_item = 40;
102 pub const ABMON_10: ::nl_item = 41;
103 pub const ABMON_11: ::nl_item = 42;
104 pub const ABMON_12: ::nl_item = 43;
105
106 pub const RADIXCHAR: ::nl_item = 44;
107 pub const THOUSEP: ::nl_item = 45;
108 pub const YESSTR: ::nl_item = 46;
109 pub const YESEXPR: ::nl_item = 47;
110 pub const NOSTR: ::nl_item = 48;
111 pub const NOEXPR: ::nl_item = 49;
112 pub const CRNCYSTR: ::nl_item = 50;
113
114 pub const CODESET: ::nl_item = 51;
115
116 pub const EXIT_FAILURE : ::c_int = 1;
117 pub const EXIT_SUCCESS : ::c_int = 0;
118 pub const RAND_MAX : ::c_int = 2147483647;
119 pub const EOF : ::c_int = -1;
120 pub const SEEK_SET : ::c_int = 0;
121 pub const SEEK_CUR : ::c_int = 1;
122 pub const SEEK_END : ::c_int = 2;
123 pub const _IOFBF : ::c_int = 0;
124 pub const _IONBF : ::c_int = 2;
125 pub const _IOLBF : ::c_int = 1;
126 pub const BUFSIZ : ::c_uint = 1024;
127 pub const FOPEN_MAX : ::c_uint = 20;
128 pub const FILENAME_MAX : ::c_uint = 1024;
129 pub const L_tmpnam : ::c_uint = 1024;
130 pub const O_RDONLY : ::c_int = 0;
131 pub const O_WRONLY : ::c_int = 1;
132 pub const O_RDWR : ::c_int = 2;
133 pub const O_ACCMODE : ::c_int = 3;
134 pub const O_APPEND : ::c_int = 8;
135 pub const O_CREAT : ::c_int = 512;
136 pub const O_EXCL : ::c_int = 2048;
137 pub const O_NOCTTY : ::c_int = 32768;
138 pub const O_TRUNC : ::c_int = 1024;
139 pub const O_SYNC : ::c_int = 128;
140 pub const S_IFIFO : mode_t = 4096;
141 pub const S_IFCHR : mode_t = 8192;
142 pub const S_IFBLK : mode_t = 24576;
143 pub const S_IFDIR : mode_t = 16384;
144 pub const S_IFREG : mode_t = 32768;
145 pub const S_IFLNK : mode_t = 40960;
146 pub const S_IFSOCK : mode_t = 49152;
147 pub const S_IFMT : mode_t = 61440;
148 pub const S_IEXEC : mode_t = 64;
149 pub const S_IWRITE : mode_t = 128;
150 pub const S_IREAD : mode_t = 256;
151 pub const S_IRWXU : mode_t = 448;
152 pub const S_IXUSR : mode_t = 64;
153 pub const S_IWUSR : mode_t = 128;
154 pub const S_IRUSR : mode_t = 256;
155 pub const S_IRWXG : mode_t = 56;
156 pub const S_IXGRP : mode_t = 8;
157 pub const S_IWGRP : mode_t = 16;
158 pub const S_IRGRP : mode_t = 32;
159 pub const S_IRWXO : mode_t = 7;
160 pub const S_IXOTH : mode_t = 1;
161 pub const S_IWOTH : mode_t = 2;
162 pub const S_IROTH : mode_t = 4;
163 pub const F_OK : ::c_int = 0;
164 pub const R_OK : ::c_int = 4;
165 pub const W_OK : ::c_int = 2;
166 pub const X_OK : ::c_int = 1;
167 pub const STDIN_FILENO : ::c_int = 0;
168 pub const STDOUT_FILENO : ::c_int = 1;
169 pub const STDERR_FILENO : ::c_int = 2;
170 pub const F_LOCK : ::c_int = 1;
171 pub const F_TEST : ::c_int = 3;
172 pub const F_TLOCK : ::c_int = 2;
173 pub const F_ULOCK : ::c_int = 0;
174 pub const F_GETLK: ::c_int = 7;
175 pub const F_SETLK: ::c_int = 8;
176 pub const F_SETLKW: ::c_int = 9;
177 pub const SIGHUP : ::c_int = 1;
178 pub const SIGINT : ::c_int = 2;
179 pub const SIGQUIT : ::c_int = 3;
180 pub const SIGILL : ::c_int = 4;
181 pub const SIGABRT : ::c_int = 6;
182 pub const SIGEMT: ::c_int = 7;
183 pub const SIGFPE : ::c_int = 8;
184 pub const SIGKILL : ::c_int = 9;
185 pub const SIGSEGV : ::c_int = 11;
186 pub const SIGPIPE : ::c_int = 13;
187 pub const SIGALRM : ::c_int = 14;
188 pub const SIGTERM : ::c_int = 15;
189 pub const SIGSTKSZ : ::size_t = 40960;
190
191 pub const PROT_NONE : ::c_int = 0;
192 pub const PROT_READ : ::c_int = 1;
193 pub const PROT_WRITE : ::c_int = 2;
194 pub const PROT_EXEC : ::c_int = 4;
195
196 pub const MAP_FILE : ::c_int = 0x0000;
197 pub const MAP_SHARED : ::c_int = 0x0001;
198 pub const MAP_PRIVATE : ::c_int = 0x0002;
199 pub const MAP_FIXED : ::c_int = 0x0010;
200 pub const MAP_ANON : ::c_int = 0x1000;
201
202 pub const MAP_FAILED : *mut ::c_void = !0 as *mut ::c_void;
203
204 pub const MCL_CURRENT : ::c_int = 0x0001;
205 pub const MCL_FUTURE : ::c_int = 0x0002;
206
207 pub const MS_ASYNC : ::c_int = 0x0001;
208
209 pub const EPERM : ::c_int = 1;
210 pub const ENOENT : ::c_int = 2;
211 pub const ESRCH : ::c_int = 3;
212 pub const EINTR : ::c_int = 4;
213 pub const EIO : ::c_int = 5;
214 pub const ENXIO : ::c_int = 6;
215 pub const E2BIG : ::c_int = 7;
216 pub const ENOEXEC : ::c_int = 8;
217 pub const EBADF : ::c_int = 9;
218 pub const ECHILD : ::c_int = 10;
219 pub const EDEADLK : ::c_int = 11;
220 pub const ENOMEM : ::c_int = 12;
221 pub const EACCES : ::c_int = 13;
222 pub const EFAULT : ::c_int = 14;
223 pub const ENOTBLK : ::c_int = 15;
224 pub const EBUSY : ::c_int = 16;
225 pub const EEXIST : ::c_int = 17;
226 pub const EXDEV : ::c_int = 18;
227 pub const ENODEV : ::c_int = 19;
228 pub const ENOTDIR : ::c_int = 20;
229 pub const EISDIR : ::c_int = 21;
230 pub const EINVAL : ::c_int = 22;
231 pub const ENFILE : ::c_int = 23;
232 pub const EMFILE : ::c_int = 24;
233 pub const ENOTTY : ::c_int = 25;
234 pub const ETXTBSY : ::c_int = 26;
235 pub const EFBIG : ::c_int = 27;
236 pub const ENOSPC : ::c_int = 28;
237 pub const ESPIPE : ::c_int = 29;
238 pub const EROFS : ::c_int = 30;
239 pub const EMLINK : ::c_int = 31;
240 pub const EPIPE : ::c_int = 32;
241 pub const EDOM : ::c_int = 33;
242 pub const ERANGE : ::c_int = 34;
243 pub const EAGAIN : ::c_int = 35;
244 pub const EWOULDBLOCK : ::c_int = 35;
245 pub const EINPROGRESS : ::c_int = 36;
246 pub const EALREADY : ::c_int = 37;
247 pub const ENOTSOCK : ::c_int = 38;
248 pub const EDESTADDRREQ : ::c_int = 39;
249 pub const EMSGSIZE : ::c_int = 40;
250 pub const EPROTOTYPE : ::c_int = 41;
251 pub const ENOPROTOOPT : ::c_int = 42;
252 pub const EPROTONOSUPPORT : ::c_int = 43;
253 pub const ESOCKTNOSUPPORT : ::c_int = 44;
254 pub const EOPNOTSUPP : ::c_int = 45;
255 pub const EPFNOSUPPORT : ::c_int = 46;
256 pub const EAFNOSUPPORT : ::c_int = 47;
257 pub const EADDRINUSE : ::c_int = 48;
258 pub const EADDRNOTAVAIL : ::c_int = 49;
259 pub const ENETDOWN : ::c_int = 50;
260 pub const ENETUNREACH : ::c_int = 51;
261 pub const ENETRESET : ::c_int = 52;
262 pub const ECONNABORTED : ::c_int = 53;
263 pub const ECONNRESET : ::c_int = 54;
264 pub const ENOBUFS : ::c_int = 55;
265 pub const EISCONN : ::c_int = 56;
266 pub const ENOTCONN : ::c_int = 57;
267 pub const ESHUTDOWN : ::c_int = 58;
268 pub const ETOOMANYREFS : ::c_int = 59;
269 pub const ETIMEDOUT : ::c_int = 60;
270 pub const ECONNREFUSED : ::c_int = 61;
271 pub const ELOOP : ::c_int = 62;
272 pub const ENAMETOOLONG : ::c_int = 63;
273 pub const EHOSTDOWN : ::c_int = 64;
274 pub const EHOSTUNREACH : ::c_int = 65;
275 pub const ENOTEMPTY : ::c_int = 66;
276 pub const EPROCLIM : ::c_int = 67;
277 pub const EUSERS : ::c_int = 68;
278 pub const EDQUOT : ::c_int = 69;
279 pub const ESTALE : ::c_int = 70;
280 pub const EREMOTE : ::c_int = 71;
281 pub const EBADRPC : ::c_int = 72;
282 pub const ERPCMISMATCH : ::c_int = 73;
283 pub const EPROGUNAVAIL : ::c_int = 74;
284 pub const EPROGMISMATCH : ::c_int = 75;
285 pub const EPROCUNAVAIL : ::c_int = 76;
286 pub const ENOLCK : ::c_int = 77;
287 pub const ENOSYS : ::c_int = 78;
288 pub const EFTYPE : ::c_int = 79;
289 pub const EAUTH : ::c_int = 80;
290 pub const ENEEDAUTH : ::c_int = 81;
291
292 pub const F_DUPFD : ::c_int = 0;
293 pub const F_GETFD : ::c_int = 1;
294 pub const F_SETFD : ::c_int = 2;
295 pub const F_GETFL : ::c_int = 3;
296 pub const F_SETFL : ::c_int = 4;
297
298 pub const SIGTRAP : ::c_int = 5;
299
300 pub const GLOB_APPEND : ::c_int = 0x0001;
301 pub const GLOB_DOOFFS : ::c_int = 0x0002;
302 pub const GLOB_ERR : ::c_int = 0x0004;
303 pub const GLOB_MARK : ::c_int = 0x0008;
304 pub const GLOB_NOCHECK : ::c_int = 0x0010;
305 pub const GLOB_NOSORT : ::c_int = 0x0020;
306 pub const GLOB_NOESCAPE : ::c_int = 0x1000;
307
308 pub const GLOB_NOSPACE : ::c_int = -1;
309 pub const GLOB_ABORTED : ::c_int = -2;
310 pub const GLOB_NOMATCH : ::c_int = -3;
311 pub const GLOB_NOSYS : ::c_int = -4;
312
313 pub const POSIX_MADV_NORMAL : ::c_int = 0;
314 pub const POSIX_MADV_RANDOM : ::c_int = 1;
315 pub const POSIX_MADV_SEQUENTIAL : ::c_int = 2;
316 pub const POSIX_MADV_WILLNEED : ::c_int = 3;
317 pub const POSIX_MADV_DONTNEED : ::c_int = 4;
318
319 pub const _SC_XOPEN_SHM : ::c_int = 30;
320
321 pub const PTHREAD_CREATE_JOINABLE : ::c_int = 0;
322 pub const PTHREAD_CREATE_DETACHED : ::c_int = 1;
323
324 // http://man.openbsd.org/OpenBSD-current/man2/clock_getres.2
325 // The man page says clock_gettime(3) can accept various values as clockid_t but
326 // http://fxr.watson.org/fxr/source/kern/kern_time.c?v=OPENBSD;im=excerpts#L161
327 // the implementation rejects anything other than the below two
328 //
329 // http://netbsd.gw.com/cgi-bin/man-cgi?clock_gettime
330 // https://github.com/jsonn/src/blob/HEAD/sys/kern/subr_time.c#L222
331 // Basically the same goes for NetBSD
332 pub const CLOCK_REALTIME: clockid_t = 0;
333 pub const CLOCK_MONOTONIC: clockid_t = 3;
334
335 pub const RLIMIT_CPU: ::c_int = 0;
336 pub const RLIMIT_FSIZE: ::c_int = 1;
337 pub const RLIMIT_DATA: ::c_int = 2;
338 pub const RLIMIT_STACK: ::c_int = 3;
339 pub const RLIMIT_CORE: ::c_int = 4;
340 pub const RLIMIT_RSS: ::c_int = 5;
341 pub const RLIMIT_MEMLOCK: ::c_int = 6;
342 pub const RLIMIT_NPROC: ::c_int = 7;
343 pub const RLIMIT_NOFILE: ::c_int = 8;
344
345 pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
346 pub const RLIM_SAVED_MAX: rlim_t = RLIM_INFINITY;
347 pub const RLIM_SAVED_CUR: rlim_t = RLIM_INFINITY;
348
349 pub const RUSAGE_SELF: ::c_int = 0;
350 pub const RUSAGE_CHILDREN: ::c_int = -1;
351
352 pub const MADV_NORMAL : ::c_int = 0;
353 pub const MADV_RANDOM : ::c_int = 1;
354 pub const MADV_SEQUENTIAL : ::c_int = 2;
355 pub const MADV_WILLNEED : ::c_int = 3;
356 pub const MADV_DONTNEED : ::c_int = 4;
357 pub const MADV_FREE : ::c_int = 6;
358
359 pub const AF_UNIX: ::c_int = 1;
360 pub const AF_INET: ::c_int = 2;
361 pub const AF_INET6: ::c_int = 24;
362 pub const SOCK_STREAM: ::c_int = 1;
363 pub const SOCK_DGRAM: ::c_int = 2;
364 pub const SOCK_RAW: ::c_int = 3;
365 pub const SOCK_SEQPACKET: ::c_int = 5;
366 pub const IPPROTO_TCP: ::c_int = 6;
367 pub const IPPROTO_IP: ::c_int = 0;
368 pub const IPPROTO_IPV6: ::c_int = 41;
369 pub const IP_MULTICAST_TTL: ::c_int = 10;
370 pub const IP_MULTICAST_LOOP: ::c_int = 11;
371 pub const IP_TTL: ::c_int = 4;
372 pub const IP_HDRINCL: ::c_int = 2;
373 pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
374 pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
375
376 pub const TCP_NODELAY: ::c_int = 0x01;
377 pub const SOL_SOCKET: ::c_int = 0xffff;
378 pub const SO_DEBUG: ::c_int = 0x01;
379 pub const SO_ACCEPTCONN: ::c_int = 0x0002;
380 pub const SO_REUSEADDR: ::c_int = 0x0004;
381 pub const SO_KEEPALIVE: ::c_int = 0x0008;
382 pub const SO_DONTROUTE: ::c_int = 0x0010;
383 pub const SO_BROADCAST: ::c_int = 0x0020;
384 pub const SO_USELOOPBACK: ::c_int = 0x0040;
385 pub const SO_LINGER: ::c_int = 0x0080;
386 pub const SO_OOBINLINE: ::c_int = 0x0100;
387 pub const SO_REUSEPORT: ::c_int = 0x0200;
388 pub const SO_SNDBUF: ::c_int = 0x1001;
389 pub const SO_RCVBUF: ::c_int = 0x1002;
390 pub const SO_SNDLOWAT: ::c_int = 0x1003;
391 pub const SO_RCVLOWAT: ::c_int = 0x1004;
392 pub const SO_ERROR: ::c_int = 0x1007;
393 pub const SO_TYPE: ::c_int = 0x1008;
394
395 pub const MSG_NOSIGNAL: ::c_int = 0x400;
396
397 pub const IFF_LOOPBACK: ::c_int = 0x8;
398
399 pub const SHUT_RD: ::c_int = 0;
400 pub const SHUT_WR: ::c_int = 1;
401 pub const SHUT_RDWR: ::c_int = 2;
402
403 pub const LOCK_SH: ::c_int = 1;
404 pub const LOCK_EX: ::c_int = 2;
405 pub const LOCK_NB: ::c_int = 4;
406 pub const LOCK_UN: ::c_int = 8;
407
408 pub const O_NONBLOCK : ::c_int = 4;
409
410 pub const IPPROTO_RAW : ::c_int = 255;
411
412 pub const _SC_ARG_MAX : ::c_int = 1;
413 pub const _SC_CHILD_MAX : ::c_int = 2;
414 pub const _SC_NGROUPS_MAX : ::c_int = 4;
415 pub const _SC_OPEN_MAX : ::c_int = 5;
416 pub const _SC_JOB_CONTROL : ::c_int = 6;
417 pub const _SC_SAVED_IDS : ::c_int = 7;
418 pub const _SC_VERSION : ::c_int = 8;
419 pub const _SC_BC_BASE_MAX : ::c_int = 9;
420 pub const _SC_BC_DIM_MAX : ::c_int = 10;
421 pub const _SC_BC_SCALE_MAX : ::c_int = 11;
422 pub const _SC_BC_STRING_MAX : ::c_int = 12;
423 pub const _SC_COLL_WEIGHTS_MAX : ::c_int = 13;
424 pub const _SC_EXPR_NEST_MAX : ::c_int = 14;
425 pub const _SC_LINE_MAX : ::c_int = 15;
426 pub const _SC_RE_DUP_MAX : ::c_int = 16;
427 pub const _SC_2_VERSION : ::c_int = 17;
428 pub const _SC_2_C_BIND : ::c_int = 18;
429 pub const _SC_2_C_DEV : ::c_int = 19;
430 pub const _SC_2_CHAR_TERM : ::c_int = 20;
431 pub const _SC_2_FORT_DEV : ::c_int = 21;
432 pub const _SC_2_FORT_RUN : ::c_int = 22;
433 pub const _SC_2_LOCALEDEF : ::c_int = 23;
434 pub const _SC_2_SW_DEV : ::c_int = 24;
435 pub const _SC_2_UPE : ::c_int = 25;
436 pub const _SC_STREAM_MAX : ::c_int = 26;
437 pub const _SC_TZNAME_MAX : ::c_int = 27;
438 pub const _SC_PAGESIZE : ::c_int = 28;
439 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
440 pub const _SC_FSYNC : ::c_int = 29;
441
442 pub const Q_GETQUOTA: ::c_int = 0x300;
443 pub const Q_SETQUOTA: ::c_int = 0x400;
444
445 pub const RTLD_GLOBAL: ::c_int = 0x100;
446
447 pub const LOG_NFACILITIES: ::c_int = 24;
448
449 pub const HW_NCPU: ::c_int = 3;
450
451 pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
452
453 f! {
454 pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
455 status >> 8
456 }
457
458 pub fn WIFSIGNALED(status: ::c_int) -> bool {
459 (status & 0o177) != 0o177 && (status & 0o177) != 0
460 }
461
462 pub fn WIFSTOPPED(status: ::c_int) -> bool {
463 (status & 0o177) == 0o177
464 }
465 }
466
467 #[link(name = "util")]
468 extern {
469 pub fn mincore(addr: *mut ::c_void, len: ::size_t,
470 vec: *mut ::c_char) -> ::c_int;
471 #[cfg_attr(target_os = "netbsd", link_name = "__clock_getres50")]
472 pub fn clock_getres(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
473 #[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")]
474 pub fn clock_gettime(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
475 pub fn __errno() -> *mut ::c_int;
476 pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t)
477 -> ::c_int;
478 pub fn memrchr(cx: *const ::c_void,
479 c: ::c_int,
480 n: ::size_t) -> *mut ::c_void;
481 pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
482 pub fn mkostemps(template: *mut ::c_char,
483 suffixlen: ::c_int,
484 flags: ::c_int) -> ::c_int;
485 pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
486 pub fn fdatasync(fd: ::c_int) -> ::c_int;
487 pub fn openpty(amaster: *mut ::c_int,
488 aslave: *mut ::c_int,
489 name: *mut ::c_char,
490 termp: *mut termios,
491 winp: *mut ::winsize) -> ::c_int;
492 pub fn forkpty(amaster: *mut ::c_int,
493 name: *mut ::c_char,
494 termp: *mut termios,
495 winp: *mut ::winsize) -> ::pid_t;
496 pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
497 pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
498
499 pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
500 flags: ::c_int, ...) -> ::c_int;
501 pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
502 mode: ::c_int, flags: ::c_int) -> ::c_int;
503 pub fn fchmodat(dirfd: ::c_int, pathname: *const ::c_char,
504 mode: ::mode_t, flags: ::c_int) -> ::c_int;
505 pub fn fchownat(dirfd: ::c_int, pathname: *const ::c_char,
506 owner: ::uid_t, group: ::gid_t,
507 flags: ::c_int) -> ::c_int;
508 pub fn fstatat(dirfd: ::c_int, pathname: *const ::c_char,
509 buf: *mut stat, flags: ::c_int) -> ::c_int;
510 pub fn linkat(olddirfd: ::c_int, oldpath: *const ::c_char,
511 newdirfd: ::c_int, newpath: *const ::c_char,
512 flags: ::c_int) -> ::c_int;
513 pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
514 mode: ::mode_t) -> ::c_int;
515 pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
516 mode: ::mode_t, dev: dev_t) -> ::c_int;
517 pub fn readlinkat(dirfd: ::c_int, pathname: *const ::c_char,
518 buf: *mut ::c_char, bufsiz: ::size_t) -> ::ssize_t;
519 pub fn renameat(olddirfd: ::c_int, oldpath: *const ::c_char,
520 newdirfd: ::c_int, newpath: *const ::c_char)
521 -> ::c_int;
522 pub fn symlinkat(target: *const ::c_char, newdirfd: ::c_int,
523 linkpath: *const ::c_char) -> ::c_int;
524 pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char,
525 flags: ::c_int) -> ::c_int;
526 pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
527 mode: ::mode_t) -> ::c_int;
528 pub fn sem_timedwait(sem: *mut sem_t,
529 abstime: *const ::timespec) -> ::c_int;
530 pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
531 clock_id: clockid_t) -> ::c_int;
532 pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
533 pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
534 abstime: *const ::timespec) -> ::c_int;
535 }
536
537 cfg_if! {
538 if #[cfg(target_os = "netbsd")] {
539 mod netbsd;
540 pub use self::netbsd::*;
541 } else if #[cfg(any(target_os = "openbsd", target_os = "bitrig"))] {
542 mod openbsdlike;
543 pub use self::openbsdlike::*;
544 } else {
545 // Unknown target_os
546 }
547 }