]>
Commit | Line | Data |
---|---|---|
7453a54e SL |
1 | pub type clock_t = c_long; |
2 | pub type time_t = c_long; | |
3 | pub type suseconds_t = c_long; | |
4 | pub type ino_t = u64; | |
5 | pub type off_t = i64; | |
6 | pub type blkcnt_t = i64; | |
7 | ||
8 | pub type blksize_t = c_long; | |
9 | pub type fsblkcnt_t = ::c_ulonglong; | |
10 | pub type fsfilcnt_t = ::c_ulonglong; | |
11 | pub type rlim_t = ::c_ulonglong; | |
12 | ||
13 | s! { | |
14 | pub struct sigaction { | |
15 | pub sa_sigaction: ::sighandler_t, | |
16 | pub sa_mask: ::sigset_t, | |
17 | pub sa_flags: ::c_int, | |
18 | _restorer: *mut ::c_void, | |
19 | } | |
20 | ||
21 | pub struct siginfo_t { | |
22 | pub si_signo: ::c_int, | |
23 | pub si_errno: ::c_int, | |
24 | pub si_code: ::c_int, | |
25 | pub _pad: [::c_int; 29], | |
26 | _align: [usize; 0], | |
27 | } | |
28 | ||
29 | pub struct ipc_perm { | |
30 | pub __ipc_perm_key: ::key_t, | |
31 | pub uid: ::uid_t, | |
32 | pub gid: ::gid_t, | |
33 | pub cuid: ::uid_t, | |
34 | pub cgid: ::gid_t, | |
35 | pub mode: ::mode_t, | |
36 | pub __seq: ::c_int, | |
37 | __unused1: ::c_long, | |
38 | __unused2: ::c_long | |
39 | } | |
40 | ||
41 | pub struct termios { | |
42 | pub c_iflag: ::tcflag_t, | |
43 | pub c_oflag: ::tcflag_t, | |
44 | pub c_cflag: ::tcflag_t, | |
45 | pub c_lflag: ::tcflag_t, | |
46 | pub c_line: ::cc_t, | |
47 | pub c_cc: [::cc_t; ::NCCS], | |
48 | pub __c_ispeed: ::speed_t, | |
49 | pub __c_ospeed: ::speed_t, | |
50 | } | |
51 | ||
52 | pub struct flock { | |
53 | pub l_type: ::c_short, | |
54 | pub l_whence: ::c_short, | |
55 | pub l_start: ::off_t, | |
56 | pub l_len: ::off_t, | |
57 | pub l_pid: ::pid_t, | |
58 | } | |
59 | } | |
60 | ||
61 | pub const BUFSIZ: ::c_uint = 1024; | |
62 | pub const TMP_MAX: ::c_uint = 10000; | |
63 | pub const FOPEN_MAX: ::c_uint = 1000; | |
64 | pub const POSIX_MADV_DONTNEED: ::c_int = 0; | |
65 | pub const O_ACCMODE: ::c_int = 0o10000003; | |
66 | pub const O_NDELAY: ::c_int = O_NONBLOCK; | |
67 | pub const RUSAGE_CHILDREN: ::c_int = 1; | |
68 | pub const NI_MAXHOST: ::socklen_t = 255; | |
69 | pub const PTHREAD_STACK_MIN: ::size_t = 2048; | |
70 | ||
71 | pub const RLIM_INFINITY: ::rlim_t = !0; | |
72 | pub const RLIMIT_RTTIME: ::c_int = 15; | |
73 | pub const RLIMIT_NLIMITS: ::c_int = 16; | |
74 | ||
75 | pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; | |
76 | ||
77 | pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15; | |
78 | pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16; | |
79 | pub const TCP_THIN_DUPACK: ::c_int = 17; | |
80 | pub const TCP_USER_TIMEOUT: ::c_int = 18; | |
81 | pub const TCP_REPAIR: ::c_int = 19; | |
82 | pub const TCP_REPAIR_QUEUE: ::c_int = 20; | |
83 | pub const TCP_QUEUE_SEQ: ::c_int = 21; | |
84 | pub const TCP_REPAIR_OPTIONS: ::c_int = 22; | |
85 | pub const TCP_FASTOPEN: ::c_int = 23; | |
86 | pub const TCP_TIMESTAMP: ::c_int = 24; | |
87 | ||
88 | pub const SIGUNUSED: ::c_int = ::SIGSYS; | |
89 | ||
90 | pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01; | |
91 | pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02; | |
92 | ||
93 | pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; | |
94 | ||
95 | pub const CPU_SETSIZE: ::c_int = 128; | |
96 | ||
97 | pub const QFMT_VFS_V1: ::c_int = 4; | |
98 | ||
99 | pub const PTRACE_TRACEME: ::c_int = 0; | |
100 | pub const PTRACE_PEEKTEXT: ::c_int = 1; | |
101 | pub const PTRACE_PEEKDATA: ::c_int = 2; | |
102 | pub const PTRACE_PEEKUSER: ::c_int = 3; | |
103 | pub const PTRACE_POKETEXT: ::c_int = 4; | |
104 | pub const PTRACE_POKEDATA: ::c_int = 5; | |
105 | pub const PTRACE_POKEUSER: ::c_int = 6; | |
106 | pub const PTRACE_CONT: ::c_int = 7; | |
107 | pub const PTRACE_KILL: ::c_int = 8; | |
108 | pub const PTRACE_SINGLESTEP: ::c_int = 9; | |
109 | pub const PTRACE_ATTACH: ::c_int = 16; | |
110 | pub const PTRACE_DETACH: ::c_int = 17; | |
111 | pub const PTRACE_SYSCALL: ::c_int = 24; | |
112 | pub const PTRACE_SETOPTIONS: ::c_int = 0x4200; | |
113 | pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201; | |
114 | pub const PTRACE_GETSIGINFO: ::c_int = 0x4202; | |
115 | pub const PTRACE_SETSIGINFO: ::c_int = 0x4203; | |
116 | pub const PTRACE_GETREGSET: ::c_int = 0x4204; | |
117 | pub const PTRACE_SETREGSET: ::c_int = 0x4205; | |
118 | pub const PTRACE_SEIZE: ::c_int = 0x4206; | |
119 | pub const PTRACE_INTERRUPT: ::c_int = 0x4207; | |
120 | pub const PTRACE_LISTEN: ::c_int = 0x4208; | |
121 | pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209; | |
122 | ||
123 | pub const MADV_DODUMP: ::c_int = 17; | |
124 | pub const MADV_DONTDUMP: ::c_int = 16; | |
125 | ||
126 | pub const EPOLLWAKEUP: ::c_int = 0x20000000; | |
127 | ||
128 | pub const MADV_HUGEPAGE: ::c_int = 14; | |
129 | pub const MADV_NOHUGEPAGE: ::c_int = 15; | |
130 | ||
131 | pub const PTRACE_GETFPREGS: ::c_uint = 14; | |
132 | pub const PTRACE_SETFPREGS: ::c_uint = 15; | |
133 | pub const PTRACE_GETFPXREGS: ::c_uint = 18; | |
134 | pub const PTRACE_SETFPXREGS: ::c_uint = 19; | |
135 | pub const PTRACE_GETREGS: ::c_uint = 12; | |
136 | pub const PTRACE_SETREGS: ::c_uint = 13; | |
137 | ||
138 | pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK; | |
139 | ||
140 | pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK; | |
141 | ||
142 | pub const TCSANOW: ::c_int = 0; | |
143 | pub const TCSADRAIN: ::c_int = 1; | |
144 | pub const TCSAFLUSH: ::c_int = 2; | |
145 | ||
146 | pub const TIOCINQ: ::c_ulong = ::FIONREAD; | |
147 | ||
148 | pub const RTLD_GLOBAL: ::c_int = 0x100; | |
149 | pub const RTLD_NOLOAD: ::c_int = 0x4; | |
150 | ||
54a0048b SL |
151 | // TODO(#247) Temporarily musl-specific (available since musl 0.9.12 / Linux |
152 | // kernel 3.10). See also notbsd/mod.rs | |
153 | pub const CLOCK_SGI_CYCLE: ::clockid_t = 10; | |
154 | pub const CLOCK_TAI: ::clockid_t = 11; | |
155 | ||
7453a54e SL |
156 | extern { |
157 | pub fn getnameinfo(sa: *const ::sockaddr, | |
158 | salen: ::socklen_t, | |
159 | host: *mut ::c_char, | |
160 | hostlen: ::socklen_t, | |
161 | serv: *mut ::c_char, | |
162 | sevlen: ::socklen_t, | |
163 | flags: ::c_int) -> ::c_int; | |
164 | pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; | |
165 | pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; | |
166 | pub fn ptrace(request: ::c_int, ...) -> ::c_long; | |
167 | } | |
168 | ||
169 | cfg_if! { | |
170 | if #[cfg(any(target_arch = "x86_64"))] { | |
171 | mod b64; | |
172 | pub use self::b64::*; | |
173 | } else if #[cfg(any(target_arch = "x86", | |
174 | target_arch = "mips", | |
175 | target_arch = "arm", | |
176 | target_arch = "asmjs"))] { | |
177 | mod b32; | |
178 | pub use self::b32::*; | |
179 | } else { } | |
180 | } |