]>
Commit | Line | Data |
---|---|---|
476ff2be SL |
1 | //! Android-specific definitions for linux-like values |
2 | ||
3 | use dox::mem; | |
4 | ||
476ff2be SL |
5 | pub type clock_t = ::c_long; |
6 | pub type time_t = ::c_long; | |
7 | pub type suseconds_t = ::c_long; | |
476ff2be SL |
8 | pub type off_t = ::c_long; |
9 | pub type blkcnt_t = ::c_ulong; | |
10 | pub type blksize_t = ::c_ulong; | |
11 | pub type nlink_t = u32; | |
12 | pub type useconds_t = u32; | |
476ff2be SL |
13 | pub type pthread_t = ::c_long; |
14 | pub type pthread_mutexattr_t = ::c_long; | |
041b39d2 | 15 | pub type pthread_rwlockattr_t = ::c_long; |
476ff2be | 16 | pub type pthread_condattr_t = ::c_long; |
476ff2be SL |
17 | pub type fsfilcnt_t = ::c_ulong; |
18 | pub type fsblkcnt_t = ::c_ulong; | |
19 | pub type nfds_t = ::c_uint; | |
20 | pub type rlim_t = ::c_ulong; | |
21 | pub type dev_t = ::c_ulong; | |
22 | pub type ino_t = ::c_ulong; | |
23 | pub type __CPU_BITTYPE = ::c_ulong; | |
8bb4bdeb | 24 | pub type idtype_t = ::c_int; |
476ff2be SL |
25 | |
26 | s! { | |
27 | pub struct dirent { | |
28 | pub d_ino: u64, | |
29 | pub d_off: i64, | |
30 | pub d_reclen: ::c_ushort, | |
31 | pub d_type: ::c_uchar, | |
32 | pub d_name: [::c_char; 256], | |
33 | } | |
34 | ||
35 | pub struct dirent64 { | |
36 | pub d_ino: u64, | |
37 | pub d_off: i64, | |
38 | pub d_reclen: ::c_ushort, | |
39 | pub d_type: ::c_uchar, | |
40 | pub d_name: [::c_char; 256], | |
41 | } | |
42 | ||
476ff2be SL |
43 | pub struct stack_t { |
44 | pub ss_sp: *mut ::c_void, | |
45 | pub ss_flags: ::c_int, | |
46 | pub ss_size: ::size_t | |
47 | } | |
48 | ||
49 | pub struct siginfo_t { | |
50 | pub si_signo: ::c_int, | |
51 | pub si_errno: ::c_int, | |
52 | pub si_code: ::c_int, | |
53 | pub _pad: [::c_int; 29], | |
8bb4bdeb | 54 | _align: [usize; 0], |
476ff2be SL |
55 | } |
56 | ||
57 | pub struct __fsid_t { | |
58 | __val: [::c_int; 2], | |
59 | } | |
60 | ||
61 | pub struct msghdr { | |
62 | pub msg_name: *mut ::c_void, | |
8bb4bdeb | 63 | pub msg_namelen: ::socklen_t, |
476ff2be SL |
64 | pub msg_iov: *mut ::iovec, |
65 | pub msg_iovlen: ::size_t, | |
66 | pub msg_control: *mut ::c_void, | |
67 | pub msg_controllen: ::size_t, | |
68 | pub msg_flags: ::c_int, | |
69 | } | |
70 | ||
8bb4bdeb XL |
71 | pub struct cmsghdr { |
72 | pub cmsg_len: ::size_t, | |
73 | pub cmsg_level: ::c_int, | |
74 | pub cmsg_type: ::c_int, | |
75 | } | |
76 | ||
476ff2be SL |
77 | pub struct termios { |
78 | pub c_iflag: ::tcflag_t, | |
79 | pub c_oflag: ::tcflag_t, | |
80 | pub c_cflag: ::tcflag_t, | |
81 | pub c_lflag: ::tcflag_t, | |
82 | pub c_line: ::cc_t, | |
83 | pub c_cc: [::cc_t; ::NCCS], | |
84 | } | |
85 | ||
86 | pub struct flock { | |
87 | pub l_type: ::c_short, | |
88 | pub l_whence: ::c_short, | |
89 | pub l_start: ::off_t, | |
90 | pub l_len: ::off_t, | |
91 | pub l_pid: ::pid_t, | |
92 | } | |
93 | ||
94 | pub struct cpu_set_t { | |
95 | #[cfg(target_pointer_width = "64")] | |
96 | __bits: [__CPU_BITTYPE; 16], | |
97 | #[cfg(target_pointer_width = "32")] | |
98 | __bits: [__CPU_BITTYPE; 1], | |
99 | } | |
100 | ||
101 | pub struct sem_t { | |
102 | count: ::c_uint, | |
8bb4bdeb XL |
103 | #[cfg(target_pointer_width = "64")] |
104 | __reserved: [::c_int; 3], | |
476ff2be SL |
105 | } |
106 | ||
107 | pub struct lastlog { | |
108 | ll_time: ::time_t, | |
109 | ll_line: [::c_char; UT_LINESIZE], | |
110 | ll_host: [::c_char; UT_HOSTSIZE], | |
111 | } | |
112 | ||
113 | pub struct exit_status { | |
114 | pub e_termination: ::c_short, | |
115 | pub e_exit: ::c_short, | |
116 | } | |
117 | ||
118 | pub struct utmp { | |
119 | pub ut_type: ::c_short, | |
120 | pub ut_pid: ::pid_t, | |
121 | pub ut_line: [::c_char; UT_LINESIZE], | |
122 | pub ut_id: [::c_char; 4], | |
123 | ||
124 | pub ut_user: [::c_char; UT_NAMESIZE], | |
125 | pub ut_host: [::c_char; UT_HOSTSIZE], | |
126 | pub ut_exit: exit_status, | |
127 | pub ut_session: ::c_long, | |
128 | pub ut_tv: ::timeval, | |
129 | ||
130 | pub ut_addr_v6: [::int32_t; 4], | |
131 | unused: [::c_char; 20], | |
132 | } | |
8bb4bdeb XL |
133 | |
134 | pub struct statvfs { | |
135 | pub f_bsize: ::c_ulong, | |
136 | pub f_frsize: ::c_ulong, | |
137 | pub f_blocks: ::fsblkcnt_t, | |
138 | pub f_bfree: ::fsblkcnt_t, | |
139 | pub f_bavail: ::fsblkcnt_t, | |
140 | pub f_files: ::fsfilcnt_t, | |
141 | pub f_ffree: ::fsfilcnt_t, | |
142 | pub f_favail: ::fsfilcnt_t, | |
143 | pub f_fsid: ::c_ulong, | |
144 | pub f_flag: ::c_ulong, | |
145 | pub f_namemax: ::c_ulong, | |
146 | #[cfg(target_pointer_width = "64")] | |
147 | __f_reserved: [u32; 6], | |
148 | } | |
476ff2be SL |
149 | } |
150 | ||
8bb4bdeb XL |
151 | pub const O_TRUNC: ::c_int = 512; |
152 | ||
153 | pub const O_CLOEXEC: ::c_int = 0x80000; | |
154 | ||
155 | pub const EBFONT: ::c_int = 59; | |
156 | pub const ENOSTR: ::c_int = 60; | |
157 | pub const ENODATA: ::c_int = 61; | |
158 | pub const ETIME: ::c_int = 62; | |
159 | pub const ENOSR: ::c_int = 63; | |
160 | pub const ENONET: ::c_int = 64; | |
161 | pub const ENOPKG: ::c_int = 65; | |
162 | pub const EREMOTE: ::c_int = 66; | |
163 | pub const ENOLINK: ::c_int = 67; | |
164 | pub const EADV: ::c_int = 68; | |
165 | pub const ESRMNT: ::c_int = 69; | |
166 | pub const ECOMM: ::c_int = 70; | |
167 | pub const EPROTO: ::c_int = 71; | |
168 | pub const EDOTDOT: ::c_int = 73; | |
169 | ||
170 | pub const SA_NODEFER: ::c_int = 0x40000000; | |
171 | pub const SA_RESETHAND: ::c_int = 0x80000000; | |
172 | pub const SA_RESTART: ::c_int = 0x10000000; | |
173 | pub const SA_NOCLDSTOP: ::c_int = 0x00000001; | |
174 | ||
175 | pub const EPOLL_CLOEXEC: ::c_int = 0x80000; | |
041b39d2 XL |
176 | pub const EPOLLONESHOT: ::c_int = 0x40000000; |
177 | pub const EPOLLRDHUP: ::c_int = 0x00002000; | |
178 | pub const EPOLLWAKEUP: ::c_int = 0x20000000; | |
8bb4bdeb XL |
179 | |
180 | pub const EFD_CLOEXEC: ::c_int = 0x80000; | |
181 | ||
476ff2be SL |
182 | pub const USER_PROCESS: ::c_short = 7; |
183 | ||
184 | pub const BUFSIZ: ::c_uint = 1024; | |
185 | pub const FILENAME_MAX: ::c_uint = 1024; | |
186 | pub const FOPEN_MAX: ::c_uint = 20; | |
187 | pub const POSIX_FADV_DONTNEED: ::c_int = 4; | |
188 | pub const POSIX_FADV_NOREUSE: ::c_int = 5; | |
189 | pub const L_tmpnam: ::c_uint = 1024; | |
190 | pub const TMP_MAX: ::c_uint = 308915776; | |
191 | pub const _PC_LINK_MAX: ::c_int = 1; | |
192 | pub const _PC_MAX_CANON: ::c_int = 2; | |
193 | pub const _PC_MAX_INPUT: ::c_int = 3; | |
194 | pub const _PC_NAME_MAX: ::c_int = 4; | |
195 | pub const _PC_PATH_MAX: ::c_int = 5; | |
196 | pub const _PC_PIPE_BUF: ::c_int = 6; | |
041b39d2 XL |
197 | pub const _PC_2_SYMLINKS: ::c_int = 7; |
198 | pub const _PC_ALLOC_SIZE_MIN: ::c_int = 8; | |
199 | pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 9; | |
200 | pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 10; | |
201 | pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 11; | |
202 | pub const _PC_REC_XFER_ALIGN: ::c_int = 12; | |
203 | pub const _PC_SYMLINK_MAX: ::c_int = 13; | |
476ff2be SL |
204 | pub const _PC_CHOWN_RESTRICTED: ::c_int = 14; |
205 | pub const _PC_NO_TRUNC: ::c_int = 15; | |
206 | pub const _PC_VDISABLE: ::c_int = 16; | |
041b39d2 XL |
207 | pub const _PC_ASYNC_IO: ::c_int = 17; |
208 | pub const _PC_PRIO_IO: ::c_int = 18; | |
209 | pub const _PC_SYNC_IO: ::c_int = 19; | |
476ff2be SL |
210 | |
211 | pub const FIONBIO: ::c_int = 0x5421; | |
212 | ||
213 | pub const _SC_ARG_MAX: ::c_int = 0; | |
214 | pub const _SC_BC_BASE_MAX: ::c_int = 1; | |
215 | pub const _SC_BC_DIM_MAX: ::c_int = 2; | |
216 | pub const _SC_BC_SCALE_MAX: ::c_int = 3; | |
217 | pub const _SC_BC_STRING_MAX: ::c_int = 4; | |
218 | pub const _SC_CHILD_MAX: ::c_int = 5; | |
219 | pub const _SC_CLK_TCK: ::c_int = 6; | |
220 | pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 7; | |
221 | pub const _SC_EXPR_NEST_MAX: ::c_int = 8; | |
222 | pub const _SC_LINE_MAX: ::c_int = 9; | |
223 | pub const _SC_NGROUPS_MAX: ::c_int = 10; | |
224 | pub const _SC_OPEN_MAX: ::c_int = 11; | |
041b39d2 | 225 | pub const _SC_PASS_MAX: ::c_int = 12; |
476ff2be SL |
226 | pub const _SC_2_C_BIND: ::c_int = 13; |
227 | pub const _SC_2_C_DEV: ::c_int = 14; | |
228 | pub const _SC_2_C_VERSION: ::c_int = 15; | |
229 | pub const _SC_2_CHAR_TERM: ::c_int = 16; | |
230 | pub const _SC_2_FORT_DEV: ::c_int = 17; | |
231 | pub const _SC_2_FORT_RUN: ::c_int = 18; | |
232 | pub const _SC_2_LOCALEDEF: ::c_int = 19; | |
233 | pub const _SC_2_SW_DEV: ::c_int = 20; | |
234 | pub const _SC_2_UPE: ::c_int = 21; | |
235 | pub const _SC_2_VERSION: ::c_int = 22; | |
236 | pub const _SC_JOB_CONTROL: ::c_int = 23; | |
237 | pub const _SC_SAVED_IDS: ::c_int = 24; | |
238 | pub const _SC_VERSION: ::c_int = 25; | |
239 | pub const _SC_RE_DUP_MAX: ::c_int = 26; | |
240 | pub const _SC_STREAM_MAX: ::c_int = 27; | |
241 | pub const _SC_TZNAME_MAX: ::c_int = 28; | |
242 | pub const _SC_XOPEN_CRYPT: ::c_int = 29; | |
243 | pub const _SC_XOPEN_ENH_I18N: ::c_int = 30; | |
244 | pub const _SC_XOPEN_SHM: ::c_int = 31; | |
245 | pub const _SC_XOPEN_VERSION: ::c_int = 32; | |
246 | pub const _SC_XOPEN_XCU_VERSION: ::c_int = 33; | |
247 | pub const _SC_XOPEN_REALTIME: ::c_int = 34; | |
248 | pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 35; | |
249 | pub const _SC_XOPEN_LEGACY: ::c_int = 36; | |
250 | pub const _SC_ATEXIT_MAX: ::c_int = 37; | |
251 | pub const _SC_IOV_MAX: ::c_int = 38; | |
252 | pub const _SC_PAGESIZE: ::c_int = 39; | |
253 | pub const _SC_PAGE_SIZE: ::c_int = 40; | |
254 | pub const _SC_XOPEN_UNIX: ::c_int = 41; | |
041b39d2 XL |
255 | pub const _SC_XBS5_ILP32_OFF32: ::c_int = 42; |
256 | pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 43; | |
257 | pub const _SC_XBS5_LP64_OFF64: ::c_int = 44; | |
258 | pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 45; | |
259 | pub const _SC_AIO_LISTIO_MAX: ::c_int = 46; | |
260 | pub const _SC_AIO_MAX: ::c_int = 47; | |
261 | pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 48; | |
262 | pub const _SC_DELAYTIMER_MAX: ::c_int = 49; | |
263 | pub const _SC_MQ_OPEN_MAX: ::c_int = 50; | |
476ff2be | 264 | pub const _SC_MQ_PRIO_MAX: ::c_int = 51; |
041b39d2 XL |
265 | pub const _SC_RTSIG_MAX: ::c_int = 52; |
266 | pub const _SC_SEM_NSEMS_MAX: ::c_int = 53; | |
267 | pub const _SC_SEM_VALUE_MAX: ::c_int = 54; | |
268 | pub const _SC_SIGQUEUE_MAX: ::c_int = 55; | |
269 | pub const _SC_TIMER_MAX: ::c_int = 56; | |
270 | pub const _SC_ASYNCHRONOUS_IO: ::c_int = 57; | |
271 | pub const _SC_FSYNC: ::c_int = 58; | |
272 | pub const _SC_MAPPED_FILES: ::c_int = 59; | |
273 | pub const _SC_MEMLOCK: ::c_int = 60; | |
274 | pub const _SC_MEMLOCK_RANGE: ::c_int = 61; | |
275 | pub const _SC_MEMORY_PROTECTION: ::c_int = 62; | |
276 | pub const _SC_MESSAGE_PASSING: ::c_int = 63; | |
277 | pub const _SC_PRIORITIZED_IO: ::c_int = 64; | |
278 | pub const _SC_PRIORITY_SCHEDULING: ::c_int = 65; | |
279 | pub const _SC_REALTIME_SIGNALS: ::c_int = 66; | |
280 | pub const _SC_SEMAPHORES: ::c_int = 67; | |
281 | pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 68; | |
282 | pub const _SC_SYNCHRONIZED_IO: ::c_int = 69; | |
283 | pub const _SC_TIMERS: ::c_int = 70; | |
476ff2be SL |
284 | pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 71; |
285 | pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 72; | |
286 | pub const _SC_LOGIN_NAME_MAX: ::c_int = 73; | |
287 | pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 74; | |
288 | pub const _SC_THREAD_KEYS_MAX: ::c_int = 75; | |
289 | pub const _SC_THREAD_STACK_MIN: ::c_int = 76; | |
290 | pub const _SC_THREAD_THREADS_MAX: ::c_int = 77; | |
291 | pub const _SC_TTY_NAME_MAX: ::c_int = 78; | |
292 | pub const _SC_THREADS: ::c_int = 79; | |
293 | pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 80; | |
294 | pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 81; | |
295 | pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 82; | |
296 | pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 83; | |
297 | pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 84; | |
298 | pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 85; | |
041b39d2 | 299 | pub const _SC_NPROCESSORS_CONF: ::c_int = 96; |
476ff2be | 300 | pub const _SC_NPROCESSORS_ONLN: ::c_int = 97; |
041b39d2 XL |
301 | pub const _SC_PHYS_PAGES: ::c_int = 98; |
302 | pub const _SC_AVPHYS_PAGES: ::c_int = 99; | |
303 | pub const _SC_MONOTONIC_CLOCK: ::c_int = 100; | |
476ff2be SL |
304 | |
305 | pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; | |
306 | pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; | |
307 | pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; | |
308 | pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; | |
309 | ||
310 | pub const FIOCLEX: ::c_int = 0x5451; | |
311 | ||
312 | pub const SA_ONSTACK: ::c_ulong = 0x08000000; | |
313 | pub const SA_SIGINFO: ::c_ulong = 0x00000004; | |
314 | pub const SA_NOCLDWAIT: ::c_ulong = 0x00000002; | |
476ff2be SL |
315 | pub const SIGCHLD: ::c_int = 17; |
316 | pub const SIGBUS: ::c_int = 7; | |
317 | pub const SIGUSR1: ::c_int = 10; | |
318 | pub const SIGUSR2: ::c_int = 12; | |
319 | pub const SIGCONT: ::c_int = 18; | |
320 | pub const SIGSTOP: ::c_int = 19; | |
321 | pub const SIGTSTP: ::c_int = 20; | |
322 | pub const SIGURG: ::c_int = 23; | |
323 | pub const SIGIO: ::c_int = 29; | |
324 | pub const SIGSYS: ::c_int = 31; | |
325 | pub const SIGSTKFLT: ::c_int = 16; | |
326 | pub const SIGUNUSED: ::c_int = 31; | |
327 | pub const SIGTTIN: ::c_int = 21; | |
328 | pub const SIGTTOU: ::c_int = 22; | |
329 | pub const SIGXCPU: ::c_int = 24; | |
330 | pub const SIGXFSZ: ::c_int = 25; | |
331 | pub const SIGVTALRM: ::c_int = 26; | |
332 | pub const SIGPROF: ::c_int = 27; | |
333 | pub const SIGWINCH: ::c_int = 28; | |
334 | pub const SIGPOLL: ::c_int = 29; | |
335 | pub const SIGPWR: ::c_int = 30; | |
336 | pub const SIG_SETMASK: ::c_int = 2; | |
337 | pub const SIG_BLOCK: ::c_int = 0x000000; | |
338 | pub const SIG_UNBLOCK: ::c_int = 0x01; | |
339 | ||
340 | pub const RUSAGE_CHILDREN: ::c_int = -1; | |
341 | ||
342 | pub const LC_PAPER: ::c_int = 7; | |
343 | pub const LC_NAME: ::c_int = 8; | |
344 | pub const LC_ADDRESS: ::c_int = 9; | |
345 | pub const LC_TELEPHONE: ::c_int = 10; | |
346 | pub const LC_MEASUREMENT: ::c_int = 11; | |
347 | pub const LC_IDENTIFICATION: ::c_int = 12; | |
348 | pub const LC_PAPER_MASK: ::c_int = (1 << LC_PAPER); | |
349 | pub const LC_NAME_MASK: ::c_int = (1 << LC_NAME); | |
350 | pub const LC_ADDRESS_MASK: ::c_int = (1 << LC_ADDRESS); | |
351 | pub const LC_TELEPHONE_MASK: ::c_int = (1 << LC_TELEPHONE); | |
352 | pub const LC_MEASUREMENT_MASK: ::c_int = (1 << LC_MEASUREMENT); | |
353 | pub const LC_IDENTIFICATION_MASK: ::c_int = (1 << LC_IDENTIFICATION); | |
354 | pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK | |
355 | | ::LC_NUMERIC_MASK | |
356 | | ::LC_TIME_MASK | |
357 | | ::LC_COLLATE_MASK | |
358 | | ::LC_MONETARY_MASK | |
359 | | ::LC_MESSAGES_MASK | |
360 | | LC_PAPER_MASK | |
361 | | LC_NAME_MASK | |
362 | | LC_ADDRESS_MASK | |
363 | | LC_TELEPHONE_MASK | |
364 | | LC_MEASUREMENT_MASK | |
365 | | LC_IDENTIFICATION_MASK; | |
366 | ||
367 | pub const MAP_ANON: ::c_int = 0x0020; | |
368 | pub const MAP_ANONYMOUS: ::c_int = 0x0020; | |
369 | pub const MAP_GROWSDOWN: ::c_int = 0x0100; | |
370 | pub const MAP_DENYWRITE: ::c_int = 0x0800; | |
371 | pub const MAP_EXECUTABLE: ::c_int = 0x01000; | |
372 | pub const MAP_LOCKED: ::c_int = 0x02000; | |
373 | pub const MAP_NORESERVE: ::c_int = 0x04000; | |
374 | pub const MAP_POPULATE: ::c_int = 0x08000; | |
375 | pub const MAP_NONBLOCK: ::c_int = 0x010000; | |
376 | pub const MAP_STACK: ::c_int = 0x020000; | |
377 | ||
378 | pub const EDEADLK: ::c_int = 35; | |
379 | pub const ENAMETOOLONG: ::c_int = 36; | |
380 | pub const ENOLCK: ::c_int = 37; | |
381 | pub const ENOSYS: ::c_int = 38; | |
382 | pub const ENOTEMPTY: ::c_int = 39; | |
383 | pub const ELOOP: ::c_int = 40; | |
384 | pub const ENOMSG: ::c_int = 42; | |
385 | pub const EIDRM: ::c_int = 43; | |
386 | pub const ECHRNG: ::c_int = 44; | |
387 | pub const EL2NSYNC: ::c_int = 45; | |
388 | pub const EL3HLT: ::c_int = 46; | |
389 | pub const EL3RST: ::c_int = 47; | |
390 | pub const ELNRNG: ::c_int = 48; | |
391 | pub const EUNATCH: ::c_int = 49; | |
392 | pub const ENOCSI: ::c_int = 50; | |
393 | pub const EL2HLT: ::c_int = 51; | |
394 | pub const EBADE: ::c_int = 52; | |
395 | pub const EBADR: ::c_int = 53; | |
396 | pub const EXFULL: ::c_int = 54; | |
397 | pub const ENOANO: ::c_int = 55; | |
398 | pub const EBADRQC: ::c_int = 56; | |
399 | pub const EBADSLT: ::c_int = 57; | |
400 | ||
401 | pub const EMULTIHOP: ::c_int = 72; | |
402 | pub const EBADMSG: ::c_int = 74; | |
403 | pub const EOVERFLOW: ::c_int = 75; | |
404 | pub const ENOTUNIQ: ::c_int = 76; | |
405 | pub const EBADFD: ::c_int = 77; | |
406 | pub const EREMCHG: ::c_int = 78; | |
407 | pub const ELIBACC: ::c_int = 79; | |
408 | pub const ELIBBAD: ::c_int = 80; | |
409 | pub const ELIBSCN: ::c_int = 81; | |
410 | pub const ELIBMAX: ::c_int = 82; | |
411 | pub const ELIBEXEC: ::c_int = 83; | |
412 | pub const EILSEQ: ::c_int = 84; | |
413 | pub const ERESTART: ::c_int = 85; | |
414 | pub const ESTRPIPE: ::c_int = 86; | |
415 | pub const EUSERS: ::c_int = 87; | |
416 | pub const ENOTSOCK: ::c_int = 88; | |
417 | pub const EDESTADDRREQ: ::c_int = 89; | |
418 | pub const EMSGSIZE: ::c_int = 90; | |
419 | pub const EPROTOTYPE: ::c_int = 91; | |
420 | pub const ENOPROTOOPT: ::c_int = 92; | |
421 | pub const EPROTONOSUPPORT: ::c_int = 93; | |
422 | pub const ESOCKTNOSUPPORT: ::c_int = 94; | |
423 | pub const EOPNOTSUPP: ::c_int = 95; | |
8bb4bdeb | 424 | pub const ENOTSUP: ::c_int = EOPNOTSUPP; |
476ff2be SL |
425 | pub const EPFNOSUPPORT: ::c_int = 96; |
426 | pub const EAFNOSUPPORT: ::c_int = 97; | |
427 | pub const EADDRINUSE: ::c_int = 98; | |
428 | pub const EADDRNOTAVAIL: ::c_int = 99; | |
429 | pub const ENETDOWN: ::c_int = 100; | |
430 | pub const ENETUNREACH: ::c_int = 101; | |
431 | pub const ENETRESET: ::c_int = 102; | |
432 | pub const ECONNABORTED: ::c_int = 103; | |
433 | pub const ECONNRESET: ::c_int = 104; | |
434 | pub const ENOBUFS: ::c_int = 105; | |
435 | pub const EISCONN: ::c_int = 106; | |
436 | pub const ENOTCONN: ::c_int = 107; | |
437 | pub const ESHUTDOWN: ::c_int = 108; | |
438 | pub const ETOOMANYREFS: ::c_int = 109; | |
439 | pub const ETIMEDOUT: ::c_int = 110; | |
440 | pub const ECONNREFUSED: ::c_int = 111; | |
441 | pub const EHOSTDOWN: ::c_int = 112; | |
442 | pub const EHOSTUNREACH: ::c_int = 113; | |
443 | pub const EALREADY: ::c_int = 114; | |
444 | pub const EINPROGRESS: ::c_int = 115; | |
445 | pub const ESTALE: ::c_int = 116; | |
446 | pub const EUCLEAN: ::c_int = 117; | |
447 | pub const ENOTNAM: ::c_int = 118; | |
448 | pub const ENAVAIL: ::c_int = 119; | |
449 | pub const EISNAM: ::c_int = 120; | |
450 | pub const EREMOTEIO: ::c_int = 121; | |
451 | pub const EDQUOT: ::c_int = 122; | |
452 | pub const ENOMEDIUM: ::c_int = 123; | |
453 | pub const EMEDIUMTYPE: ::c_int = 124; | |
454 | pub const ECANCELED: ::c_int = 125; | |
455 | pub const ENOKEY: ::c_int = 126; | |
456 | pub const EKEYEXPIRED: ::c_int = 127; | |
457 | pub const EKEYREVOKED: ::c_int = 128; | |
458 | pub const EKEYREJECTED: ::c_int = 129; | |
459 | pub const EOWNERDEAD: ::c_int = 130; | |
460 | pub const ENOTRECOVERABLE: ::c_int = 131; | |
461 | ||
462 | pub const SOCK_STREAM: ::c_int = 1; | |
463 | pub const SOCK_DGRAM: ::c_int = 2; | |
464 | pub const SOCK_SEQPACKET: ::c_int = 5; | |
465 | ||
466 | pub const SOL_SOCKET: ::c_int = 1; | |
8bb4bdeb XL |
467 | pub const SOL_UDP: ::c_int = 17; |
468 | pub const SOL_SCTP: ::c_int = 132; | |
469 | pub const SOL_IPX: ::c_int = 256; | |
470 | pub const SOL_AX25: ::c_int = 257; | |
471 | pub const SOL_ATALK: ::c_int = 258; | |
472 | pub const SOL_NETROM: ::c_int = 259; | |
473 | pub const SOL_ROSE: ::c_int = 260; | |
474 | ||
475 | #[doc(hidden)] | |
041b39d2 | 476 | pub const AF_MAX: ::c_int = 43; |
8bb4bdeb XL |
477 | #[doc(hidden)] |
478 | pub const PF_MAX: ::c_int = AF_MAX; | |
476ff2be SL |
479 | |
480 | pub const SO_REUSEADDR: ::c_int = 2; | |
481 | pub const SO_TYPE: ::c_int = 3; | |
482 | pub const SO_ERROR: ::c_int = 4; | |
483 | pub const SO_DONTROUTE: ::c_int = 5; | |
484 | pub const SO_BROADCAST: ::c_int = 6; | |
485 | pub const SO_SNDBUF: ::c_int = 7; | |
486 | pub const SO_RCVBUF: ::c_int = 8; | |
487 | pub const SO_KEEPALIVE: ::c_int = 9; | |
488 | pub const SO_OOBINLINE: ::c_int = 10; | |
041b39d2 | 489 | pub const SO_PRIORITY: ::c_int = 12; |
476ff2be | 490 | pub const SO_LINGER: ::c_int = 13; |
041b39d2 | 491 | pub const SO_BSDCOMPAT: ::c_int = 14; |
476ff2be | 492 | pub const SO_REUSEPORT: ::c_int = 15; |
041b39d2 XL |
493 | pub const SO_PASSCRED: ::c_int = 16; |
494 | pub const SO_PEERCRED: ::c_int = 17; | |
476ff2be SL |
495 | pub const SO_RCVLOWAT: ::c_int = 18; |
496 | pub const SO_SNDLOWAT: ::c_int = 19; | |
497 | pub const SO_RCVTIMEO: ::c_int = 20; | |
498 | pub const SO_SNDTIMEO: ::c_int = 21; | |
041b39d2 XL |
499 | pub const SO_BINDTODEVICE: ::c_int = 25; |
500 | pub const SO_TIMESTAMP: ::c_int = 29; | |
476ff2be | 501 | pub const SO_ACCEPTCONN: ::c_int = 30; |
041b39d2 XL |
502 | pub const SO_SNDBUFFORCE: ::c_int = 32; |
503 | pub const SO_MARK: ::c_int = 36; | |
504 | pub const SO_PROTOCOL: ::c_int = 38; | |
505 | pub const SO_DOMAIN: ::c_int = 39; | |
506 | pub const SO_RXQ_OVFL: ::c_int = 40; | |
507 | pub const SO_PEEK_OFF: ::c_int = 42; | |
508 | pub const SO_BUSY_POLL: ::c_int = 46; | |
476ff2be SL |
509 | |
510 | pub const O_ACCMODE: ::c_int = 3; | |
511 | pub const O_APPEND: ::c_int = 1024; | |
512 | pub const O_CREAT: ::c_int = 64; | |
513 | pub const O_EXCL: ::c_int = 128; | |
514 | pub const O_NOCTTY: ::c_int = 256; | |
515 | pub const O_NONBLOCK: ::c_int = 2048; | |
516 | pub const O_SYNC: ::c_int = 0x101000; | |
476ff2be SL |
517 | pub const O_ASYNC: ::c_int = 0x2000; |
518 | pub const O_NDELAY: ::c_int = 0x800; | |
041b39d2 | 519 | pub const O_DSYNC: ::c_int = 4096; |
476ff2be SL |
520 | |
521 | pub const NI_MAXHOST: ::size_t = 1025; | |
522 | ||
523 | pub const NCCS: usize = 19; | |
524 | pub const TCSBRKP: ::c_int = 0x5425; | |
525 | pub const TCSANOW: ::c_int = 0; | |
526 | pub const TCSADRAIN: ::c_int = 0x1; | |
527 | pub const TCSAFLUSH: ::c_int = 0x2; | |
476ff2be SL |
528 | pub const VEOF: usize = 4; |
529 | pub const VEOL: usize = 11; | |
530 | pub const VEOL2: usize = 16; | |
531 | pub const VMIN: usize = 6; | |
532 | pub const IEXTEN: ::tcflag_t = 0x00008000; | |
533 | pub const TOSTOP: ::tcflag_t = 0x00000100; | |
534 | pub const FLUSHO: ::tcflag_t = 0x00001000; | |
041b39d2 | 535 | pub const EXTPROC: ::tcflag_t = 0o200000; |
476ff2be SL |
536 | |
537 | pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5; | |
538 | pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff; | |
539 | pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245; | |
540 | pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45; | |
541 | pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53; | |
542 | pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53; | |
543 | pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53; | |
544 | pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53; | |
545 | pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849; | |
546 | pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6; | |
547 | pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660; | |
548 | pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6; | |
549 | pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f; | |
550 | pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f; | |
551 | pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468; | |
552 | pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478; | |
553 | pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44; | |
554 | pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c; | |
555 | pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969; | |
556 | pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1; | |
557 | pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0; | |
558 | pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f; | |
559 | pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973; | |
560 | pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b; | |
561 | pub const TMPFS_MAGIC: ::c_long = 0x01021994; | |
562 | pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2; | |
563 | ||
564 | pub const MADV_HUGEPAGE: ::c_int = 14; | |
565 | pub const MADV_NOHUGEPAGE: ::c_int = 15; | |
566 | pub const MAP_HUGETLB: ::c_int = 0x040000; | |
567 | ||
568 | pub const PTRACE_TRACEME: ::c_int = 0; | |
569 | pub const PTRACE_PEEKTEXT: ::c_int = 1; | |
570 | pub const PTRACE_PEEKDATA: ::c_int = 2; | |
571 | pub const PTRACE_PEEKUSER: ::c_int = 3; | |
572 | pub const PTRACE_POKETEXT: ::c_int = 4; | |
573 | pub const PTRACE_POKEDATA: ::c_int = 5; | |
574 | pub const PTRACE_POKEUSER: ::c_int = 6; | |
575 | pub const PTRACE_CONT: ::c_int = 7; | |
576 | pub const PTRACE_KILL: ::c_int = 8; | |
577 | pub const PTRACE_SINGLESTEP: ::c_int = 9; | |
578 | pub const PTRACE_ATTACH: ::c_int = 16; | |
579 | pub const PTRACE_DETACH: ::c_int = 17; | |
580 | pub const PTRACE_SYSCALL: ::c_int = 24; | |
581 | pub const PTRACE_SETOPTIONS: ::c_int = 0x4200; | |
582 | pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201; | |
583 | pub const PTRACE_GETSIGINFO: ::c_int = 0x4202; | |
584 | pub const PTRACE_SETSIGINFO: ::c_int = 0x4203; | |
476ff2be SL |
585 | |
586 | pub const EFD_NONBLOCK: ::c_int = 0x800; | |
587 | ||
588 | pub const F_GETLK: ::c_int = 5; | |
589 | pub const F_GETOWN: ::c_int = 9; | |
590 | pub const F_SETOWN: ::c_int = 8; | |
591 | pub const F_SETLK: ::c_int = 6; | |
592 | pub const F_SETLKW: ::c_int = 7; | |
593 | ||
594 | pub const TCGETS: ::c_int = 0x5401; | |
595 | pub const TCSETS: ::c_int = 0x5402; | |
596 | pub const TCSETSW: ::c_int = 0x5403; | |
597 | pub const TCSETSF: ::c_int = 0x5404; | |
598 | pub const TCGETA: ::c_int = 0x5405; | |
599 | pub const TCSETA: ::c_int = 0x5406; | |
600 | pub const TCSETAW: ::c_int = 0x5407; | |
601 | pub const TCSETAF: ::c_int = 0x5408; | |
602 | pub const TCSBRK: ::c_int = 0x5409; | |
603 | pub const TCXONC: ::c_int = 0x540A; | |
604 | pub const TCFLSH: ::c_int = 0x540B; | |
605 | pub const TIOCGSOFTCAR: ::c_int = 0x5419; | |
606 | pub const TIOCSSOFTCAR: ::c_int = 0x541A; | |
607 | pub const TIOCINQ: ::c_int = 0x541B; | |
608 | pub const TIOCLINUX: ::c_int = 0x541C; | |
609 | pub const TIOCGSERIAL: ::c_int = 0x541E; | |
610 | pub const TIOCEXCL: ::c_int = 0x540C; | |
611 | pub const TIOCNXCL: ::c_int = 0x540D; | |
612 | pub const TIOCSCTTY: ::c_int = 0x540E; | |
613 | pub const TIOCGPGRP: ::c_int = 0x540F; | |
614 | pub const TIOCSPGRP: ::c_int = 0x5410; | |
615 | pub const TIOCOUTQ: ::c_int = 0x5411; | |
616 | pub const TIOCSTI: ::c_int = 0x5412; | |
617 | pub const TIOCGWINSZ: ::c_int = 0x5413; | |
618 | pub const TIOCSWINSZ: ::c_int = 0x5414; | |
619 | pub const TIOCMGET: ::c_int = 0x5415; | |
620 | pub const TIOCMBIS: ::c_int = 0x5416; | |
621 | pub const TIOCMBIC: ::c_int = 0x5417; | |
622 | pub const TIOCMSET: ::c_int = 0x5418; | |
623 | pub const FIONREAD: ::c_int = 0x541B; | |
624 | pub const TIOCCONS: ::c_int = 0x541D; | |
625 | ||
476ff2be | 626 | pub const RTLD_NOLOAD: ::c_int = 0x4; |
476ff2be SL |
627 | |
628 | pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; | |
629 | ||
630 | pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead; | |
631 | pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793; | |
632 | pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278; | |
633 | pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448; | |
634 | pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216; | |
635 | ||
636 | pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567; | |
637 | pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123; | |
638 | pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF; | |
639 | pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000; | |
640 | pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC; | |
641 | pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4; | |
642 | pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2; | |
643 | pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543; | |
644 | ||
645 | pub const MCL_CURRENT: ::c_int = 0x0001; | |
646 | pub const MCL_FUTURE: ::c_int = 0x0002; | |
647 | ||
476ff2be SL |
648 | pub const CBAUD: ::tcflag_t = 0o0010017; |
649 | pub const TAB1: ::c_int = 0x00000800; | |
650 | pub const TAB2: ::c_int = 0x00001000; | |
651 | pub const TAB3: ::c_int = 0x00001800; | |
652 | pub const CR1: ::c_int = 0x00000200; | |
653 | pub const CR2: ::c_int = 0x00000400; | |
654 | pub const CR3: ::c_int = 0x00000600; | |
655 | pub const FF1: ::c_int = 0x00008000; | |
656 | pub const BS1: ::c_int = 0x00002000; | |
657 | pub const VT1: ::c_int = 0x00004000; | |
658 | pub const VWERASE: usize = 14; | |
659 | pub const VREPRINT: usize = 12; | |
660 | pub const VSUSP: usize = 10; | |
661 | pub const VSTART: usize = 8; | |
662 | pub const VSTOP: usize = 9; | |
663 | pub const VDISCARD: usize = 13; | |
664 | pub const VTIME: usize = 5; | |
665 | pub const IXON: ::tcflag_t = 0x00000400; | |
666 | pub const IXOFF: ::tcflag_t = 0x00001000; | |
667 | pub const ONLCR: ::tcflag_t = 0x4; | |
668 | pub const CSIZE: ::tcflag_t = 0x00000030; | |
669 | pub const CS6: ::tcflag_t = 0x00000010; | |
670 | pub const CS7: ::tcflag_t = 0x00000020; | |
671 | pub const CS8: ::tcflag_t = 0x00000030; | |
672 | pub const CSTOPB: ::tcflag_t = 0x00000040; | |
673 | pub const CREAD: ::tcflag_t = 0x00000080; | |
674 | pub const PARENB: ::tcflag_t = 0x00000100; | |
675 | pub const PARODD: ::tcflag_t = 0x00000200; | |
676 | pub const HUPCL: ::tcflag_t = 0x00000400; | |
677 | pub const CLOCAL: ::tcflag_t = 0x00000800; | |
678 | pub const ECHOKE: ::tcflag_t = 0x00000800; | |
679 | pub const ECHOE: ::tcflag_t = 0x00000010; | |
680 | pub const ECHOK: ::tcflag_t = 0x00000020; | |
681 | pub const ECHONL: ::tcflag_t = 0x00000040; | |
682 | pub const ECHOPRT: ::tcflag_t = 0x00000400; | |
683 | pub const ECHOCTL: ::tcflag_t = 0x00000200; | |
684 | pub const ISIG: ::tcflag_t = 0x00000001; | |
685 | pub const ICANON: ::tcflag_t = 0x00000002; | |
686 | pub const PENDIN: ::tcflag_t = 0x00004000; | |
687 | pub const NOFLSH: ::tcflag_t = 0x00000080; | |
041b39d2 XL |
688 | pub const VSWTC: usize = 7; |
689 | pub const OLCUC: ::tcflag_t = 0o000002; | |
690 | pub const NLDLY: ::tcflag_t = 0o000400; | |
691 | pub const CRDLY: ::tcflag_t = 0o003000; | |
692 | pub const TABDLY: ::tcflag_t = 0o014000; | |
693 | pub const BSDLY: ::tcflag_t = 0o020000; | |
694 | pub const FFDLY: ::tcflag_t = 0o100000; | |
695 | pub const VTDLY: ::tcflag_t = 0o040000; | |
696 | pub const XTABS: ::tcflag_t = 0o014000; | |
476ff2be | 697 | |
8bb4bdeb XL |
698 | pub const B0: ::speed_t = 0o000000; |
699 | pub const B50: ::speed_t = 0o000001; | |
700 | pub const B75: ::speed_t = 0o000002; | |
701 | pub const B110: ::speed_t = 0o000003; | |
702 | pub const B134: ::speed_t = 0o000004; | |
703 | pub const B150: ::speed_t = 0o000005; | |
704 | pub const B200: ::speed_t = 0o000006; | |
705 | pub const B300: ::speed_t = 0o000007; | |
706 | pub const B600: ::speed_t = 0o000010; | |
707 | pub const B1200: ::speed_t = 0o000011; | |
708 | pub const B1800: ::speed_t = 0o000012; | |
709 | pub const B2400: ::speed_t = 0o000013; | |
710 | pub const B4800: ::speed_t = 0o000014; | |
711 | pub const B9600: ::speed_t = 0o000015; | |
712 | pub const B19200: ::speed_t = 0o000016; | |
713 | pub const B38400: ::speed_t = 0o000017; | |
714 | pub const EXTA: ::speed_t = B19200; | |
715 | pub const EXTB: ::speed_t = B38400; | |
716 | pub const B57600: ::speed_t = 0o010001; | |
717 | pub const B115200: ::speed_t = 0o010002; | |
718 | pub const B230400: ::speed_t = 0o010003; | |
719 | pub const B460800: ::speed_t = 0o010004; | |
720 | pub const B500000: ::speed_t = 0o010005; | |
721 | pub const B576000: ::speed_t = 0o010006; | |
722 | pub const B921600: ::speed_t = 0o010007; | |
723 | pub const B1000000: ::speed_t = 0o010010; | |
724 | pub const B1152000: ::speed_t = 0o010011; | |
725 | pub const B1500000: ::speed_t = 0o010012; | |
726 | pub const B2000000: ::speed_t = 0o010013; | |
727 | pub const B2500000: ::speed_t = 0o010014; | |
728 | pub const B3000000: ::speed_t = 0o010015; | |
729 | pub const B3500000: ::speed_t = 0o010016; | |
730 | pub const B4000000: ::speed_t = 0o010017; | |
731 | ||
476ff2be SL |
732 | pub const EAI_SYSTEM: ::c_int = 11; |
733 | ||
734 | pub const NETLINK_ROUTE: ::c_int = 0; | |
735 | pub const NETLINK_UNUSED: ::c_int = 1; | |
736 | pub const NETLINK_USERSOCK: ::c_int = 2; | |
737 | pub const NETLINK_FIREWALL: ::c_int = 3; | |
738 | pub const NETLINK_SOCK_DIAG: ::c_int = 4; | |
739 | pub const NETLINK_NFLOG: ::c_int = 5; | |
740 | pub const NETLINK_XFRM: ::c_int = 6; | |
741 | pub const NETLINK_SELINUX: ::c_int = 7; | |
742 | pub const NETLINK_ISCSI: ::c_int = 8; | |
743 | pub const NETLINK_AUDIT: ::c_int = 9; | |
744 | pub const NETLINK_FIB_LOOKUP: ::c_int = 10; | |
745 | pub const NETLINK_CONNECTOR: ::c_int = 11; | |
746 | pub const NETLINK_NETFILTER: ::c_int = 12; | |
747 | pub const NETLINK_IP6_FW: ::c_int = 13; | |
748 | pub const NETLINK_DNRTMSG: ::c_int = 14; | |
749 | pub const NETLINK_KOBJECT_UEVENT: ::c_int = 15; | |
750 | pub const NETLINK_GENERIC: ::c_int = 16; | |
751 | pub const NETLINK_SCSITRANSPORT: ::c_int = 18; | |
752 | pub const NETLINK_ECRYPTFS: ::c_int = 19; | |
753 | pub const NETLINK_RDMA: ::c_int = 20; | |
754 | pub const NETLINK_CRYPTO: ::c_int = 21; | |
755 | pub const NETLINK_INET_DIAG: ::c_int = NETLINK_SOCK_DIAG; | |
756 | ||
757 | pub const MAX_LINKS: ::c_int = 32; | |
758 | ||
759 | pub const NLM_F_REQUEST: ::c_int = 1; | |
760 | pub const NLM_F_MULTI: ::c_int = 2; | |
761 | pub const NLM_F_ACK: ::c_int = 4; | |
762 | pub const NLM_F_ECHO: ::c_int = 8; | |
763 | pub const NLM_F_DUMP_INTR: ::c_int = 16; | |
764 | ||
765 | pub const NLM_F_ROOT: ::c_int = 0x100; | |
766 | pub const NLM_F_MATCH: ::c_int = 0x200; | |
767 | pub const NLM_F_ATOMIC: ::c_int = 0x400; | |
768 | pub const NLM_F_DUMP: ::c_int = NLM_F_ROOT | NLM_F_MATCH; | |
769 | ||
770 | pub const NLM_F_REPLACE: ::c_int = 0x100; | |
771 | pub const NLM_F_EXCL: ::c_int = 0x200; | |
772 | pub const NLM_F_CREATE: ::c_int = 0x400; | |
773 | pub const NLM_F_APPEND: ::c_int = 0x800; | |
774 | ||
775 | pub const NLMSG_NOOP: ::c_int = 0x1; | |
776 | pub const NLMSG_ERROR: ::c_int = 0x2; | |
777 | pub const NLMSG_DONE: ::c_int = 0x3; | |
778 | pub const NLMSG_OVERRUN: ::c_int = 0x4; | |
779 | pub const NLMSG_MIN_TYPE: ::c_int = 0x10; | |
780 | ||
781 | pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1; | |
782 | pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2; | |
783 | pub const NETLINK_PKTINFO: ::c_int = 3; | |
784 | pub const NETLINK_BROADCAST_ERROR: ::c_int = 4; | |
785 | pub const NETLINK_NO_ENOBUFS: ::c_int = 5; | |
786 | pub const NETLINK_RX_RING: ::c_int = 6; | |
787 | pub const NETLINK_TX_RING: ::c_int = 7; | |
788 | ||
789 | pub const NLA_F_NESTED: ::c_int = 1 << 15; | |
790 | pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14; | |
791 | pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER); | |
792 | ||
8bb4bdeb | 793 | pub const SIGEV_THREAD_ID: ::c_int = 4; |
476ff2be | 794 | |
041b39d2 XL |
795 | pub const CMSPAR: ::tcflag_t = 0o10000000000; |
796 | pub const CIBAUD: ::tcflag_t = 0o02003600000; | |
797 | pub const CBAUDEX: ::tcflag_t = 0o010000; | |
798 | ||
799 | pub const TIOCM_LE: ::c_int = 0x001; | |
800 | pub const TIOCM_DTR: ::c_int = 0x002; | |
801 | pub const TIOCM_RTS: ::c_int = 0x004; | |
802 | pub const TIOCM_ST: ::c_int = 0x008; | |
803 | pub const TIOCM_SR: ::c_int = 0x010; | |
804 | pub const TIOCM_CTS: ::c_int = 0x020; | |
805 | pub const TIOCM_CAR: ::c_int = 0x040; | |
806 | pub const TIOCM_RNG: ::c_int = 0x080; | |
807 | pub const TIOCM_DSR: ::c_int = 0x100; | |
808 | pub const TIOCM_CD: ::c_int = TIOCM_CAR; | |
809 | pub const TIOCM_RI: ::c_int = TIOCM_RNG; | |
810 | ||
8bb4bdeb | 811 | f! { |
476ff2be SL |
812 | pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { |
813 | for slot in cpuset.__bits.iter_mut() { | |
814 | *slot = 0; | |
815 | } | |
816 | } | |
817 | ||
818 | pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { | |
819 | let size_in___bits = 8 * mem::size_of_val(&cpuset.__bits[0]); | |
820 | let (idx, offset) = (cpu / size_in___bits, cpu % size_in___bits); | |
821 | cpuset.__bits[idx] |= 1 << offset; | |
822 | () | |
823 | } | |
824 | ||
825 | pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { | |
826 | let size_in___bits = 8 * mem::size_of_val(&cpuset.__bits[0]); | |
827 | let (idx, offset) = (cpu / size_in___bits, cpu % size_in___bits); | |
828 | cpuset.__bits[idx] &= !(1 << offset); | |
829 | () | |
830 | } | |
831 | ||
832 | pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { | |
833 | let size_in___bits = 8 * mem::size_of_val(&cpuset.__bits[0]); | |
834 | let (idx, offset) = (cpu / size_in___bits, cpu % size_in___bits); | |
835 | 0 != (cpuset.__bits[idx] & (1 << offset)) | |
836 | } | |
837 | ||
838 | pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { | |
839 | set1.__bits == set2.__bits | |
840 | } | |
041b39d2 XL |
841 | pub fn major(dev: ::dev_t) -> ::c_int { |
842 | ((dev >> 8) & 0xfff) as ::c_int | |
843 | } | |
844 | pub fn minor(dev: ::dev_t) -> ::c_int { | |
845 | ((dev & 0xff) | ((dev >> 12) & 0xfff00)) as ::c_int | |
846 | } | |
847 | pub fn makedev(ma: ::c_int, mi: ::c_int) -> ::dev_t { | |
848 | let ma = ma as ::dev_t; | |
849 | let mi = mi as ::dev_t; | |
850 | ((ma & 0xfff) << 8) | (mi & 0xff) | ((mi & 0xfff00) << 12) | |
851 | } | |
476ff2be SL |
852 | } |
853 | ||
854 | extern { | |
855 | static mut __progname: *mut ::c_char; | |
856 | } | |
857 | ||
858 | extern { | |
859 | pub fn madvise(addr: *const ::c_void, len: ::size_t, advice: ::c_int) | |
860 | -> ::c_int; | |
861 | pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; | |
476ff2be SL |
862 | pub fn msync(addr: *const ::c_void, len: ::size_t, |
863 | flags: ::c_int) -> ::c_int; | |
864 | pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) | |
865 | -> ::c_int; | |
476ff2be SL |
866 | pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, |
867 | flags: ::c_int, addr: *const ::sockaddr, | |
868 | addrlen: *mut ::socklen_t) -> ::ssize_t; | |
869 | pub fn getnameinfo(sa: *const ::sockaddr, | |
870 | salen: ::socklen_t, | |
871 | host: *mut ::c_char, | |
872 | hostlen: ::size_t, | |
873 | serv: *mut ::c_char, | |
874 | sevlen: ::size_t, | |
875 | flags: ::c_int) -> ::c_int; | |
876 | pub fn ptrace(request: ::c_int, ...) -> ::c_long; | |
877 | pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int; | |
878 | pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int; | |
879 | pub fn __sched_cpualloc(count: ::size_t) -> *mut ::cpu_set_t; | |
880 | pub fn __sched_cpufree(set: *mut ::cpu_set_t); | |
881 | pub fn __sched_cpucount(setsize: ::size_t, set: *mut cpu_set_t) -> ::c_int; | |
882 | pub fn sched_getcpu() -> ::c_int; | |
883 | ||
884 | pub fn utmpname(name: *const ::c_char) -> ::c_int; | |
885 | pub fn setutent(); | |
886 | pub fn getutent() -> *mut utmp; | |
8bb4bdeb XL |
887 | |
888 | pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, | |
889 | len: ::off_t) -> ::c_int; | |
476ff2be SL |
890 | } |
891 | ||
892 | cfg_if! { | |
893 | if #[cfg(target_pointer_width = "32")] { | |
894 | mod b32; | |
895 | pub use self::b32::*; | |
896 | } else if #[cfg(target_pointer_width = "64")] { | |
897 | mod b64; | |
898 | pub use self::b64::*; | |
899 | } else { | |
900 | // Unknown target_pointer_width | |
901 | } | |
902 | } |