blob: f9f7416797a3551cc4351e2ed91ebb1eb55ea330 [file] [log] [blame]
Jorge Aparicioe7480ed2016-09-02 21:08:02 -05001pub type blkcnt_t = i64;
2pub type blksize_t = i64;
3pub type c_char = u8;
4pub type c_long = i64;
5pub type c_ulong = u64;
6pub type fsblkcnt_t = u64;
7pub type fsfilcnt_t = u64;
8pub type ino_t = u64;
9pub type nlink_t = u64;
10pub type off_t = i64;
11pub type rlim_t = u64;
12pub type suseconds_t = i64;
13pub type time_t = i64;
14pub type wchar_t = i32;
Ulrich Weigand38569c72016-09-05 19:50:10 +020015pub type greg_t = u64;
16pub type clock_t = i64;
17pub type __fsword_t = ::c_long;
18pub type __priority_which_t = ::c_uint;
Jorge Aparicioe7480ed2016-09-02 21:08:02 -050019
20s! {
Alan Somersa46123c2016-11-13 18:04:47 -070021 pub struct aiocb {
22 pub aio_fildes: ::c_int,
23 pub aio_lio_opcode: ::c_int,
24 pub aio_reqprio: ::c_int,
25 pub aio_buf: *mut ::c_void,
26 pub aio_nbytes: ::size_t,
27 pub aio_sigevent: ::sigevent,
28 __next_prio: *mut aiocb,
29 __abs_prio: ::c_int,
30 __policy: ::c_int,
31 __error_code: ::c_int,
32 __return_value: ::ssize_t,
33 pub aio_offset: off_t,
34 #[cfg(target_pointer_width = "32")]
35 __unused1: [::c_char; 4],
36 __glibc_reserved: [::c_char; 32]
37 }
38
Jorge Aparicioe7480ed2016-09-02 21:08:02 -050039 pub struct stat {
40 pub st_dev: ::dev_t,
41 pub st_ino: ::ino_t,
42 pub st_nlink: ::nlink_t,
43 pub st_mode: ::mode_t,
44 pub st_uid: ::uid_t,
45 pub st_gid: ::gid_t,
46 st_pad0: ::c_int,
47 pub st_rdev: ::dev_t,
48 pub st_size: ::off_t,
49 pub st_atime: ::time_t,
50 pub st_atime_nsec: ::c_long,
51 pub st_mtime: ::time_t,
52 pub st_mtime_nsec: ::c_long,
53 pub st_ctime: ::time_t,
54 pub st_ctime_nsec: ::c_long,
55 pub st_blksize: ::blksize_t,
56 pub st_blocks: ::blkcnt_t,
Ulrich Weigand38569c72016-09-05 19:50:10 +020057 __glibc_reserved: [::c_long; 3],
Jorge Aparicioe7480ed2016-09-02 21:08:02 -050058 }
59
60 pub struct stat64 {
61 pub st_dev: ::dev_t,
Ulrich Weigand38569c72016-09-05 19:50:10 +020062 pub st_ino: ::ino64_t,
Jorge Aparicioe7480ed2016-09-02 21:08:02 -050063 pub st_nlink: ::nlink_t,
64 pub st_mode: ::mode_t,
65 pub st_uid: ::uid_t,
66 pub st_gid: ::gid_t,
67 st_pad0: ::c_int,
68 pub st_rdev: ::dev_t,
69 pub st_size: ::off_t,
70 pub st_atime: ::time_t,
71 pub st_atime_nsec: ::c_long,
72 pub st_mtime: ::time_t,
73 pub st_mtime_nsec: ::c_long,
74 pub st_ctime: ::time_t,
75 pub st_ctime_nsec: ::c_long,
76 pub st_blksize: ::blksize_t,
Ulrich Weigand38569c72016-09-05 19:50:10 +020077 pub st_blocks: ::blkcnt64_t,
78 __glibc_reserved: [::c_long; 3],
Jorge Aparicioe7480ed2016-09-02 21:08:02 -050079 }
80
81 pub struct pthread_attr_t {
82 __size: [::c_ulong; 7]
83 }
84
85 pub struct sigaction {
86 pub sa_sigaction: ::sighandler_t,
Ulrich Weigand38569c72016-09-05 19:50:10 +020087 __glibc_reserved0: ::c_int,
88 pub sa_flags: ::c_int,
Jorge Aparicioe7480ed2016-09-02 21:08:02 -050089 _restorer: *mut ::c_void,
90 pub sa_mask: sigset_t,
91 }
92
93 pub struct stack_t {
94 pub ss_sp: *mut ::c_void,
95 pub ss_flags: ::c_int,
96 pub ss_size: ::size_t,
97 }
98
99 pub struct sigset_t {
100 __size: [::c_ulong; 16],
101 }
102
103 pub struct siginfo_t {
104 pub si_signo: ::c_int,
105 pub si_errno: ::c_int,
106 pub si_code: ::c_int,
107 _pad: ::c_int,
108 _pad2: [::c_long; 14],
109 }
110
111 pub struct ipc_perm {
112 pub __key: ::key_t,
113 pub uid: ::uid_t,
114 pub gid: ::gid_t,
115 pub cuid: ::uid_t,
116 pub cgid: ::gid_t,
Ulrich Weigand38569c72016-09-05 19:50:10 +0200117 pub mode: ::mode_t,
Jorge Aparicioe7480ed2016-09-02 21:08:02 -0500118 pub __seq: ::c_ushort,
119 __pad1: ::c_ushort,
120 __unused1: ::c_ulong,
121 __unused2: ::c_ulong
122 }
123
124 pub struct shmid_ds {
125 pub shm_perm: ::ipc_perm,
126 pub shm_segsz: ::size_t,
127 pub shm_atime: ::time_t,
128 pub shm_dtime: ::time_t,
129 pub shm_ctime: ::time_t,
130 pub shm_cpid: ::pid_t,
131 pub shm_lpid: ::pid_t,
132 pub shm_nattch: ::shmatt_t,
133 __unused4: ::c_ulong,
134 __unused5: ::c_ulong
135 }
136
137 pub struct statfs {
138 pub f_type: ::c_uint,
139 pub f_bsize: ::c_uint,
140 pub f_blocks: ::fsblkcnt_t,
141 pub f_bfree: ::fsblkcnt_t,
142 pub f_bavail: ::fsblkcnt_t,
Ulrich Weigand38569c72016-09-05 19:50:10 +0200143 pub f_files: ::fsfilcnt_t,
144 pub f_ffree: ::fsfilcnt_t,
Jorge Aparicioe7480ed2016-09-02 21:08:02 -0500145 pub f_fsid: ::fsid_t,
146 pub f_namelen: ::c_uint,
147 pub f_frsize: ::c_uint,
148 pub f_flags: ::c_uint,
149 f_spare: [::c_uint; 4],
150 }
151
152 pub struct msghdr {
153 pub msg_name: *mut ::c_void,
154 pub msg_namelen: ::socklen_t,
155 pub msg_iov: *mut ::iovec,
156 pub msg_iovlen: ::size_t,
157 pub msg_control: *mut ::c_void,
158 pub msg_controllen: ::size_t,
159 pub msg_flags: ::c_int,
160 }
161
Guillaume Gomez7d2aea92016-12-04 10:32:42 -0800162 pub struct cmsghdr {
163 pub cmsg_len: ::size_t,
164 pub cmsg_level: ::c_int,
165 pub cmsg_type: ::c_int,
166 }
167
Jorge Aparicioe7480ed2016-09-02 21:08:02 -0500168 pub struct termios {
169 pub c_iflag: ::tcflag_t,
170 pub c_oflag: ::tcflag_t,
171 pub c_cflag: ::tcflag_t,
172 pub c_lflag: ::tcflag_t,
173 pub c_line: ::cc_t,
174 pub c_cc: [::cc_t; ::NCCS],
175 pub c_ispeed: ::speed_t,
176 pub c_ospeed: ::speed_t,
177 }
178
179 pub struct sysinfo {
180 pub uptime: ::c_long,
181 pub loads: [::c_ulong; 3],
182 pub totalram: ::c_ulong,
183 pub freeram: ::c_ulong,
184 pub sharedram: ::c_ulong,
185 pub bufferram: ::c_ulong,
186 pub totalswap: ::c_ulong,
187 pub freeswap: ::c_ulong,
188 pub procs: ::c_ushort,
189 pub pad: ::c_ushort,
190 pub totalhigh: ::c_ulong,
191 pub freehigh: ::c_ulong,
192 pub mem_unit: ::c_uint,
193 pub _f: [::c_char; 0],
194 }
195
Ulrich Weigand38569c72016-09-05 19:50:10 +0200196 pub struct glob64_t {
197 pub gl_pathc: ::size_t,
198 pub gl_pathv: *mut *mut ::c_char,
199 pub gl_offs: ::size_t,
200 pub gl_flags: ::c_int,
201
202 __unused1: *mut ::c_void,
203 __unused2: *mut ::c_void,
204 __unused3: *mut ::c_void,
205 __unused4: *mut ::c_void,
206 __unused5: *mut ::c_void,
207 }
208
209 pub struct ucred {
210 pub pid: ::pid_t,
211 pub uid: ::uid_t,
212 pub gid: ::gid_t,
213 }
214
215 pub struct flock {
216 pub l_type: ::c_short,
217 pub l_whence: ::c_short,
218 pub l_start: ::off_t,
219 pub l_len: ::off_t,
220 pub l_pid: ::pid_t,
221 }
222
Jorge Aparicioe7480ed2016-09-02 21:08:02 -0500223 // FIXME this is actually a union
224 pub struct sem_t {
225 __size: [::c_char; 32],
226 __align: [::c_long; 0],
227 }
Ulrich Weigand38569c72016-09-05 19:50:10 +0200228
229 pub struct __psw_t {
230 pub mask: u64,
231 pub addr: u64,
232 }
233
234 // FIXME: This is actually a union.
235 pub struct fpreg_t {
236 pub d: ::c_double,
237 // f: ::c_float,
238 }
239
240 pub struct fpregset_t {
241 pub fpc: u32,
242 __pad: u32,
243 pub fprs: [fpreg_t; 16],
244 }
245
246 pub struct mcontext_t {
247 pub psw: __psw_t,
248 pub gregs: [u64; 16],
249 pub aregs: [u32; 16],
250 pub fpregs: fpregset_t,
251 }
252
253 pub struct ucontext_t {
254 pub uc_flags: ::c_ulong,
255 pub uc_link: *mut ucontext_t,
256 pub uc_stack: ::stack_t,
257 pub uc_mcontext: mcontext_t,
258 pub uc_sigmask: ::sigset_t,
259 }
Alex Crichton8a9d8c22016-10-10 21:59:07 -0700260
261 pub struct msqid_ds {
262 pub msg_perm: ::ipc_perm,
263 pub msg_stime: ::time_t,
264 pub msg_rtime: ::time_t,
265 pub msg_ctime: ::time_t,
266 __msg_cbytes: ::c_ulong,
267 pub msg_qnum: ::msgqnum_t,
268 pub msg_qbytes: ::msglen_t,
269 pub msg_lspid: ::pid_t,
270 pub msg_lrpid: ::pid_t,
271 __glibc_reserved4: ::c_ulong,
272 __glibc_reserved5: ::c_ulong,
273 }
Jorge Aparicioe7480ed2016-09-02 21:08:02 -0500274}
275
Jorge Aparicio540d1402016-12-31 16:40:13 -0500276pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
277
278pub const SFD_CLOEXEC: ::c_int = 0x080000;
279
280pub const NCCS: usize = 32;
281
282pub const O_TRUNC: ::c_int = 512;
283
284pub const O_CLOEXEC: ::c_int = 0x80000;
285
286pub const EBFONT: ::c_int = 59;
287pub const ENOSTR: ::c_int = 60;
288pub const ENODATA: ::c_int = 61;
289pub const ETIME: ::c_int = 62;
290pub const ENOSR: ::c_int = 63;
291pub const ENONET: ::c_int = 64;
292pub const ENOPKG: ::c_int = 65;
293pub const EREMOTE: ::c_int = 66;
294pub const ENOLINK: ::c_int = 67;
295pub const EADV: ::c_int = 68;
296pub const ESRMNT: ::c_int = 69;
297pub const ECOMM: ::c_int = 70;
298pub const EPROTO: ::c_int = 71;
299pub const EDOTDOT: ::c_int = 73;
300
301pub const SA_NODEFER: ::c_int = 0x40000000;
302pub const SA_RESETHAND: ::c_int = 0x80000000;
303pub const SA_RESTART: ::c_int = 0x10000000;
304pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
305
306pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
307
308pub const EFD_CLOEXEC: ::c_int = 0x80000;
309
Jorge Aparicioe16b11d2016-09-03 00:58:30 -0500310pub const POSIX_FADV_DONTNEED: ::c_int = 6;
311pub const POSIX_FADV_NOREUSE: ::c_int = 7;
Jorge Aparicioe7480ed2016-09-02 21:08:02 -0500312
313pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
314pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
315pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
316pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
317
318pub const EADDRINUSE: ::c_int = 98;
319pub const EADDRNOTAVAIL: ::c_int = 99;
320pub const ECONNABORTED: ::c_int = 103;
321pub const ECONNREFUSED: ::c_int = 111;
322pub const ECONNRESET: ::c_int = 104;
323pub const EDEADLK: ::c_int = 35;
324pub const ENOSYS: ::c_int = 38;
325pub const ENOTCONN: ::c_int = 107;
326pub const ETIMEDOUT: ::c_int = 110;
327pub const FIOCLEX: ::c_ulong = 0x5451;
328pub const FIONBIO: ::c_ulong = 0x5421;
329pub const MAP_ANON: ::c_int = 0x20;
330pub const O_ACCMODE: ::c_int = 3;
331pub const O_APPEND: ::c_int = 1024;
332pub const O_CREAT: ::c_int = 64;
333pub const O_EXCL: ::c_int = 128;
334pub const O_NONBLOCK: ::c_int = 2048;
335pub const PTHREAD_STACK_MIN: ::size_t = 16384;
336pub const RLIM_INFINITY: ::rlim_t = 0xffffffffffffffff;
Ulrich Weigand38569c72016-09-05 19:50:10 +0200337pub const SA_NOCLDWAIT: ::c_int = 2;
338pub const SA_ONSTACK: ::c_int = 0x08000000;
339pub const SA_SIGINFO: ::c_int = 4;
Jorge Aparicioe7480ed2016-09-02 21:08:02 -0500340pub const SIGBUS: ::c_int = 7;
341pub const SIGSTKSZ: ::size_t = 0x2000;
Anatol Pomozovde75eb62017-04-04 13:26:32 -0700342pub const MINSIGSTKSZ: ::size_t = 2048;
Jorge Aparicioe7480ed2016-09-02 21:08:02 -0500343pub const SIG_SETMASK: ::c_int = 2;
344pub const SOCK_DGRAM: ::c_int = 2;
345pub const SOCK_STREAM: ::c_int = 1;
346pub const SOL_SOCKET: ::c_int = 1;
347pub const SO_BROADCAST: ::c_int = 6;
348pub const SO_ERROR: ::c_int = 4;
349pub const SO_RCVTIMEO: ::c_int = 20;
350pub const SO_REUSEADDR: ::c_int = 2;
351pub const SO_SNDTIMEO: ::c_int = 21;
352
Ulrich Weigand38569c72016-09-05 19:50:10 +0200353pub const RLIMIT_RSS: ::c_int = 5;
354pub const RLIMIT_NOFILE: ::c_int = 7;
355pub const RLIMIT_AS: ::c_int = 9;
356pub const RLIMIT_NPROC: ::c_int = 6;
357pub const RLIMIT_MEMLOCK: ::c_int = 8;
358pub const RLIMIT_RTTIME: ::c_int = 15;
359pub const RLIMIT_NLIMITS: ::c_int = 16;
360
361pub const O_NOCTTY: ::c_int = 256;
362pub const O_SYNC: ::c_int = 1052672;
363pub const O_RSYNC: ::c_int = 1052672;
364pub const O_DSYNC: ::c_int = 4096;
365pub const O_FSYNC: ::c_int = 0x101000;
366pub const O_DIRECT: ::c_int = 0x4000;
367pub const O_DIRECTORY: ::c_int = 0x10000;
368pub const O_NOFOLLOW: ::c_int = 0x20000;
369
370pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
371
372pub const LC_PAPER: ::c_int = 7;
373pub const LC_NAME: ::c_int = 8;
374pub const LC_ADDRESS: ::c_int = 9;
375pub const LC_TELEPHONE: ::c_int = 10;
376pub const LC_MEASUREMENT: ::c_int = 11;
377pub const LC_IDENTIFICATION: ::c_int = 12;
378pub const LC_PAPER_MASK: ::c_int = (1 << LC_PAPER);
379pub const LC_NAME_MASK: ::c_int = (1 << LC_NAME);
380pub const LC_ADDRESS_MASK: ::c_int = (1 << LC_ADDRESS);
381pub const LC_TELEPHONE_MASK: ::c_int = (1 << LC_TELEPHONE);
382pub const LC_MEASUREMENT_MASK: ::c_int = (1 << LC_MEASUREMENT);
383pub const LC_IDENTIFICATION_MASK: ::c_int = (1 << LC_IDENTIFICATION);
384pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK
385 | ::LC_NUMERIC_MASK
386 | ::LC_TIME_MASK
387 | ::LC_COLLATE_MASK
388 | ::LC_MONETARY_MASK
389 | ::LC_MESSAGES_MASK
390 | LC_PAPER_MASK
391 | LC_NAME_MASK
392 | LC_ADDRESS_MASK
393 | LC_TELEPHONE_MASK
394 | LC_MEASUREMENT_MASK
395 | LC_IDENTIFICATION_MASK;
396
397pub const MAP_ANONYMOUS: ::c_int = 0x0020;
398pub const MAP_GROWSDOWN: ::c_int = 0x0100;
399pub const MAP_DENYWRITE: ::c_int = 0x0800;
400pub const MAP_EXECUTABLE: ::c_int = 0x01000;
401pub const MAP_LOCKED: ::c_int = 0x02000;
402pub const MAP_NORESERVE: ::c_int = 0x04000;
403pub const MAP_POPULATE: ::c_int = 0x08000;
404pub const MAP_NONBLOCK: ::c_int = 0x010000;
405pub const MAP_STACK: ::c_int = 0x020000;
406
407pub const EDEADLOCK: ::c_int = 35;
408pub const ENAMETOOLONG: ::c_int = 36;
409pub const ENOLCK: ::c_int = 37;
410pub const ENOTEMPTY: ::c_int = 39;
411pub const ELOOP: ::c_int = 40;
412pub const ENOMSG: ::c_int = 42;
413pub const EIDRM: ::c_int = 43;
414pub const ECHRNG: ::c_int = 44;
415pub const EL2NSYNC: ::c_int = 45;
416pub const EL3HLT: ::c_int = 46;
417pub const EL3RST: ::c_int = 47;
418pub const ELNRNG: ::c_int = 48;
419pub const EUNATCH: ::c_int = 49;
420pub const ENOCSI: ::c_int = 50;
421pub const EL2HLT: ::c_int = 51;
422pub const EBADE: ::c_int = 52;
423pub const EBADR: ::c_int = 53;
424pub const EXFULL: ::c_int = 54;
425pub const ENOANO: ::c_int = 55;
426pub const EBADRQC: ::c_int = 56;
427pub const EBADSLT: ::c_int = 57;
428pub const EMULTIHOP: ::c_int = 72;
429pub const EOVERFLOW: ::c_int = 75;
430pub const ENOTUNIQ: ::c_int = 76;
431pub const EBADFD: ::c_int = 77;
432pub const EBADMSG: ::c_int = 74;
433pub const EREMCHG: ::c_int = 78;
434pub const ELIBACC: ::c_int = 79;
435pub const ELIBBAD: ::c_int = 80;
436pub const ELIBSCN: ::c_int = 81;
437pub const ELIBMAX: ::c_int = 82;
438pub const ELIBEXEC: ::c_int = 83;
439pub const EILSEQ: ::c_int = 84;
440pub const ERESTART: ::c_int = 85;
441pub const ESTRPIPE: ::c_int = 86;
442pub const EUSERS: ::c_int = 87;
443pub const ENOTSOCK: ::c_int = 88;
444pub const EDESTADDRREQ: ::c_int = 89;
445pub const EMSGSIZE: ::c_int = 90;
446pub const EPROTOTYPE: ::c_int = 91;
447pub const ENOPROTOOPT: ::c_int = 92;
448pub const EPROTONOSUPPORT: ::c_int = 93;
449pub const ESOCKTNOSUPPORT: ::c_int = 94;
450pub const EOPNOTSUPP: ::c_int = 95;
Steven Allen8c3e6ba2016-11-11 11:00:16 -0800451pub const ENOTSUP: ::c_int = EOPNOTSUPP;
Ulrich Weigand38569c72016-09-05 19:50:10 +0200452pub const EPFNOSUPPORT: ::c_int = 96;
453pub const EAFNOSUPPORT: ::c_int = 97;
454pub const ENETDOWN: ::c_int = 100;
455pub const ENETUNREACH: ::c_int = 101;
456pub const ENETRESET: ::c_int = 102;
457pub const ENOBUFS: ::c_int = 105;
458pub const EISCONN: ::c_int = 106;
459pub const ESHUTDOWN: ::c_int = 108;
460pub const ETOOMANYREFS: ::c_int = 109;
461pub const EHOSTDOWN: ::c_int = 112;
462pub const EHOSTUNREACH: ::c_int = 113;
463pub const EALREADY: ::c_int = 114;
464pub const EINPROGRESS: ::c_int = 115;
465pub const ESTALE: ::c_int = 116;
466pub const EUCLEAN: ::c_int = 117;
467pub const ENOTNAM: ::c_int = 118;
468pub const ENAVAIL: ::c_int = 119;
469pub const EISNAM: ::c_int = 120;
470pub const EREMOTEIO: ::c_int = 121;
471pub const EDQUOT: ::c_int = 122;
472pub const ENOMEDIUM: ::c_int = 123;
473pub const EMEDIUMTYPE: ::c_int = 124;
474pub const ECANCELED: ::c_int = 125;
475pub const ENOKEY: ::c_int = 126;
476pub const EKEYEXPIRED: ::c_int = 127;
477pub const EKEYREVOKED: ::c_int = 128;
478pub const EKEYREJECTED: ::c_int = 129;
479pub const EOWNERDEAD: ::c_int = 130;
480pub const ENOTRECOVERABLE: ::c_int = 131;
481pub const EHWPOISON: ::c_int = 133;
482pub const ERFKILL: ::c_int = 132;
483
484pub const SOCK_SEQPACKET: ::c_int = 5;
485
486pub const SO_TYPE: ::c_int = 3;
487pub const SO_DONTROUTE: ::c_int = 5;
488pub const SO_SNDBUF: ::c_int = 7;
489pub const SO_RCVBUF: ::c_int = 8;
490pub const SO_KEEPALIVE: ::c_int = 9;
491pub const SO_OOBINLINE: ::c_int = 10;
492pub const SO_LINGER: ::c_int = 13;
493pub const SO_REUSEPORT: ::c_int = 15;
494pub const SO_PEERCRED: ::c_int = 17;
495pub const SO_RCVLOWAT: ::c_int = 18;
496pub const SO_SNDLOWAT: ::c_int = 19;
497pub const SO_ACCEPTCONN: ::c_int = 30;
498
499pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
500pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
501pub const TCP_THIN_DUPACK: ::c_int = 17;
502pub const TCP_USER_TIMEOUT: ::c_int = 18;
503pub const TCP_REPAIR: ::c_int = 19;
504pub const TCP_REPAIR_QUEUE: ::c_int = 20;
505pub const TCP_QUEUE_SEQ: ::c_int = 21;
506pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
507pub const TCP_FASTOPEN: ::c_int = 23;
508pub const TCP_TIMESTAMP: ::c_int = 24;
509
510pub const SIGCHLD: ::c_int = 17;
511pub const SIGUSR1: ::c_int = 10;
512pub const SIGUSR2: ::c_int = 12;
513pub const SIGCONT: ::c_int = 18;
514pub const SIGSTOP: ::c_int = 19;
515pub const SIGTSTP: ::c_int = 20;
516pub const SIGURG: ::c_int = 23;
517pub const SIGIO: ::c_int = 29;
518pub const SIGSYS: ::c_int = 31;
519pub const SIGSTKFLT: ::c_int = 16;
520pub const SIGUNUSED: ::c_int = 31;
521pub const SIGTTIN: ::c_int = 21;
522pub const SIGTTOU: ::c_int = 22;
523pub const SIGXCPU: ::c_int = 24;
524pub const SIGXFSZ: ::c_int = 25;
525pub const SIGVTALRM: ::c_int = 26;
526pub const SIGPROF: ::c_int = 27;
527pub const SIGWINCH: ::c_int = 28;
528pub const SIGPOLL: ::c_int = 29;
529pub const SIGPWR: ::c_int = 30;
530pub const SIG_BLOCK: ::c_int = 0x000000;
531pub const SIG_UNBLOCK: ::c_int = 0x01;
532
533pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
534pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
535
536pub const BUFSIZ: ::c_uint = 8192;
537pub const TMP_MAX: ::c_uint = 238328;
538pub const FOPEN_MAX: ::c_uint = 16;
539pub const POSIX_MADV_DONTNEED: ::c_int = 4;
540pub const _SC_2_C_VERSION: ::c_int = 96;
Ulrich Weigand38569c72016-09-05 19:50:10 +0200541pub const O_ASYNC: ::c_int = 0x2000;
542pub const O_NDELAY: ::c_int = 0x800;
Ulrich Weigand38569c72016-09-05 19:50:10 +0200543pub const ST_RELATIME: ::c_ulong = 4096;
544pub const NI_MAXHOST: ::socklen_t = 1025;
545
546pub const ADFS_SUPER_MAGIC: ::c_int = 0x0000adf5;
547pub const AFFS_SUPER_MAGIC: ::c_int = 0x0000adff;
548pub const CODA_SUPER_MAGIC: ::c_int = 0x73757245;
549pub const CRAMFS_MAGIC: ::c_int = 0x28cd3d45;
550pub const EFS_SUPER_MAGIC: ::c_int = 0x00414a53;
551pub const EXT2_SUPER_MAGIC: ::c_int = 0x0000ef53;
552pub const EXT3_SUPER_MAGIC: ::c_int = 0x0000ef53;
553pub const EXT4_SUPER_MAGIC: ::c_int = 0x0000ef53;
554pub const HPFS_SUPER_MAGIC: ::c_int = 0xf995e849;
555pub const HUGETLBFS_MAGIC: ::c_int = 0x958458f6;
556pub const ISOFS_SUPER_MAGIC: ::c_int = 0x00009660;
557pub const JFFS2_SUPER_MAGIC: ::c_int = 0x000072b6;
558pub const MINIX_SUPER_MAGIC: ::c_int = 0x0000137f;
559pub const MINIX_SUPER_MAGIC2: ::c_int = 0x0000138f;
560pub const MINIX2_SUPER_MAGIC: ::c_int = 0x00002468;
561pub const MINIX2_SUPER_MAGIC2: ::c_int = 0x00002478;
562pub const MSDOS_SUPER_MAGIC: ::c_int = 0x00004d44;
563pub const NCP_SUPER_MAGIC: ::c_int = 0x0000564c;
564pub const NFS_SUPER_MAGIC: ::c_int = 0x00006969;
565pub const OPENPROM_SUPER_MAGIC: ::c_int = 0x00009fa1;
566pub const PROC_SUPER_MAGIC: ::c_int = 0x00009fa0;
567pub const QNX4_SUPER_MAGIC: ::c_int = 0x0000002f;
568pub const REISERFS_SUPER_MAGIC: ::c_int = 0x52654973;
569pub const SMB_SUPER_MAGIC: ::c_int = 0x0000517b;
570pub const TMPFS_MAGIC: ::c_int = 0x01021994;
571pub const USBDEVICE_SUPER_MAGIC: ::c_int = 0x00009fa2;
572
573pub const VEOF: usize = 4;
574pub const VEOL: usize = 11;
575pub const VEOL2: usize = 16;
576pub const VMIN: usize = 6;
577pub const IEXTEN: ::tcflag_t = 0x00008000;
578pub const TOSTOP: ::tcflag_t = 0x00000100;
579pub const FLUSHO: ::tcflag_t = 0x00001000;
Ulrich Weigand38569c72016-09-05 19:50:10 +0200580
581pub const CPU_SETSIZE: ::c_int = 0x400;
582
583pub const EXTPROC: ::tcflag_t = 0x00010000;
584
585pub const QFMT_VFS_V1: ::c_int = 4;
586
587pub const PTRACE_TRACEME: ::c_uint = 0;
588pub const PTRACE_PEEKTEXT: ::c_uint = 1;
589pub const PTRACE_PEEKDATA: ::c_uint = 2;
590pub const PTRACE_PEEKUSER: ::c_uint = 3;
591pub const PTRACE_POKETEXT: ::c_uint = 4;
592pub const PTRACE_POKEDATA: ::c_uint = 5;
593pub const PTRACE_POKEUSER: ::c_uint = 6;
594pub const PTRACE_CONT: ::c_uint = 7;
595pub const PTRACE_KILL: ::c_uint = 8;
596pub const PTRACE_SINGLESTEP: ::c_uint = 9;
597pub const PTRACE_GETREGS: ::c_uint = 12;
598pub const PTRACE_SETREGS: ::c_uint = 13;
599pub const PTRACE_GETFPREGS: ::c_uint = 14;
600pub const PTRACE_SETFPREGS: ::c_uint = 15;
601pub const PTRACE_ATTACH: ::c_uint = 16;
602pub const PTRACE_DETACH: ::c_uint = 17;
603pub const PTRACE_SYSCALL: ::c_uint = 24;
604pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200;
605pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201;
606pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202;
607pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203;
608pub const PTRACE_GETREGSET: ::c_uint = 0x4204;
609pub const PTRACE_SETREGSET: ::c_uint = 0x4205;
610pub const PTRACE_SEIZE: ::c_uint = 0x4206;
611pub const PTRACE_INTERRUPT: ::c_uint = 0x4207;
612pub const PTRACE_LISTEN: ::c_uint = 0x4208;
613pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209;
614
615pub const MADV_DODUMP: ::c_int = 17;
616pub const MADV_DONTDUMP: ::c_int = 16;
617
618pub const EPOLLWAKEUP: ::c_int = 0x20000000;
619
620pub const MADV_HUGEPAGE: ::c_int = 14;
621pub const MADV_NOHUGEPAGE: ::c_int = 15;
622pub const MAP_HUGETLB: ::c_int = 0x040000;
623
624pub const EFD_NONBLOCK: ::c_int = 0x800;
625
626pub const F_GETLK: ::c_int = 5;
627pub const F_GETOWN: ::c_int = 9;
628pub const F_SETOWN: ::c_int = 8;
629pub const F_SETLK: ::c_int = 6;
630pub const F_SETLKW: ::c_int = 7;
631
632pub const SEEK_DATA: ::c_int = 3;
633pub const SEEK_HOLE: ::c_int = 4;
634
635pub const SFD_NONBLOCK: ::c_int = 0x0800;
636
637pub const TCSANOW: ::c_int = 0;
638pub const TCSADRAIN: ::c_int = 1;
639pub const TCSAFLUSH: ::c_int = 2;
640
641pub const TCGETS: ::c_ulong = 0x5401;
642pub const TCSETS: ::c_ulong = 0x5402;
643pub const TCSETSW: ::c_ulong = 0x5403;
644pub const TCSETSF: ::c_ulong = 0x5404;
645pub const TCGETA: ::c_ulong = 0x5405;
646pub const TCSETA: ::c_ulong = 0x5406;
647pub const TCSETAW: ::c_ulong = 0x5407;
648pub const TCSETAF: ::c_ulong = 0x5408;
649pub const TCSBRK: ::c_ulong = 0x5409;
650pub const TCXONC: ::c_ulong = 0x540A;
651pub const TCFLSH: ::c_ulong = 0x540B;
652pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
653pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
654pub const TIOCINQ: ::c_ulong = 0x541B;
655pub const TIOCLINUX: ::c_ulong = 0x541C;
656pub const TIOCGSERIAL: ::c_ulong = 0x541E;
657pub const TIOCEXCL: ::c_ulong = 0x540C;
658pub const TIOCNXCL: ::c_ulong = 0x540D;
659pub const TIOCSCTTY: ::c_ulong = 0x540E;
660pub const TIOCGPGRP: ::c_ulong = 0x540F;
661pub const TIOCSPGRP: ::c_ulong = 0x5410;
662pub const TIOCOUTQ: ::c_ulong = 0x5411;
663pub const TIOCSTI: ::c_ulong = 0x5412;
664pub const TIOCGWINSZ: ::c_ulong = 0x5413;
665pub const TIOCSWINSZ: ::c_ulong = 0x5414;
666pub const TIOCMGET: ::c_ulong = 0x5415;
667pub const TIOCMBIS: ::c_ulong = 0x5416;
668pub const TIOCMBIC: ::c_ulong = 0x5417;
669pub const TIOCMSET: ::c_ulong = 0x5418;
670pub const FIONREAD: ::c_ulong = 0x541B;
671pub const TIOCCONS: ::c_ulong = 0x541D;
672
673pub const RTLD_DEEPBIND: ::c_int = 0x8;
674pub const RTLD_GLOBAL: ::c_int = 0x100;
675pub const RTLD_NOLOAD: ::c_int = 0x4;
676
677pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
678pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793;
679pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278;
680pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448;
681pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216;
682
683pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567;
684pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123;
685pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF;
686pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000;
687pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC;
688pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
689pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
690pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
691
692pub const SYS_gettid: ::c_long = 236;
693pub const SYS_perf_event_open: ::c_long = 331;
694
Jorge Aparicioe7480ed2016-09-02 21:08:02 -0500695#[link(name = "util")]
696extern {
Ulrich Weigand38569c72016-09-05 19:50:10 +0200697 pub fn sysctl(name: *mut ::c_int,
698 namelen: ::c_int,
699 oldp: *mut ::c_void,
700 oldlenp: *mut ::size_t,
701 newp: *mut ::c_void,
702 newlen: ::size_t)
703 -> ::c_int;
Jorge Aparicioe7480ed2016-09-02 21:08:02 -0500704 pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
Ulrich Weigand38569c72016-09-05 19:50:10 +0200705 pub fn backtrace(buf: *mut *mut ::c_void,
706 sz: ::c_int) -> ::c_int;
707 pub fn glob64(pattern: *const ::c_char,
708 flags: ::c_int,
709 errfunc: ::dox::Option<extern fn(epath: *const ::c_char,
710 errno: ::c_int)
711 -> ::c_int>,
712 pglob: *mut glob64_t) -> ::c_int;
713 pub fn globfree64(pglob: *mut glob64_t);
714 pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
715 pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t,
716 cpusetsize: ::size_t,
717 cpuset: *mut ::cpu_set_t) -> ::c_int;
718 pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t,
719 cpusetsize: ::size_t,
720 cpuset: *const ::cpu_set_t) -> ::c_int;
721 pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
722 pub fn setpriority(which: ::__priority_which_t, who: ::id_t,
723 prio: ::c_int) -> ::c_int;
724 pub fn pthread_getaffinity_np(thread: ::pthread_t,
725 cpusetsize: ::size_t,
726 cpuset: *mut ::cpu_set_t) -> ::c_int;
727 pub fn pthread_setaffinity_np(thread: ::pthread_t,
728 cpusetsize: ::size_t,
729 cpuset: *const ::cpu_set_t) -> ::c_int;
730 pub fn sched_getcpu() -> ::c_int;
731 pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
732 pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
733 pub fn makecontext(ucp: *mut ucontext_t,
734 func: extern fn (),
735 argc: ::c_int, ...);
736 pub fn swapcontext(uocp: *mut ucontext_t,
737 ucp: *const ucontext_t) -> ::c_int;
Jorge Aparicioe7480ed2016-09-02 21:08:02 -0500738}