]> git.proxmox.com Git - rustc.git/blob - src/vendor/libc/src/unix/notbsd/linux/other/mod.rs
b100cec54ba00a0b007b372d757e6230e8407386
[rustc.git] / src / vendor / libc / src / unix / notbsd / linux / other / mod.rs
1 pub type fsblkcnt_t = ::c_ulong;
2 pub type fsfilcnt_t = ::c_ulong;
3 pub type rlim_t = c_ulong;
4 pub type __priority_which_t = ::c_uint;
5
6 s! {
7 pub struct __exit_status {
8 pub e_termination: ::c_short,
9 pub e_exit: ::c_short,
10 }
11
12 pub struct __timeval {
13 pub tv_sec: ::int32_t,
14 pub tv_usec: ::int32_t,
15 }
16
17 pub struct utmpx {
18 pub ut_type: ::c_short,
19 pub ut_pid: ::pid_t,
20 pub ut_line: [::c_char; __UT_LINESIZE],
21 pub ut_id: [::c_char; 4],
22
23 pub ut_user: [::c_char; __UT_NAMESIZE],
24 pub ut_host: [::c_char; __UT_HOSTSIZE],
25 pub ut_exit: __exit_status,
26
27 #[cfg(any(target_arch = "aarch64", target_pointer_width = "32"))]
28 pub ut_session: ::c_long,
29 #[cfg(any(target_arch = "aarch64", target_pointer_width = "32"))]
30 pub ut_tv: ::timeval,
31
32 #[cfg(not(any(target_arch = "aarch64", target_pointer_width = "32")))]
33 pub ut_session: ::int32_t,
34 #[cfg(not(any(target_arch = "aarch64", target_pointer_width = "32")))]
35 pub ut_tv: __timeval,
36
37 pub ut_addr_v6: [::int32_t; 4],
38 __glibc_reserved: [::c_char; 20],
39 }
40
41 pub struct sigaction {
42 pub sa_sigaction: ::sighandler_t,
43 pub sa_mask: ::sigset_t,
44 pub sa_flags: ::c_int,
45 _restorer: *mut ::c_void,
46 }
47
48 pub struct stack_t {
49 pub ss_sp: *mut ::c_void,
50 pub ss_flags: ::c_int,
51 pub ss_size: ::size_t
52 }
53
54 pub struct siginfo_t {
55 pub si_signo: ::c_int,
56 pub si_errno: ::c_int,
57 pub si_code: ::c_int,
58 pub _pad: [::c_int; 29],
59 _align: [usize; 0],
60 }
61
62 pub struct glob64_t {
63 pub gl_pathc: ::size_t,
64 pub gl_pathv: *mut *mut ::c_char,
65 pub gl_offs: ::size_t,
66 pub gl_flags: ::c_int,
67
68 __unused1: *mut ::c_void,
69 __unused2: *mut ::c_void,
70 __unused3: *mut ::c_void,
71 __unused4: *mut ::c_void,
72 __unused5: *mut ::c_void,
73 }
74
75 pub struct ucred {
76 pub pid: ::pid_t,
77 pub uid: ::uid_t,
78 pub gid: ::gid_t,
79 }
80
81 pub struct statfs {
82 pub f_type: __fsword_t,
83 pub f_bsize: __fsword_t,
84 pub f_blocks: ::fsblkcnt_t,
85 pub f_bfree: ::fsblkcnt_t,
86 pub f_bavail: ::fsblkcnt_t,
87
88 pub f_files: ::fsfilcnt_t,
89 pub f_ffree: ::fsfilcnt_t,
90 pub f_fsid: ::fsid_t,
91
92 pub f_namelen: __fsword_t,
93 pub f_frsize: __fsword_t,
94 f_spare: [__fsword_t; 5],
95 }
96
97 pub struct msghdr {
98 pub msg_name: *mut ::c_void,
99 pub msg_namelen: ::socklen_t,
100 pub msg_iov: *mut ::iovec,
101 pub msg_iovlen: ::size_t,
102 pub msg_control: *mut ::c_void,
103 pub msg_controllen: ::size_t,
104 pub msg_flags: ::c_int,
105 }
106
107 pub struct termios {
108 pub c_iflag: ::tcflag_t,
109 pub c_oflag: ::tcflag_t,
110 pub c_cflag: ::tcflag_t,
111 pub c_lflag: ::tcflag_t,
112 pub c_line: ::cc_t,
113 pub c_cc: [::cc_t; ::NCCS],
114 pub c_ispeed: ::speed_t,
115 pub c_ospeed: ::speed_t,
116 }
117
118 pub struct flock {
119 pub l_type: ::c_short,
120 pub l_whence: ::c_short,
121 pub l_start: ::off_t,
122 pub l_len: ::off_t,
123 pub l_pid: ::pid_t,
124 }
125
126 // FIXME this is actually a union
127 pub struct sem_t {
128 #[cfg(target_pointer_width = "32")]
129 __size: [::c_char; 16],
130 #[cfg(target_pointer_width = "64")]
131 __size: [::c_char; 32],
132 __align: [::c_long; 0],
133 }
134 }
135
136 pub const __UT_LINESIZE: usize = 32;
137 pub const __UT_NAMESIZE: usize = 32;
138 pub const __UT_HOSTSIZE: usize = 256;
139 pub const EMPTY: ::c_short = 0;
140 pub const RUN_LVL: ::c_short = 1;
141 pub const BOOT_TIME: ::c_short = 2;
142 pub const NEW_TIME: ::c_short = 3;
143 pub const OLD_TIME: ::c_short = 4;
144 pub const INIT_PROCESS: ::c_short = 5;
145 pub const LOGIN_PROCESS: ::c_short = 6;
146 pub const USER_PROCESS: ::c_short = 7;
147 pub const DEAD_PROCESS: ::c_short = 8;
148 pub const ACCOUNTING: ::c_short = 9;
149
150 pub const RLIMIT_RSS: ::c_int = 5;
151 pub const RLIMIT_NOFILE: ::c_int = 7;
152 pub const RLIMIT_AS: ::c_int = 9;
153 pub const RLIMIT_NPROC: ::c_int = 6;
154 pub const RLIMIT_MEMLOCK: ::c_int = 8;
155 pub const RLIM_INFINITY: ::rlim_t = !0;
156 pub const RLIMIT_RTTIME: ::c_int = 15;
157 pub const RLIMIT_NLIMITS: ::c_int = 16;
158
159 pub const O_APPEND: ::c_int = 1024;
160 pub const O_CREAT: ::c_int = 64;
161 pub const O_EXCL: ::c_int = 128;
162 pub const O_NOCTTY: ::c_int = 256;
163 pub const O_NONBLOCK: ::c_int = 2048;
164 pub const O_SYNC: ::c_int = 1052672;
165 pub const O_RSYNC: ::c_int = 1052672;
166 pub const O_DSYNC: ::c_int = 4096;
167 pub const O_FSYNC: ::c_int = 0x101000;
168
169 pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
170
171 pub const LC_PAPER: ::c_int = 7;
172 pub const LC_NAME: ::c_int = 8;
173 pub const LC_ADDRESS: ::c_int = 9;
174 pub const LC_TELEPHONE: ::c_int = 10;
175 pub const LC_MEASUREMENT: ::c_int = 11;
176 pub const LC_IDENTIFICATION: ::c_int = 12;
177 pub const LC_PAPER_MASK: ::c_int = (1 << LC_PAPER);
178 pub const LC_NAME_MASK: ::c_int = (1 << LC_NAME);
179 pub const LC_ADDRESS_MASK: ::c_int = (1 << LC_ADDRESS);
180 pub const LC_TELEPHONE_MASK: ::c_int = (1 << LC_TELEPHONE);
181 pub const LC_MEASUREMENT_MASK: ::c_int = (1 << LC_MEASUREMENT);
182 pub const LC_IDENTIFICATION_MASK: ::c_int = (1 << LC_IDENTIFICATION);
183 pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK
184 | ::LC_NUMERIC_MASK
185 | ::LC_TIME_MASK
186 | ::LC_COLLATE_MASK
187 | ::LC_MONETARY_MASK
188 | ::LC_MESSAGES_MASK
189 | LC_PAPER_MASK
190 | LC_NAME_MASK
191 | LC_ADDRESS_MASK
192 | LC_TELEPHONE_MASK
193 | LC_MEASUREMENT_MASK
194 | LC_IDENTIFICATION_MASK;
195
196 pub const MAP_ANON: ::c_int = 0x0020;
197 pub const MAP_ANONYMOUS: ::c_int = 0x0020;
198 pub const MAP_GROWSDOWN: ::c_int = 0x0100;
199 pub const MAP_DENYWRITE: ::c_int = 0x0800;
200 pub const MAP_EXECUTABLE: ::c_int = 0x01000;
201 pub const MAP_POPULATE: ::c_int = 0x08000;
202 pub const MAP_NONBLOCK: ::c_int = 0x010000;
203 pub const MAP_STACK: ::c_int = 0x020000;
204
205 pub const EDEADLK: ::c_int = 35;
206 pub const ENAMETOOLONG: ::c_int = 36;
207 pub const ENOLCK: ::c_int = 37;
208 pub const ENOSYS: ::c_int = 38;
209 pub const ENOTEMPTY: ::c_int = 39;
210 pub const ELOOP: ::c_int = 40;
211 pub const ENOMSG: ::c_int = 42;
212 pub const EIDRM: ::c_int = 43;
213 pub const ECHRNG: ::c_int = 44;
214 pub const EL2NSYNC: ::c_int = 45;
215 pub const EL3HLT: ::c_int = 46;
216 pub const EL3RST: ::c_int = 47;
217 pub const ELNRNG: ::c_int = 48;
218 pub const EUNATCH: ::c_int = 49;
219 pub const ENOCSI: ::c_int = 50;
220 pub const EL2HLT: ::c_int = 51;
221 pub const EBADE: ::c_int = 52;
222 pub const EBADR: ::c_int = 53;
223 pub const EXFULL: ::c_int = 54;
224 pub const ENOANO: ::c_int = 55;
225 pub const EBADRQC: ::c_int = 56;
226 pub const EBADSLT: ::c_int = 57;
227 pub const EMULTIHOP: ::c_int = 72;
228 pub const EOVERFLOW: ::c_int = 75;
229 pub const ENOTUNIQ: ::c_int = 76;
230 pub const EBADFD: ::c_int = 77;
231 pub const EBADMSG: ::c_int = 74;
232 pub const EREMCHG: ::c_int = 78;
233 pub const ELIBACC: ::c_int = 79;
234 pub const ELIBBAD: ::c_int = 80;
235 pub const ELIBSCN: ::c_int = 81;
236 pub const ELIBMAX: ::c_int = 82;
237 pub const ELIBEXEC: ::c_int = 83;
238 pub const EILSEQ: ::c_int = 84;
239 pub const ERESTART: ::c_int = 85;
240 pub const ESTRPIPE: ::c_int = 86;
241 pub const EUSERS: ::c_int = 87;
242 pub const ENOTSOCK: ::c_int = 88;
243 pub const EDESTADDRREQ: ::c_int = 89;
244 pub const EMSGSIZE: ::c_int = 90;
245 pub const EPROTOTYPE: ::c_int = 91;
246 pub const ENOPROTOOPT: ::c_int = 92;
247 pub const EPROTONOSUPPORT: ::c_int = 93;
248 pub const ESOCKTNOSUPPORT: ::c_int = 94;
249 pub const EOPNOTSUPP: ::c_int = 95;
250 pub const EPFNOSUPPORT: ::c_int = 96;
251 pub const EAFNOSUPPORT: ::c_int = 97;
252 pub const EADDRINUSE: ::c_int = 98;
253 pub const EADDRNOTAVAIL: ::c_int = 99;
254 pub const ENETDOWN: ::c_int = 100;
255 pub const ENETUNREACH: ::c_int = 101;
256 pub const ENETRESET: ::c_int = 102;
257 pub const ECONNABORTED: ::c_int = 103;
258 pub const ECONNRESET: ::c_int = 104;
259 pub const ENOBUFS: ::c_int = 105;
260 pub const EISCONN: ::c_int = 106;
261 pub const ENOTCONN: ::c_int = 107;
262 pub const ESHUTDOWN: ::c_int = 108;
263 pub const ETOOMANYREFS: ::c_int = 109;
264 pub const ETIMEDOUT: ::c_int = 110;
265 pub const ECONNREFUSED: ::c_int = 111;
266 pub const EHOSTDOWN: ::c_int = 112;
267 pub const EHOSTUNREACH: ::c_int = 113;
268 pub const EALREADY: ::c_int = 114;
269 pub const EINPROGRESS: ::c_int = 115;
270 pub const ESTALE: ::c_int = 116;
271 pub const EUCLEAN: ::c_int = 117;
272 pub const ENOTNAM: ::c_int = 118;
273 pub const ENAVAIL: ::c_int = 119;
274 pub const EISNAM: ::c_int = 120;
275 pub const EREMOTEIO: ::c_int = 121;
276 pub const EDQUOT: ::c_int = 122;
277 pub const ENOMEDIUM: ::c_int = 123;
278 pub const EMEDIUMTYPE: ::c_int = 124;
279 pub const ECANCELED: ::c_int = 125;
280 pub const ENOKEY: ::c_int = 126;
281 pub const EKEYEXPIRED: ::c_int = 127;
282 pub const EKEYREVOKED: ::c_int = 128;
283 pub const EKEYREJECTED: ::c_int = 129;
284 pub const EOWNERDEAD: ::c_int = 130;
285 pub const ENOTRECOVERABLE: ::c_int = 131;
286 pub const EHWPOISON: ::c_int = 133;
287 pub const ERFKILL: ::c_int = 132;
288
289 pub const SOCK_STREAM: ::c_int = 1;
290 pub const SOCK_DGRAM: ::c_int = 2;
291 pub const SOCK_SEQPACKET: ::c_int = 5;
292
293 pub const SOL_SOCKET: ::c_int = 1;
294
295 pub const SO_REUSEADDR: ::c_int = 2;
296 pub const SO_TYPE: ::c_int = 3;
297 pub const SO_ERROR: ::c_int = 4;
298 pub const SO_DONTROUTE: ::c_int = 5;
299 pub const SO_BROADCAST: ::c_int = 6;
300 pub const SO_SNDBUF: ::c_int = 7;
301 pub const SO_RCVBUF: ::c_int = 8;
302 pub const SO_KEEPALIVE: ::c_int = 9;
303 pub const SO_OOBINLINE: ::c_int = 10;
304 pub const SO_LINGER: ::c_int = 13;
305 pub const SO_REUSEPORT: ::c_int = 15;
306 pub const SO_ACCEPTCONN: ::c_int = 30;
307
308 pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
309 pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
310 pub const TCP_THIN_DUPACK: ::c_int = 17;
311 pub const TCP_USER_TIMEOUT: ::c_int = 18;
312 pub const TCP_REPAIR: ::c_int = 19;
313 pub const TCP_REPAIR_QUEUE: ::c_int = 20;
314 pub const TCP_QUEUE_SEQ: ::c_int = 21;
315 pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
316 pub const TCP_FASTOPEN: ::c_int = 23;
317 pub const TCP_TIMESTAMP: ::c_int = 24;
318
319 pub const SA_ONSTACK: ::c_int = 0x08000000;
320 pub const SA_SIGINFO: ::c_int = 0x00000004;
321 pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
322
323 pub const SIGCHLD: ::c_int = 17;
324 pub const SIGBUS: ::c_int = 7;
325 pub const SIGUSR1: ::c_int = 10;
326 pub const SIGUSR2: ::c_int = 12;
327 pub const SIGCONT: ::c_int = 18;
328 pub const SIGSTOP: ::c_int = 19;
329 pub const SIGTSTP: ::c_int = 20;
330 pub const SIGURG: ::c_int = 23;
331 pub const SIGIO: ::c_int = 29;
332 pub const SIGSYS: ::c_int = 31;
333 pub const SIGSTKFLT: ::c_int = 16;
334 pub const SIGUNUSED: ::c_int = 31;
335 pub const SIGTTIN: ::c_int = 21;
336 pub const SIGTTOU: ::c_int = 22;
337 pub const SIGXCPU: ::c_int = 24;
338 pub const SIGXFSZ: ::c_int = 25;
339 pub const SIGVTALRM: ::c_int = 26;
340 pub const SIGPROF: ::c_int = 27;
341 pub const SIGWINCH: ::c_int = 28;
342 pub const SIGPOLL: ::c_int = 29;
343 pub const SIGPWR: ::c_int = 30;
344 pub const SIG_SETMASK: ::c_int = 2;
345 pub const SIG_BLOCK: ::c_int = 0x000000;
346 pub const SIG_UNBLOCK: ::c_int = 0x01;
347
348 pub const POLLRDNORM: ::c_short = 0x040;
349 pub const POLLWRNORM: ::c_short = 0x100;
350 pub const POLLRDBAND: ::c_short = 0x080;
351 pub const POLLWRBAND: ::c_short = 0x200;
352
353 pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
354 pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
355
356 pub const BUFSIZ: ::c_uint = 8192;
357 pub const TMP_MAX: ::c_uint = 238328;
358 pub const FOPEN_MAX: ::c_uint = 16;
359 pub const POSIX_FADV_DONTNEED: ::c_int = 4;
360 pub const POSIX_FADV_NOREUSE: ::c_int = 5;
361 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
362 pub const _SC_2_C_VERSION: ::c_int = 96;
363 pub const O_ACCMODE: ::c_int = 3;
364 pub const O_ASYNC: ::c_int = 0x2000;
365 pub const O_NDELAY: ::c_int = 0x800;
366 pub const ST_RELATIME: ::c_ulong = 4096;
367 pub const NI_MAXHOST: ::socklen_t = 1025;
368
369 pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
370 pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
371 pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
372 pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
373 pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
374 pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
375 pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
376 pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
377 pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
378 pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
379 pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
380 pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
381 pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
382 pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
383 pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
384 pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
385 pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
386 pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
387 pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
388 pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
389 pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
390 pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
391 pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
392 pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
393 pub const TMPFS_MAGIC: ::c_long = 0x01021994;
394 pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
395
396 pub const VEOF: usize = 4;
397 pub const IUTF8: ::tcflag_t = 0x00004000;
398
399 pub const CPU_SETSIZE: ::c_int = 0x400;
400
401 pub const QFMT_VFS_V1: ::c_int = 4;
402
403 pub const PTRACE_TRACEME: ::c_uint = 0;
404 pub const PTRACE_PEEKTEXT: ::c_uint = 1;
405 pub const PTRACE_PEEKDATA: ::c_uint = 2;
406 pub const PTRACE_PEEKUSER: ::c_uint = 3;
407 pub const PTRACE_POKETEXT: ::c_uint = 4;
408 pub const PTRACE_POKEDATA: ::c_uint = 5;
409 pub const PTRACE_POKEUSER: ::c_uint = 6;
410 pub const PTRACE_CONT: ::c_uint = 7;
411 pub const PTRACE_KILL: ::c_uint = 8;
412 pub const PTRACE_SINGLESTEP: ::c_uint = 9;
413 pub const PTRACE_ATTACH: ::c_uint = 16;
414 pub const PTRACE_DETACH: ::c_uint = 17;
415 pub const PTRACE_SYSCALL: ::c_uint = 24;
416 pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200;
417 pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201;
418 pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202;
419 pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203;
420 pub const PTRACE_GETREGSET: ::c_uint = 0x4204;
421 pub const PTRACE_SETREGSET: ::c_uint = 0x4205;
422 pub const PTRACE_SEIZE: ::c_uint = 0x4206;
423 pub const PTRACE_INTERRUPT: ::c_uint = 0x4207;
424 pub const PTRACE_LISTEN: ::c_uint = 0x4208;
425 pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209;
426
427 pub const MADV_DODUMP: ::c_int = 17;
428 pub const MADV_DONTDUMP: ::c_int = 16;
429
430 pub const EPOLLWAKEUP: ::c_int = 0x20000000;
431
432 pub const MADV_HUGEPAGE: ::c_int = 14;
433 pub const MADV_NOHUGEPAGE: ::c_int = 15;
434 pub const MAP_HUGETLB: ::c_int = 0x040000;
435
436 pub const EFD_NONBLOCK: ::c_int = 0x800;
437
438 pub const F_GETLK: ::c_int = 5;
439 pub const F_GETOWN: ::c_int = 9;
440 pub const F_SETOWN: ::c_int = 8;
441 pub const F_SETLK: ::c_int = 6;
442 pub const F_SETLKW: ::c_int = 7;
443
444 pub const SEEK_DATA: ::c_int = 3;
445 pub const SEEK_HOLE: ::c_int = 4;
446
447 pub const SFD_NONBLOCK: ::c_int = 0x0800;
448
449 pub const TCSANOW: ::c_int = 0;
450 pub const TCSADRAIN: ::c_int = 1;
451 pub const TCSAFLUSH: ::c_int = 2;
452
453 pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
454 pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
455 pub const TIOCLINUX: ::c_ulong = 0x541C;
456 pub const TIOCGSERIAL: ::c_ulong = 0x541E;
457 pub const TIOCEXCL: ::c_ulong = 0x540C;
458 pub const TIOCNXCL: ::c_ulong = 0x540D;
459 pub const TIOCSCTTY: ::c_ulong = 0x540E;
460 pub const TIOCSTI: ::c_ulong = 0x5412;
461 pub const TIOCMGET: ::c_ulong = 0x5415;
462 pub const TIOCMBIS: ::c_ulong = 0x5416;
463 pub const TIOCMBIC: ::c_ulong = 0x5417;
464 pub const TIOCMSET: ::c_ulong = 0x5418;
465 pub const TIOCCONS: ::c_ulong = 0x541D;
466
467 pub const RTLD_DEEPBIND: ::c_int = 0x8;
468 pub const RTLD_GLOBAL: ::c_int = 0x100;
469 pub const RTLD_NOLOAD: ::c_int = 0x4;
470
471 pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
472 pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793;
473 pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278;
474 pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448;
475 pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216;
476
477 pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567;
478 pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123;
479 pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF;
480 pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000;
481 pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC;
482 pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
483 pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
484 pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
485
486 pub const NETLINK_ROUTE: ::c_int = 0;
487 pub const NETLINK_UNUSED: ::c_int = 1;
488 pub const NETLINK_USERSOCK: ::c_int = 2;
489 pub const NETLINK_FIREWALL: ::c_int = 3;
490 pub const NETLINK_SOCK_DIAG: ::c_int = 4;
491 pub const NETLINK_NFLOG: ::c_int = 5;
492 pub const NETLINK_XFRM: ::c_int = 6;
493 pub const NETLINK_SELINUX: ::c_int = 7;
494 pub const NETLINK_ISCSI: ::c_int = 8;
495 pub const NETLINK_AUDIT: ::c_int = 9;
496 pub const NETLINK_FIB_LOOKUP: ::c_int = 10;
497 pub const NETLINK_CONNECTOR: ::c_int = 11;
498 pub const NETLINK_NETFILTER: ::c_int = 12;
499 pub const NETLINK_IP6_FW: ::c_int = 13;
500 pub const NETLINK_DNRTMSG: ::c_int = 14;
501 pub const NETLINK_KOBJECT_UEVENT: ::c_int = 15;
502 pub const NETLINK_GENERIC: ::c_int = 16;
503 pub const NETLINK_SCSITRANSPORT: ::c_int = 18;
504 pub const NETLINK_ECRYPTFS: ::c_int = 19;
505 pub const NETLINK_RDMA: ::c_int = 20;
506 pub const NETLINK_CRYPTO: ::c_int = 21;
507 pub const NETLINK_INET_DIAG: ::c_int = NETLINK_SOCK_DIAG;
508
509 pub const MAX_LINKS: ::c_int = 32;
510
511 pub const NLM_F_REQUEST: ::c_int = 1;
512 pub const NLM_F_MULTI: ::c_int = 2;
513 pub const NLM_F_ACK: ::c_int = 4;
514 pub const NLM_F_ECHO: ::c_int = 8;
515 pub const NLM_F_DUMP_INTR: ::c_int = 16;
516 pub const NLM_F_DUMP_FILTERED: ::c_int = 32;
517
518 pub const NLM_F_ROOT: ::c_int = 0x100;
519 pub const NLM_F_MATCH: ::c_int = 0x200;
520 pub const NLM_F_ATOMIC: ::c_int = 0x400;
521 pub const NLM_F_DUMP: ::c_int = NLM_F_ROOT | NLM_F_MATCH;
522
523 pub const NLM_F_REPLACE: ::c_int = 0x100;
524 pub const NLM_F_EXCL: ::c_int = 0x200;
525 pub const NLM_F_CREATE: ::c_int = 0x400;
526 pub const NLM_F_APPEND: ::c_int = 0x800;
527
528 pub const NLMSG_NOOP: ::c_int = 0x1;
529 pub const NLMSG_ERROR: ::c_int = 0x2;
530 pub const NLMSG_DONE: ::c_int = 0x3;
531 pub const NLMSG_OVERRUN: ::c_int = 0x4;
532 pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
533
534 pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1;
535 pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2;
536 pub const NETLINK_PKTINFO: ::c_int = 3;
537 pub const NETLINK_BROADCAST_ERROR: ::c_int = 4;
538 pub const NETLINK_NO_ENOBUFS: ::c_int = 5;
539 pub const NETLINK_RX_RING: ::c_int = 6;
540 pub const NETLINK_TX_RING: ::c_int = 7;
541 pub const NETLINK_LISTEN_ALL_NSID: ::c_int = 8;
542 pub const NETLINK_LIST_MEMBERSHIPS: ::c_int = 9;
543 pub const NETLINK_CAP_ACK: ::c_int = 10;
544
545 pub const NLA_F_NESTED: ::c_int = 1 << 15;
546 pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14;
547 pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
548
549 cfg_if! {
550 if #[cfg(any(target_arch = "arm", target_arch = "x86",
551 target_arch = "x86_64"))] {
552 pub const PTHREAD_STACK_MIN: ::size_t = 16384;
553 } else {
554 pub const PTHREAD_STACK_MIN: ::size_t = 131072;
555 }
556 }
557
558 extern {
559 pub fn utmpxname(file: *const ::c_char) -> ::c_int;
560 pub fn getutxent() -> *mut utmpx;
561 pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
562 pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
563 pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
564 pub fn setutxent();
565 pub fn endutxent();
566 }
567
568 #[link(name = "util")]
569 extern {
570 pub fn sysctl(name: *mut ::c_int,
571 namelen: ::c_int,
572 oldp: *mut ::c_void,
573 oldlenp: *mut ::size_t,
574 newp: *mut ::c_void,
575 newlen: ::size_t)
576 -> ::c_int;
577 pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
578 pub fn backtrace(buf: *mut *mut ::c_void,
579 sz: ::c_int) -> ::c_int;
580 pub fn glob64(pattern: *const ::c_char,
581 flags: ::c_int,
582 errfunc: ::dox::Option<extern fn(epath: *const ::c_char,
583 errno: ::c_int)
584 -> ::c_int>,
585 pglob: *mut glob64_t) -> ::c_int;
586 pub fn globfree64(pglob: *mut glob64_t);
587 pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
588 pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t,
589 cpusetsize: ::size_t,
590 cpuset: *mut ::cpu_set_t) -> ::c_int;
591 pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t,
592 cpusetsize: ::size_t,
593 cpuset: *const ::cpu_set_t) -> ::c_int;
594 pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
595 pub fn setpriority(which: ::__priority_which_t, who: ::id_t,
596 prio: ::c_int) -> ::c_int;
597 pub fn pthread_getaffinity_np(thread: ::pthread_t,
598 cpusetsize: ::size_t,
599 cpuset: *mut ::cpu_set_t) -> ::c_int;
600 pub fn pthread_setaffinity_np(thread: ::pthread_t,
601 cpusetsize: ::size_t,
602 cpuset: *const ::cpu_set_t) -> ::c_int;
603 pub fn sched_getcpu() -> ::c_int;
604 }
605
606 cfg_if! {
607 if #[cfg(any(target_arch = "x86",
608 target_arch = "arm",
609 target_arch = "powerpc"))] {
610 mod b32;
611 pub use self::b32::*;
612 } else if #[cfg(any(target_arch = "x86_64",
613 target_arch = "aarch64",
614 target_arch = "powerpc64"))] {
615 mod b64;
616 pub use self::b64::*;
617 } else {
618 // Unknown target_arch
619 }
620 }