]>
git.proxmox.com Git - rustc.git/blob - src/liblibc/src/unix/notbsd/mod.rs
3 pub type sa_family_t
= u16;
4 pub type pthread_key_t
= ::c_uint
;
5 pub type speed_t
= ::c_uint
;
6 pub type tcflag_t
= ::c_uint
;
7 pub type loff_t
= ::c_longlong
;
8 pub type clockid_t
= ::c_int
;
14 pub sa_family
: sa_family_t
,
15 pub sa_data
: [::c_char
; 14],
18 pub struct sockaddr_in
{
19 pub sin_family
: sa_family_t
,
20 pub sin_port
: ::in_port_t
,
21 pub sin_addr
: ::in_addr
,
22 pub sin_zero
: [u8; 8],
25 pub struct sockaddr_in6
{
26 pub sin6_family
: sa_family_t
,
27 pub sin6_port
: ::in_port_t
,
28 pub sin6_flowinfo
: u32,
29 pub sin6_addr
: ::in6_addr
,
30 pub sin6_scope_id
: u32,
33 pub struct sockaddr_un
{
34 pub sun_family
: sa_family_t
,
35 pub sun_path
: [::c_char
; 108]
38 pub struct sockaddr_storage
{
39 pub ss_family
: sa_family_t
,
41 #[cfg(target_pointer_width = "32")]
42 __ss_pad2
: [u8; 128 - 2 * 4],
43 #[cfg(target_pointer_width = "64")]
44 __ss_pad2
: [u8; 128 - 2 * 8],
48 pub ai_flags
: ::c_int
,
49 pub ai_family
: ::c_int
,
50 pub ai_socktype
: ::c_int
,
51 pub ai_protocol
: ::c_int
,
52 pub ai_addrlen
: socklen_t
,
54 #[cfg(any(target_os = "linux", target_os = "emscripten"))]
55 pub ai_addr
: *mut ::sockaddr
,
57 pub ai_canonname
: *mut c_char
,
59 #[cfg(target_os = "android")]
60 pub ai_addr
: *mut ::sockaddr
,
62 pub ai_next
: *mut addrinfo
,
65 pub struct sockaddr_nl
{
66 pub nl_family
: ::sa_family_t
,
72 pub struct sockaddr_ll
{
73 pub sll_family
: ::c_ushort
,
74 pub sll_protocol
: ::c_ushort
,
75 pub sll_ifindex
: ::c_int
,
76 pub sll_hatype
: ::c_ushort
,
77 pub sll_pkttype
: ::c_uchar
,
78 pub sll_halen
: ::c_uchar
,
79 pub sll_addr
: [::c_uchar
; 8]
83 fds_bits
: [::c_ulong
; FD_SETSIZE
/ ULONG_SIZE
],
95 pub tm_isdst
: ::c_int
,
96 pub tm_gmtoff
: ::c_long
,
97 pub tm_zone
: *const ::c_char
,
100 pub struct sched_param
{
101 pub sched_priority
: ::c_int
,
102 #[cfg(target_env = "musl")]
103 pub sched_ss_low_priority
: ::c_int
,
104 #[cfg(target_env = "musl")]
105 pub sched_ss_repl_period
: ::timespec
,
106 #[cfg(target_env = "musl")]
107 pub sched_ss_init_budget
: ::timespec
,
108 #[cfg(target_env = "musl")]
109 pub sched_ss_max_repl
: ::c_int
,
113 pub dli_fname
: *const ::c_char
,
114 pub dli_fbase
: *mut ::c_void
,
115 pub dli_sname
: *const ::c_char
,
116 pub dli_saddr
: *mut ::c_void
,
119 #[cfg_attr(any(all(target_arch = "x86", not(target_env = "musl")),
120 target_arch
= "x86_64"),
122 pub struct epoll_event
{
123 pub events
: ::uint32_t
,
128 pub sysname
: [::c_char
; 65],
129 pub nodename
: [::c_char
; 65],
130 pub release
: [::c_char
; 65],
131 pub version
: [::c_char
; 65],
132 pub machine
: [::c_char
; 65],
133 pub domainname
: [::c_char
; 65]
137 pub decimal_point
: *mut ::c_char
,
138 pub thousands_sep
: *mut ::c_char
,
139 pub grouping
: *mut ::c_char
,
140 pub int_curr_symbol
: *mut ::c_char
,
141 pub currency_symbol
: *mut ::c_char
,
142 pub mon_decimal_point
: *mut ::c_char
,
143 pub mon_thousands_sep
: *mut ::c_char
,
144 pub mon_grouping
: *mut ::c_char
,
145 pub positive_sign
: *mut ::c_char
,
146 pub negative_sign
: *mut ::c_char
,
147 pub int_frac_digits
: ::c_char
,
148 pub frac_digits
: ::c_char
,
149 pub p_cs_precedes
: ::c_char
,
150 pub p_sep_by_space
: ::c_char
,
151 pub n_cs_precedes
: ::c_char
,
152 pub n_sep_by_space
: ::c_char
,
153 pub p_sign_posn
: ::c_char
,
154 pub n_sign_posn
: ::c_char
,
155 pub int_p_cs_precedes
: ::c_char
,
156 pub int_p_sep_by_space
: ::c_char
,
157 pub int_n_cs_precedes
: ::c_char
,
158 pub int_n_sep_by_space
: ::c_char
,
159 pub int_p_sign_posn
: ::c_char
,
160 pub int_n_sign_posn
: ::c_char
,
164 // intentionally not public, only used for fd_set
166 if #[cfg(target_pointer_width = "32")] {
167 const ULONG_SIZE
: usize = 32;
168 } else if #[cfg(target_pointer_width = "64")] {
169 const ULONG_SIZE
: usize = 64;
171 // Unknown target_pointer_width
175 pub const EXIT_FAILURE
: ::c_int
= 1;
176 pub const EXIT_SUCCESS
: ::c_int
= 0;
177 pub const RAND_MAX
: ::c_int
= 2147483647;
178 pub const EOF
: ::c_int
= -1;
179 pub const SEEK_SET
: ::c_int
= 0;
180 pub const SEEK_CUR
: ::c_int
= 1;
181 pub const SEEK_END
: ::c_int
= 2;
182 pub const _IOFBF
: ::c_int
= 0;
183 pub const _IONBF
: ::c_int
= 2;
184 pub const _IOLBF
: ::c_int
= 1;
186 pub const F_DUPFD
: ::c_int
= 0;
187 pub const F_GETFD
: ::c_int
= 1;
188 pub const F_SETFD
: ::c_int
= 2;
189 pub const F_GETFL
: ::c_int
= 3;
190 pub const F_SETFL
: ::c_int
= 4;
192 // Linux-specific fcntls
193 pub const F_SETLEASE
: ::c_int
= 1024;
194 pub const F_GETLEASE
: ::c_int
= 1025;
195 pub const F_NOTIFY
: ::c_int
= 1026;
196 pub const F_DUPFD_CLOEXEC
: ::c_int
= 1030;
197 pub const F_SETPIPE_SZ
: ::c_int
= 1031;
198 pub const F_GETPIPE_SZ
: ::c_int
= 1032;
200 // TODO(#235): Include file sealing fcntls once we have a way to verify them.
202 pub const SIGTRAP
: ::c_int
= 5;
204 pub const PTHREAD_CREATE_JOINABLE
: ::c_int
= 0;
205 pub const PTHREAD_CREATE_DETACHED
: ::c_int
= 1;
207 pub const CLOCK_REALTIME
: clockid_t
= 0;
208 pub const CLOCK_MONOTONIC
: clockid_t
= 1;
209 pub const CLOCK_PROCESS_CPUTIME_ID
: clockid_t
= 2;
210 pub const CLOCK_THREAD_CPUTIME_ID
: clockid_t
= 3;
211 pub const CLOCK_MONOTONIC_RAW
: clockid_t
= 4;
212 pub const CLOCK_REALTIME_COARSE
: clockid_t
= 5;
213 pub const CLOCK_MONOTONIC_COARSE
: clockid_t
= 6;
214 pub const CLOCK_BOOTTIME
: clockid_t
= 7;
215 pub const CLOCK_REALTIME_ALARM
: clockid_t
= 8;
216 pub const CLOCK_BOOTTIME_ALARM
: clockid_t
= 9;
217 // TODO(#247) Someday our Travis shall have glibc 2.21 (released in Sep
218 // 2014.) See also musl/mod.rs
219 // pub const CLOCK_SGI_CYCLE: clockid_t = 10;
220 // pub const CLOCK_TAI: clockid_t = 11;
222 pub const RLIMIT_CPU
: ::c_int
= 0;
223 pub const RLIMIT_FSIZE
: ::c_int
= 1;
224 pub const RLIMIT_DATA
: ::c_int
= 2;
225 pub const RLIMIT_STACK
: ::c_int
= 3;
226 pub const RLIMIT_CORE
: ::c_int
= 4;
227 pub const RLIMIT_LOCKS
: ::c_int
= 10;
228 pub const RLIMIT_SIGPENDING
: ::c_int
= 11;
229 pub const RLIMIT_MSGQUEUE
: ::c_int
= 12;
230 pub const RLIMIT_NICE
: ::c_int
= 13;
231 pub const RLIMIT_RTPRIO
: ::c_int
= 14;
233 pub const RUSAGE_SELF
: ::c_int
= 0;
235 pub const O_RDONLY
: ::c_int
= 0;
236 pub const O_WRONLY
: ::c_int
= 1;
237 pub const O_RDWR
: ::c_int
= 2;
238 pub const O_TRUNC
: ::c_int
= 512;
239 pub const O_CLOEXEC
: ::c_int
= 0x80000;
241 pub const SOCK_CLOEXEC
: ::c_int
= O_CLOEXEC
;
243 pub const S_IFIFO
: ::mode_t
= 4096;
244 pub const S_IFCHR
: ::mode_t
= 8192;
245 pub const S_IFBLK
: ::mode_t
= 24576;
246 pub const S_IFDIR
: ::mode_t
= 16384;
247 pub const S_IFREG
: ::mode_t
= 32768;
248 pub const S_IFLNK
: ::mode_t
= 40960;
249 pub const S_IFSOCK
: ::mode_t
= 49152;
250 pub const S_IFMT
: ::mode_t
= 61440;
251 pub const S_IRWXU
: ::mode_t
= 448;
252 pub const S_IXUSR
: ::mode_t
= 64;
253 pub const S_IWUSR
: ::mode_t
= 128;
254 pub const S_IRUSR
: ::mode_t
= 256;
255 pub const S_IRWXG
: ::mode_t
= 56;
256 pub const S_IXGRP
: ::mode_t
= 8;
257 pub const S_IWGRP
: ::mode_t
= 16;
258 pub const S_IRGRP
: ::mode_t
= 32;
259 pub const S_IRWXO
: ::mode_t
= 7;
260 pub const S_IXOTH
: ::mode_t
= 1;
261 pub const S_IWOTH
: ::mode_t
= 2;
262 pub const S_IROTH
: ::mode_t
= 4;
263 pub const F_OK
: ::c_int
= 0;
264 pub const R_OK
: ::c_int
= 4;
265 pub const W_OK
: ::c_int
= 2;
266 pub const X_OK
: ::c_int
= 1;
267 pub const STDIN_FILENO
: ::c_int
= 0;
268 pub const STDOUT_FILENO
: ::c_int
= 1;
269 pub const STDERR_FILENO
: ::c_int
= 2;
270 pub const SIGHUP
: ::c_int
= 1;
271 pub const SIGINT
: ::c_int
= 2;
272 pub const SIGQUIT
: ::c_int
= 3;
273 pub const SIGILL
: ::c_int
= 4;
274 pub const SIGABRT
: ::c_int
= 6;
275 pub const SIGFPE
: ::c_int
= 8;
276 pub const SIGKILL
: ::c_int
= 9;
277 pub const SIGSEGV
: ::c_int
= 11;
278 pub const SIGPIPE
: ::c_int
= 13;
279 pub const SIGALRM
: ::c_int
= 14;
280 pub const SIGTERM
: ::c_int
= 15;
282 pub const PROT_NONE
: ::c_int
= 0;
283 pub const PROT_READ
: ::c_int
= 1;
284 pub const PROT_WRITE
: ::c_int
= 2;
285 pub const PROT_EXEC
: ::c_int
= 4;
287 pub const LC_CTYPE
: ::c_int
= 0;
288 pub const LC_NUMERIC
: ::c_int
= 1;
289 pub const LC_TIME
: ::c_int
= 2;
290 pub const LC_COLLATE
: ::c_int
= 3;
291 pub const LC_MONETARY
: ::c_int
= 4;
292 pub const LC_MESSAGES
: ::c_int
= 5;
293 pub const LC_ALL
: ::c_int
= 6;
295 pub const MAP_FILE
: ::c_int
= 0x0000;
296 pub const MAP_SHARED
: ::c_int
= 0x0001;
297 pub const MAP_PRIVATE
: ::c_int
= 0x0002;
298 pub const MAP_FIXED
: ::c_int
= 0x0010;
300 pub const MAP_FAILED
: *mut ::c_void
= !0 as *mut ::c_void
;
302 pub const MCL_CURRENT
: ::c_int
= 0x0001;
303 pub const MCL_FUTURE
: ::c_int
= 0x0002;
305 // MS_ flags for msync(2)
306 pub const MS_ASYNC
: ::c_int
= 0x0001;
307 pub const MS_INVALIDATE
: ::c_int
= 0x0002;
308 pub const MS_SYNC
: ::c_int
= 0x0004;
310 // MS_ flags for mount(2)
311 pub const MS_RDONLY
: ::c_ulong
= 0x01;
312 pub const MS_NOSUID
: ::c_ulong
= 0x02;
313 pub const MS_NODEV
: ::c_ulong
= 0x04;
314 pub const MS_NOEXEC
: ::c_ulong
= 0x08;
315 pub const MS_SYNCHRONOUS
: ::c_ulong
= 0x10;
316 pub const MS_REMOUNT
: ::c_ulong
= 0x20;
317 pub const MS_MANDLOCK
: ::c_ulong
= 0x40;
318 pub const MS_DIRSYNC
: ::c_ulong
= 0x80;
319 pub const MS_NOATIME
: ::c_ulong
= 0x0400;
320 pub const MS_NODIRATIME
: ::c_ulong
= 0x0800;
321 pub const MS_BIND
: ::c_ulong
= 0x1000;
322 pub const MS_MOVE
: ::c_ulong
= 0x2000;
323 pub const MS_REC
: ::c_ulong
= 0x4000;
324 pub const MS_SILENT
: ::c_ulong
= 0x8000;
325 pub const MS_POSIXACL
: ::c_ulong
= 0x010000;
326 pub const MS_UNBINDABLE
: ::c_ulong
= 0x020000;
327 pub const MS_PRIVATE
: ::c_ulong
= 0x040000;
328 pub const MS_SLAVE
: ::c_ulong
= 0x080000;
329 pub const MS_SHARED
: ::c_ulong
= 0x100000;
330 pub const MS_RELATIME
: ::c_ulong
= 0x200000;
331 pub const MS_KERNMOUNT
: ::c_ulong
= 0x400000;
332 pub const MS_I_VERSION
: ::c_ulong
= 0x800000;
333 pub const MS_STRICTATIME
: ::c_ulong
= 0x1000000;
334 pub const MS_ACTIVE
: ::c_ulong
= 0x40000000;
335 pub const MS_NOUSER
: ::c_ulong
= 0x80000000;
336 pub const MS_MGC_VAL
: ::c_ulong
= 0xc0ed0000;
337 pub const MS_MGC_MSK
: ::c_ulong
= 0xffff0000;
338 pub const MS_RMT_MASK
: ::c_ulong
= 0x800051;
340 pub const EPERM
: ::c_int
= 1;
341 pub const ENOENT
: ::c_int
= 2;
342 pub const ESRCH
: ::c_int
= 3;
343 pub const EINTR
: ::c_int
= 4;
344 pub const EIO
: ::c_int
= 5;
345 pub const ENXIO
: ::c_int
= 6;
346 pub const E2BIG
: ::c_int
= 7;
347 pub const ENOEXEC
: ::c_int
= 8;
348 pub const EBADF
: ::c_int
= 9;
349 pub const ECHILD
: ::c_int
= 10;
350 pub const EAGAIN
: ::c_int
= 11;
351 pub const ENOMEM
: ::c_int
= 12;
352 pub const EACCES
: ::c_int
= 13;
353 pub const EFAULT
: ::c_int
= 14;
354 pub const ENOTBLK
: ::c_int
= 15;
355 pub const EBUSY
: ::c_int
= 16;
356 pub const EEXIST
: ::c_int
= 17;
357 pub const EXDEV
: ::c_int
= 18;
358 pub const ENODEV
: ::c_int
= 19;
359 pub const ENOTDIR
: ::c_int
= 20;
360 pub const EISDIR
: ::c_int
= 21;
361 pub const EINVAL
: ::c_int
= 22;
362 pub const ENFILE
: ::c_int
= 23;
363 pub const EMFILE
: ::c_int
= 24;
364 pub const ENOTTY
: ::c_int
= 25;
365 pub const ETXTBSY
: ::c_int
= 26;
366 pub const EFBIG
: ::c_int
= 27;
367 pub const ENOSPC
: ::c_int
= 28;
368 pub const ESPIPE
: ::c_int
= 29;
369 pub const EROFS
: ::c_int
= 30;
370 pub const EMLINK
: ::c_int
= 31;
371 pub const EPIPE
: ::c_int
= 32;
372 pub const EDOM
: ::c_int
= 33;
373 pub const ERANGE
: ::c_int
= 34;
374 pub const EWOULDBLOCK
: ::c_int
= EAGAIN
;
376 pub const EBFONT
: ::c_int
= 59;
377 pub const ENOSTR
: ::c_int
= 60;
378 pub const ENODATA
: ::c_int
= 61;
379 pub const ETIME
: ::c_int
= 62;
380 pub const ENOSR
: ::c_int
= 63;
381 pub const ENONET
: ::c_int
= 64;
382 pub const ENOPKG
: ::c_int
= 65;
383 pub const EREMOTE
: ::c_int
= 66;
384 pub const ENOLINK
: ::c_int
= 67;
385 pub const EADV
: ::c_int
= 68;
386 pub const ESRMNT
: ::c_int
= 69;
387 pub const ECOMM
: ::c_int
= 70;
388 pub const EPROTO
: ::c_int
= 71;
389 pub const EDOTDOT
: ::c_int
= 73;
391 pub const AF_PACKET
: ::c_int
= 17;
392 pub const IPPROTO_RAW
: ::c_int
= 255;
394 pub const PROT_GROWSDOWN
: ::c_int
= 0x1000000;
395 pub const PROT_GROWSUP
: ::c_int
= 0x2000000;
397 pub const MAP_TYPE
: ::c_int
= 0x000f;
399 pub const MADV_NORMAL
: ::c_int
= 0;
400 pub const MADV_RANDOM
: ::c_int
= 1;
401 pub const MADV_SEQUENTIAL
: ::c_int
= 2;
402 pub const MADV_WILLNEED
: ::c_int
= 3;
403 pub const MADV_DONTNEED
: ::c_int
= 4;
404 pub const MADV_REMOVE
: ::c_int
= 9;
405 pub const MADV_DONTFORK
: ::c_int
= 10;
406 pub const MADV_DOFORK
: ::c_int
= 11;
407 pub const MADV_MERGEABLE
: ::c_int
= 12;
408 pub const MADV_UNMERGEABLE
: ::c_int
= 13;
409 pub const MADV_HWPOISON
: ::c_int
= 100;
411 pub const IFF_LOOPBACK
: ::c_int
= 0x8;
413 pub const AF_UNIX
: ::c_int
= 1;
414 pub const AF_INET
: ::c_int
= 2;
415 pub const AF_INET6
: ::c_int
= 10;
416 pub const SOCK_RAW
: ::c_int
= 3;
417 pub const IPPROTO_TCP
: ::c_int
= 6;
418 pub const IPPROTO_IP
: ::c_int
= 0;
419 pub const IPPROTO_IPV6
: ::c_int
= 41;
420 pub const IP_MULTICAST_TTL
: ::c_int
= 33;
421 pub const IP_MULTICAST_LOOP
: ::c_int
= 34;
422 pub const IP_TTL
: ::c_int
= 2;
423 pub const IP_HDRINCL
: ::c_int
= 3;
424 pub const IP_ADD_MEMBERSHIP
: ::c_int
= 35;
425 pub const IP_DROP_MEMBERSHIP
: ::c_int
= 36;
426 pub const IP_TRANSPARENT
: ::c_int
= 19;
427 pub const IPV6_ADD_MEMBERSHIP
: ::c_int
= 20;
428 pub const IPV6_DROP_MEMBERSHIP
: ::c_int
= 21;
430 pub const TCP_NODELAY
: ::c_int
= 1;
431 pub const TCP_MAXSEG
: ::c_int
= 2;
432 pub const TCP_CORK
: ::c_int
= 3;
433 pub const TCP_KEEPIDLE
: ::c_int
= 4;
434 pub const TCP_KEEPINTVL
: ::c_int
= 5;
435 pub const TCP_KEEPCNT
: ::c_int
= 6;
436 pub const TCP_SYNCNT
: ::c_int
= 7;
437 pub const TCP_LINGER2
: ::c_int
= 8;
438 pub const TCP_DEFER_ACCEPT
: ::c_int
= 9;
439 pub const TCP_WINDOW_CLAMP
: ::c_int
= 10;
440 pub const TCP_INFO
: ::c_int
= 11;
441 pub const TCP_QUICKACK
: ::c_int
= 12;
442 pub const TCP_CONGESTION
: ::c_int
= 13;
444 pub const IPV6_MULTICAST_LOOP
: ::c_int
= 19;
445 pub const IPV6_V6ONLY
: ::c_int
= 26;
447 pub const SO_DEBUG
: ::c_int
= 1;
449 pub const SHUT_RD
: ::c_int
= 0;
450 pub const SHUT_WR
: ::c_int
= 1;
451 pub const SHUT_RDWR
: ::c_int
= 2;
453 pub const LOCK_SH
: ::c_int
= 1;
454 pub const LOCK_EX
: ::c_int
= 2;
455 pub const LOCK_NB
: ::c_int
= 4;
456 pub const LOCK_UN
: ::c_int
= 8;
458 pub const SIGSTKSZ
: ::size_t
= 8192;
460 pub const SA_NODEFER
: ::c_int
= 0x40000000;
461 pub const SA_RESETHAND
: ::c_int
= 0x80000000;
462 pub const SA_RESTART
: ::c_int
= 0x10000000;
463 pub const SA_NOCLDSTOP
: ::c_int
= 0x00000001;
465 pub const SS_ONSTACK
: ::c_int
= 1;
466 pub const SS_DISABLE
: ::c_int
= 2;
468 pub const PATH_MAX
: ::c_int
= 4096;
470 pub const FD_SETSIZE
: usize = 1024;
472 pub const EPOLLIN
: ::c_int
= 0x1;
473 pub const EPOLLPRI
: ::c_int
= 0x2;
474 pub const EPOLLOUT
: ::c_int
= 0x4;
475 pub const EPOLLRDNORM
: ::c_int
= 0x40;
476 pub const EPOLLRDBAND
: ::c_int
= 0x80;
477 pub const EPOLLWRNORM
: ::c_int
= 0x100;
478 pub const EPOLLWRBAND
: ::c_int
= 0x200;
479 pub const EPOLLMSG
: ::c_int
= 0x400;
480 pub const EPOLLERR
: ::c_int
= 0x8;
481 pub const EPOLLHUP
: ::c_int
= 0x10;
482 pub const EPOLLET
: ::c_int
= 0x80000000;
484 pub const EPOLL_CTL_ADD
: ::c_int
= 1;
485 pub const EPOLL_CTL_MOD
: ::c_int
= 3;
486 pub const EPOLL_CTL_DEL
: ::c_int
= 2;
488 pub const MNT_DETACH
: ::c_int
= 0x2;
489 pub const MNT_EXPIRE
: ::c_int
= 0x4;
491 pub const Q_GETFMT
: ::c_int
= 0x800004;
492 pub const Q_GETINFO
: ::c_int
= 0x800005;
493 pub const Q_SETINFO
: ::c_int
= 0x800006;
494 pub const QIF_BLIMITS
: ::uint32_t
= 1;
495 pub const QIF_SPACE
: ::uint32_t
= 2;
496 pub const QIF_ILIMITS
: ::uint32_t
= 4;
497 pub const QIF_INODES
: ::uint32_t
= 8;
498 pub const QIF_BTIME
: ::uint32_t
= 16;
499 pub const QIF_ITIME
: ::uint32_t
= 32;
500 pub const QIF_LIMITS
: ::uint32_t
= 5;
501 pub const QIF_USAGE
: ::uint32_t
= 10;
502 pub const QIF_TIMES
: ::uint32_t
= 48;
503 pub const QIF_ALL
: ::uint32_t
= 63;
505 pub const CBAUD
: ::tcflag_t
= 0o0010017;
507 pub const EFD_CLOEXEC
: ::c_int
= 0x80000;
509 pub const MNT_FORCE
: ::c_int
= 0x1;
511 pub const Q_SYNC
: ::c_int
= 0x800001;
512 pub const Q_QUOTAON
: ::c_int
= 0x800002;
513 pub const Q_QUOTAOFF
: ::c_int
= 0x800003;
514 pub const Q_GETQUOTA
: ::c_int
= 0x800007;
515 pub const Q_SETQUOTA
: ::c_int
= 0x800008;
517 pub const TCIOFF
: ::c_int
= 2;
518 pub const TCION
: ::c_int
= 3;
519 pub const TCOOFF
: ::c_int
= 0;
520 pub const TCOON
: ::c_int
= 1;
521 pub const TCIFLUSH
: ::c_int
= 0;
522 pub const TCOFLUSH
: ::c_int
= 1;
523 pub const TCIOFLUSH
: ::c_int
= 2;
524 pub const NL0
: ::c_int
= 0x00000000;
525 pub const NL1
: ::c_int
= 0x00000100;
526 pub const TAB0
: ::c_int
= 0x00000000;
527 pub const TAB1
: ::c_int
= 0x00000800;
528 pub const TAB2
: ::c_int
= 0x00001000;
529 pub const TAB3
: ::c_int
= 0x00001800;
530 pub const CR0
: ::c_int
= 0x00000000;
531 pub const CR1
: ::c_int
= 0x00000200;
532 pub const CR2
: ::c_int
= 0x00000400;
533 pub const CR3
: ::c_int
= 0x00000600;
534 pub const FF0
: ::c_int
= 0x00000000;
535 pub const FF1
: ::c_int
= 0x00008000;
536 pub const BS0
: ::c_int
= 0x00000000;
537 pub const BS1
: ::c_int
= 0x00002000;
538 pub const VT0
: ::c_int
= 0x00000000;
539 pub const VT1
: ::c_int
= 0x00004000;
540 pub const VERASE
: usize = 2;
541 pub const VWERASE
: usize = 14;
542 pub const VKILL
: usize = 3;
543 pub const VREPRINT
: usize = 12;
544 pub const VINTR
: usize = 0;
545 pub const VQUIT
: usize = 1;
546 pub const VSUSP
: usize = 10;
547 pub const VSTART
: usize = 8;
548 pub const VSTOP
: usize = 9;
549 pub const VLNEXT
: usize = 15;
550 pub const VDISCARD
: usize = 13;
551 pub const VTIME
: usize = 5;
552 pub const IGNBRK
: ::tcflag_t
= 0x00000001;
553 pub const BRKINT
: ::tcflag_t
= 0x00000002;
554 pub const IGNPAR
: ::tcflag_t
= 0x00000004;
555 pub const PARMRK
: ::tcflag_t
= 0x00000008;
556 pub const INPCK
: ::tcflag_t
= 0x00000010;
557 pub const ISTRIP
: ::tcflag_t
= 0x00000020;
558 pub const INLCR
: ::tcflag_t
= 0x00000040;
559 pub const IGNCR
: ::tcflag_t
= 0x00000080;
560 pub const ICRNL
: ::tcflag_t
= 0x00000100;
561 pub const IXON
: ::tcflag_t
= 0x00000400;
562 pub const IXOFF
: ::tcflag_t
= 0x00001000;
563 pub const IXANY
: ::tcflag_t
= 0x00000800;
564 pub const IMAXBEL
: ::tcflag_t
= 0x00002000;
565 pub const OPOST
: ::tcflag_t
= 0x1;
566 pub const ONLCR
: ::tcflag_t
= 0x4;
567 pub const CSIZE
: ::tcflag_t
= 0x00000030;
568 pub const CS5
: ::tcflag_t
= 0x00000000;
569 pub const CS6
: ::tcflag_t
= 0x00000010;
570 pub const CS7
: ::tcflag_t
= 0x00000020;
571 pub const CS8
: ::tcflag_t
= 0x00000030;
572 pub const CSTOPB
: ::tcflag_t
= 0x00000040;
573 pub const CREAD
: ::tcflag_t
= 0x00000080;
574 pub const PARENB
: ::tcflag_t
= 0x00000100;
575 pub const PARODD
: ::tcflag_t
= 0x00000200;
576 pub const HUPCL
: ::tcflag_t
= 0x00000400;
577 pub const CLOCAL
: ::tcflag_t
= 0x00000800;
578 pub const CRTSCTS
: ::tcflag_t
= 0x80000000;
579 pub const ECHOKE
: ::tcflag_t
= 0x00000800;
580 pub const ECHOE
: ::tcflag_t
= 0x00000010;
581 pub const ECHOK
: ::tcflag_t
= 0x00000020;
582 pub const ECHO
: ::tcflag_t
= 0x00000008;
583 pub const ECHONL
: ::tcflag_t
= 0x00000040;
584 pub const ECHOPRT
: ::tcflag_t
= 0x00000400;
585 pub const ECHOCTL
: ::tcflag_t
= 0x00000200;
586 pub const ISIG
: ::tcflag_t
= 0x00000001;
587 pub const ICANON
: ::tcflag_t
= 0x00000002;
588 pub const PENDIN
: ::tcflag_t
= 0x00004000;
589 pub const NOFLSH
: ::tcflag_t
= 0x00000080;
591 pub const CLONE_VM
: ::c_int
= 0x100;
592 pub const CLONE_FS
: ::c_int
= 0x200;
593 pub const CLONE_FILES
: ::c_int
= 0x400;
594 pub const CLONE_SIGHAND
: ::c_int
= 0x800;
595 pub const CLONE_PTRACE
: ::c_int
= 0x2000;
596 pub const CLONE_VFORK
: ::c_int
= 0x4000;
597 pub const CLONE_PARENT
: ::c_int
= 0x8000;
598 pub const CLONE_THREAD
: ::c_int
= 0x10000;
599 pub const CLONE_NEWNS
: ::c_int
= 0x20000;
600 pub const CLONE_SYSVSEM
: ::c_int
= 0x40000;
601 pub const CLONE_SETTLS
: ::c_int
= 0x80000;
602 pub const CLONE_PARENT_SETTID
: ::c_int
= 0x100000;
603 pub const CLONE_CHILD_CLEARTID
: ::c_int
= 0x200000;
604 pub const CLONE_DETACHED
: ::c_int
= 0x400000;
605 pub const CLONE_UNTRACED
: ::c_int
= 0x800000;
606 pub const CLONE_CHILD_SETTID
: ::c_int
= 0x01000000;
607 pub const CLONE_NEWUTS
: ::c_int
= 0x04000000;
608 pub const CLONE_NEWIPC
: ::c_int
= 0x08000000;
609 pub const CLONE_NEWUSER
: ::c_int
= 0x10000000;
610 pub const CLONE_NEWPID
: ::c_int
= 0x20000000;
611 pub const CLONE_NEWNET
: ::c_int
= 0x40000000;
612 pub const CLONE_IO
: ::c_int
= 0x80000000;
614 pub const WNOHANG
: ::c_int
= 1;
616 pub const SPLICE_F_MOVE
: ::c_uint
= 0x01;
617 pub const SPLICE_F_NONBLOCK
: ::c_uint
= 0x02;
618 pub const SPLICE_F_MORE
: ::c_uint
= 0x04;
619 pub const SPLICE_F_GIFT
: ::c_uint
= 0x08;
621 pub const RTLD_LOCAL
: ::c_int
= 0;
623 pub const POSIX_FADV_NORMAL
: ::c_int
= 0;
624 pub const POSIX_FADV_RANDOM
: ::c_int
= 1;
625 pub const POSIX_FADV_SEQUENTIAL
: ::c_int
= 2;
626 pub const POSIX_FADV_WILLNEED
: ::c_int
= 3;
627 pub const POSIX_FADV_DONTNEED
: ::c_int
= 4;
628 pub const POSIX_FADV_NOREUSE
: ::c_int
= 5;
630 pub const AT_FDCWD
: ::c_int
= -100;
631 pub const AT_SYMLINK_NOFOLLOW
: ::c_int
= 0x100;
634 pub fn FD_CLR(fd
: ::c_int
, set
: *mut fd_set
) -> () {
635 let fd
= fd
as usize;
636 let size
= mem
::size_of_val(&(*set
).fds_bits
[0]) * 8;
637 (*set
).fds_bits
[fd
/ size
] &= !(1 << (fd
% size
));
641 pub fn FD_ISSET(fd
: ::c_int
, set
: *mut fd_set
) -> bool
{
642 let fd
= fd
as usize;
643 let size
= mem
::size_of_val(&(*set
).fds_bits
[0]) * 8;
644 return ((*set
).fds_bits
[fd
/ size
] & (1 << (fd
% size
))) != 0
647 pub fn FD_SET(fd
: ::c_int
, set
: *mut fd_set
) -> () {
648 let fd
= fd
as usize;
649 let size
= mem
::size_of_val(&(*set
).fds_bits
[0]) * 8;
650 (*set
).fds_bits
[fd
/ size
] |= 1 << (fd
% size
);
654 pub fn FD_ZERO(set
: *mut fd_set
) -> () {
655 for slot
in (*set
).fds_bits
.iter_mut() {
660 pub fn WIFEXITED(status
: ::c_int
) -> bool
{
664 pub fn WEXITSTATUS(status
: ::c_int
) -> ::c_int
{
668 pub fn WTERMSIG(status
: ::c_int
) -> ::c_int
{
674 pub fn getpwuid_r(uid
: ::uid_t
,
678 result
: *mut *mut passwd
) -> ::c_int
;
679 pub fn fdatasync(fd
: ::c_int
) -> ::c_int
;
680 pub fn mincore(addr
: *mut ::c_void
, len
: ::size_t
,
681 vec
: *mut ::c_uchar
) -> ::c_int
;
682 pub fn clock_getres(clk_id
: clockid_t
, tp
: *mut ::timespec
) -> ::c_int
;
683 pub fn clock_gettime(clk_id
: clockid_t
, tp
: *mut ::timespec
) -> ::c_int
;
684 pub fn prctl(option
: ::c_int
, ...) -> ::c_int
;
685 pub fn pthread_getattr_np(native
: ::pthread_t
,
686 attr
: *mut ::pthread_attr_t
) -> ::c_int
;
687 pub fn pthread_attr_getguardsize(attr
: *const ::pthread_attr_t
,
688 guardsize
: *mut ::size_t
) -> ::c_int
;
689 pub fn pthread_attr_getstack(attr
: *const ::pthread_attr_t
,
690 stackaddr
: *mut *mut ::c_void
,
691 stacksize
: *mut ::size_t
) -> ::c_int
;
692 pub fn memalign(align
: ::size_t
, size
: ::size_t
) -> *mut ::c_void
;
693 pub fn setgroups(ngroups
: ::size_t
,
694 ptr
: *const ::gid_t
) -> ::c_int
;
695 pub fn sched_setscheduler(pid
: ::pid_t
,
697 param
: *const sched_param
) -> ::c_int
;
698 pub fn sched_getscheduler(pid
: ::pid_t
) -> ::c_int
;
699 pub fn sched_get_priority_max(policy
: ::c_int
) -> ::c_int
;
700 pub fn sched_get_priority_min(policy
: ::c_int
) -> ::c_int
;
701 pub fn epoll_create(size
: ::c_int
) -> ::c_int
;
702 pub fn epoll_ctl(epfd
: ::c_int
,
705 event
: *mut epoll_event
) -> ::c_int
;
706 pub fn epoll_wait(epfd
: ::c_int
,
707 events
: *mut epoll_event
,
709 timeout
: ::c_int
) -> ::c_int
;
710 pub fn pipe2(fds
: *mut ::c_int
, flags
: ::c_int
) -> ::c_int
;
711 pub fn mount(src
: *const ::c_char
,
712 target
: *const ::c_char
,
713 fstype
: *const ::c_char
,
715 data
: *const ::c_void
) -> ::c_int
;
716 pub fn umount(target
: *const ::c_char
) -> ::c_int
;
717 pub fn umount2(target
: *const ::c_char
, flags
: ::c_int
) -> ::c_int
;
718 pub fn clone(cb
: extern fn(*mut ::c_void
) -> ::c_int
,
719 child_stack
: *mut ::c_void
,
721 arg
: *mut ::c_void
, ...) -> ::c_int
;
722 pub fn statfs(path
: *const ::c_char
, buf
: *mut statfs
) -> ::c_int
;
723 pub fn fstatfs(fd
: ::c_int
, buf
: *mut statfs
) -> ::c_int
;
724 pub fn memrchr(cx
: *const ::c_void
,
726 n
: ::size_t
) -> *mut ::c_void
;
727 pub fn syscall(num
: ::c_long
, ...) -> ::c_long
;
728 pub fn sendfile(out_fd
: ::c_int
,
731 count
: ::size_t
) -> ::ssize_t
;
732 pub fn splice(fd_in
: ::c_int
,
733 off_in
: *mut ::loff_t
,
735 off_out
: *mut ::loff_t
,
737 flags
: ::c_uint
) -> ::ssize_t
;
738 pub fn tee(fd_in
: ::c_int
,
741 flags
: ::c_uint
) -> ::ssize_t
;
742 pub fn vmsplice(fd
: ::c_int
,
745 flags
: ::c_uint
) -> ::ssize_t
;
747 pub fn posix_fadvise(fd
: ::c_int
, offset
: ::off_t
, len
: ::off_t
,
748 advise
: ::c_int
) -> ::c_int
;
749 pub fn futimens(fd
: ::c_int
, times
: *const ::timespec
) -> ::c_int
;
750 pub fn utimensat(dirfd
: ::c_int
, path
: *const ::c_char
,
751 times
: *const ::timespec
, flag
: ::c_int
) -> ::c_int
;
755 if #[cfg(any(target_os = "linux",
756 target_os
= "emscripten"))] {
758 pub use self::linux
::*;
759 } else if #[cfg(target_os = "android")] {
761 pub use self::android
::*;