blob: 34b376695735f4179450aed5a54ff8a36ad8c3ca [file] [log] [blame]
Brian Anderson773aab82015-12-29 20:00:29 +00001pub type c_long = i64;
2pub type c_ulong = u64;
3
Alex Crichton8a8bc662016-02-29 23:02:36 -08004s! {
Alex Crichtona36da112017-08-25 18:03:53 -07005 pub struct statfs64 {
6 pub f_type: ::c_ulong,
7 pub f_bsize: ::c_ulong,
8 pub f_blocks: ::fsblkcnt_t,
9 pub f_bfree: ::fsblkcnt_t,
10 pub f_bavail: ::fsblkcnt_t,
11 pub f_files: ::fsfilcnt_t,
12 pub f_ffree: ::fsfilcnt_t,
13 pub f_fsid: ::fsid_t,
14 pub f_namelen: ::c_ulong,
15 pub f_frsize: ::c_ulong,
16 pub f_flags: ::c_ulong,
17 pub f_spare: [::c_ulong; 4],
18 }
19
20 pub struct statvfs64 {
21 pub f_bsize: ::c_ulong,
22 pub f_frsize: ::c_ulong,
23 pub f_blocks: u64,
24 pub f_bfree: u64,
25 pub f_bavail: u64,
26 pub f_files: u64,
27 pub f_ffree: u64,
28 pub f_favail: u64,
29 pub f_fsid: ::c_ulong,
30 pub f_flag: ::c_ulong,
31 pub f_namemax: ::c_ulong,
32 __f_spare: [::c_int; 6],
33 }
34
Alex Crichton8a8bc662016-02-29 23:02:36 -080035 pub struct stack_t {
36 pub ss_sp: *mut ::c_void,
37 pub ss_flags: ::c_int,
38 pub ss_size: ::size_t
39 }
40
41 pub struct pthread_attr_t {
42 __size: [u64; 7]
43 }
44
45 pub struct sigset_t {
46 __val: [::c_ulong; 16],
47 }
48
49 pub struct shmid_ds {
50 pub shm_perm: ::ipc_perm,
51 pub shm_segsz: ::size_t,
52 pub shm_atime: ::time_t,
53 pub shm_dtime: ::time_t,
54 pub shm_ctime: ::time_t,
55 pub shm_cpid: ::pid_t,
56 pub shm_lpid: ::pid_t,
57 pub shm_nattch: ::c_ulong,
58 __pad1: ::c_ulong,
59 __pad2: ::c_ulong,
60 }
61
Alexander Schlarb75905652016-09-17 22:17:17 +020062 pub struct msqid_ds {
63 pub msg_perm: ::ipc_perm,
64 pub msg_stime: ::time_t,
65 pub msg_rtime: ::time_t,
66 pub msg_ctime: ::time_t,
67 __msg_cbytes: ::c_ulong,
68 pub msg_qnum: ::msgqnum_t,
69 pub msg_qbytes: ::msglen_t,
70 pub msg_lspid: ::pid_t,
71 pub msg_lrpid: ::pid_t,
72 __pad1: ::c_ulong,
73 __pad2: ::c_ulong,
74 }
75
Alex Crichton8a8bc662016-02-29 23:02:36 -080076 pub struct statfs {
77 pub f_type: ::c_ulong,
78 pub f_bsize: ::c_ulong,
79 pub f_blocks: ::fsblkcnt_t,
80 pub f_bfree: ::fsblkcnt_t,
81 pub f_bavail: ::fsblkcnt_t,
82 pub f_files: ::fsfilcnt_t,
83 pub f_ffree: ::fsfilcnt_t,
84 pub f_fsid: ::fsid_t,
85 pub f_namelen: ::c_ulong,
86 pub f_frsize: ::c_ulong,
87 pub f_flags: ::c_ulong,
88 pub f_spare: [::c_ulong; 4],
89 }
90
91 pub struct msghdr {
92 pub msg_name: *mut ::c_void,
93 pub msg_namelen: ::socklen_t,
94 pub msg_iov: *mut ::iovec,
A. Wilcox06bf3632018-12-05 11:38:05 -060095 #[cfg(target_endian = "big")]
96 __pad1: ::c_int,
Alex Crichton8a8bc662016-02-29 23:02:36 -080097 pub msg_iovlen: ::c_int,
A. Wilcox06bf3632018-12-05 11:38:05 -060098 #[cfg(target_endian = "little")]
Alex Crichton8a8bc662016-02-29 23:02:36 -080099 __pad1: ::c_int,
100 pub msg_control: *mut ::c_void,
A. Wilcox06bf3632018-12-05 11:38:05 -0600101 #[cfg(target_endian = "big")]
102 __pad2: ::c_int,
Alex Crichton8a8bc662016-02-29 23:02:36 -0800103 pub msg_controllen: ::socklen_t,
A. Wilcox06bf3632018-12-05 11:38:05 -0600104 #[cfg(target_endian = "little")]
105 __pad2: ::c_int,
Alex Crichton8a8bc662016-02-29 23:02:36 -0800106 pub msg_flags: ::c_int,
107 }
Steven Fackler41699f72016-06-03 21:02:56 -0700108
Guillaume Gomez7d2aea92016-12-04 10:32:42 -0800109 pub struct cmsghdr {
A. Wilcox06bf3632018-12-05 11:38:05 -0600110 #[cfg(target_endian = "big")]
111 pub __pad1: ::c_int,
Guillaume Gomez7d2aea92016-12-04 10:32:42 -0800112 pub cmsg_len: ::socklen_t,
A. Wilcox06bf3632018-12-05 11:38:05 -0600113 #[cfg(target_endian = "little")]
Guillaume Gomez7d2aea92016-12-04 10:32:42 -0800114 pub __pad1: ::c_int,
115 pub cmsg_level: ::c_int,
116 pub cmsg_type: ::c_int,
117 }
118
Steven Fackler41699f72016-06-03 21:02:56 -0700119 pub struct sem_t {
120 __val: [::c_int; 8],
121 }
Alex Crichtoned32e3f2016-08-28 11:53:09 -0700122
123 pub struct siginfo_t {
124 pub si_signo: ::c_int,
125 pub si_errno: ::c_int,
126 pub si_code: ::c_int,
127 pub _pad: [::c_int; 29],
128 _align: [usize; 0],
129 }
Alex Crichton8a8bc662016-02-29 23:02:36 -0800130}
131
Brian Anderson773aab82015-12-29 20:00:29 +0000132pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
133pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
134
Jorge Aparicio751bea32016-01-30 01:28:50 -0500135pub const O_ASYNC: ::c_int = 0x2000;
136
Jorge Aparicio751bea32016-01-30 01:28:50 -0500137pub const RLIMIT_RSS: ::c_int = 5;
138pub const RLIMIT_NOFILE: ::c_int = 7;
139pub const RLIMIT_AS: ::c_int = 9;
140pub const RLIMIT_NPROC: ::c_int = 6;
141pub const RLIMIT_MEMLOCK: ::c_int = 8;
142
143pub const O_APPEND: ::c_int = 1024;
144pub const O_CREAT: ::c_int = 64;
145pub const O_EXCL: ::c_int = 128;
146pub const O_NOCTTY: ::c_int = 256;
147pub const O_NONBLOCK: ::c_int = 2048;
148pub const O_SYNC: ::c_int = 1052672;
149pub const O_RSYNC: ::c_int = 1052672;
150pub const O_DSYNC: ::c_int = 4096;
151
152pub const SOCK_NONBLOCK: ::c_int = 2048;
153
154pub const MAP_ANON: ::c_int = 0x0020;
155pub const MAP_GROWSDOWN: ::c_int = 0x0100;
156pub const MAP_DENYWRITE: ::c_int = 0x0800;
157pub const MAP_EXECUTABLE: ::c_int = 0x01000;
158pub const MAP_LOCKED: ::c_int = 0x02000;
159pub const MAP_NORESERVE: ::c_int = 0x04000;
160pub const MAP_POPULATE: ::c_int = 0x08000;
161pub const MAP_NONBLOCK: ::c_int = 0x010000;
162pub const MAP_STACK: ::c_int = 0x020000;
163
164pub const SOCK_STREAM: ::c_int = 1;
165pub const SOCK_DGRAM: ::c_int = 2;
Rick Richardsondf0a9ba2016-05-26 23:52:00 -0400166pub const SOCK_SEQPACKET: ::c_int = 5;
Jorge Aparicio751bea32016-01-30 01:28:50 -0500167
168pub const SOL_SOCKET: ::c_int = 1;
169
Jorge Aparicio751bea32016-01-30 01:28:50 -0500170pub const ENAMETOOLONG: ::c_int = 36;
171pub const ENOLCK: ::c_int = 37;
172pub const ENOSYS: ::c_int = 38;
173pub const ENOTEMPTY: ::c_int = 39;
174pub const ELOOP: ::c_int = 40;
175pub const ENOMSG: ::c_int = 42;
176pub const EIDRM: ::c_int = 43;
177pub const ECHRNG: ::c_int = 44;
178pub const EL2NSYNC: ::c_int = 45;
179pub const EL3HLT: ::c_int = 46;
180pub const EL3RST: ::c_int = 47;
181pub const ELNRNG: ::c_int = 48;
182pub const EUNATCH: ::c_int = 49;
183pub const ENOCSI: ::c_int = 50;
184pub const EL2HLT: ::c_int = 51;
185pub const EBADE: ::c_int = 52;
186pub const EBADR: ::c_int = 53;
187pub const EXFULL: ::c_int = 54;
188pub const ENOANO: ::c_int = 55;
189pub const EBADRQC: ::c_int = 56;
190pub const EBADSLT: ::c_int = 57;
Jorge Aparicio751bea32016-01-30 01:28:50 -0500191pub const EMULTIHOP: ::c_int = 72;
192pub const EBADMSG: ::c_int = 74;
193pub const EOVERFLOW: ::c_int = 75;
194pub const ENOTUNIQ: ::c_int = 76;
195pub const EBADFD: ::c_int = 77;
196pub const EREMCHG: ::c_int = 78;
197pub const ELIBACC: ::c_int = 79;
198pub const ELIBBAD: ::c_int = 80;
199pub const ELIBSCN: ::c_int = 81;
200pub const ELIBMAX: ::c_int = 82;
201pub const ELIBEXEC: ::c_int = 83;
202pub const EILSEQ: ::c_int = 84;
203pub const ERESTART: ::c_int = 85;
204pub const ESTRPIPE: ::c_int = 86;
205pub const EUSERS: ::c_int = 87;
206pub const ENOTSOCK: ::c_int = 88;
207pub const EDESTADDRREQ: ::c_int = 89;
208pub const EMSGSIZE: ::c_int = 90;
209pub const EPROTOTYPE: ::c_int = 91;
210pub const ENOPROTOOPT: ::c_int = 92;
211pub const EPROTONOSUPPORT: ::c_int = 93;
212pub const ESOCKTNOSUPPORT: ::c_int = 94;
213pub const EOPNOTSUPP: ::c_int = 95;
Steven Allen8c3e6ba2016-11-11 11:00:16 -0800214pub const ENOTSUP: ::c_int = EOPNOTSUPP;
Jorge Aparicio751bea32016-01-30 01:28:50 -0500215pub const EPFNOSUPPORT: ::c_int = 96;
216pub const EAFNOSUPPORT: ::c_int = 97;
217pub const EADDRINUSE: ::c_int = 98;
218pub const EADDRNOTAVAIL: ::c_int = 99;
219pub const ENETDOWN: ::c_int = 100;
220pub const ENETUNREACH: ::c_int = 101;
221pub const ENETRESET: ::c_int = 102;
222pub const ECONNABORTED: ::c_int = 103;
223pub const ECONNRESET: ::c_int = 104;
224pub const ENOBUFS: ::c_int = 105;
225pub const EISCONN: ::c_int = 106;
226pub const ENOTCONN: ::c_int = 107;
227pub const ESHUTDOWN: ::c_int = 108;
228pub const ETOOMANYREFS: ::c_int = 109;
229pub const ETIMEDOUT: ::c_int = 110;
230pub const ECONNREFUSED: ::c_int = 111;
231pub const EHOSTDOWN: ::c_int = 112;
232pub const EHOSTUNREACH: ::c_int = 113;
233pub const EALREADY: ::c_int = 114;
234pub const EINPROGRESS: ::c_int = 115;
235pub const ESTALE: ::c_int = 116;
236pub const EUCLEAN: ::c_int = 117;
237pub const ENOTNAM: ::c_int = 118;
238pub const ENAVAIL: ::c_int = 119;
239pub const EISNAM: ::c_int = 120;
240pub const EREMOTEIO: ::c_int = 121;
241pub const EDQUOT: ::c_int = 122;
242pub const ENOMEDIUM: ::c_int = 123;
243pub const EMEDIUMTYPE: ::c_int = 124;
244pub const ECANCELED: ::c_int = 125;
245pub const ENOKEY: ::c_int = 126;
246pub const EKEYEXPIRED: ::c_int = 127;
247pub const EKEYREVOKED: ::c_int = 128;
248pub const EKEYREJECTED: ::c_int = 129;
249pub const EOWNERDEAD: ::c_int = 130;
250pub const ENOTRECOVERABLE: ::c_int = 131;
251pub const ERFKILL: ::c_int = 132;
252pub const EHWPOISON: ::c_int = 133;
253
254pub const SO_REUSEADDR: ::c_int = 2;
255pub const SO_TYPE: ::c_int = 3;
256pub const SO_ERROR: ::c_int = 4;
257pub const SO_DONTROUTE: ::c_int = 5;
258pub const SO_BROADCAST: ::c_int = 6;
259pub const SO_SNDBUF: ::c_int = 7;
260pub const SO_RCVBUF: ::c_int = 8;
261pub const SO_KEEPALIVE: ::c_int = 9;
262pub const SO_OOBINLINE: ::c_int = 10;
Zac Berkowitz1479ea82017-02-28 03:59:17 +0000263pub const SO_NO_CHECK: ::c_int = 11;
264pub const SO_PRIORITY: ::c_int = 12;
Jorge Aparicio751bea32016-01-30 01:28:50 -0500265pub const SO_LINGER: ::c_int = 13;
Zac Berkowitz1479ea82017-02-28 03:59:17 +0000266pub const SO_BSDCOMPAT: ::c_int = 14;
Jorge Aparicio751bea32016-01-30 01:28:50 -0500267pub const SO_REUSEPORT: ::c_int = 15;
Jorge Aparicio751bea32016-01-30 01:28:50 -0500268pub const SO_ACCEPTCONN: ::c_int = 30;
Zac Berkowitz1479ea82017-02-28 03:59:17 +0000269pub const SO_SNDBUFFORCE: ::c_int = 32;
270pub const SO_RCVBUFFORCE: ::c_int = 33;
271pub const SO_PROTOCOL: ::c_int = 38;
272pub const SO_DOMAIN: ::c_int = 39;
Jorge Aparicio751bea32016-01-30 01:28:50 -0500273
274pub const SA_ONSTACK: ::c_int = 0x08000000;
275pub const SA_SIGINFO: ::c_int = 0x00000004;
276pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
277
278pub const SIGCHLD: ::c_int = 17;
279pub const SIGBUS: ::c_int = 7;
280pub const SIGTTIN: ::c_int = 21;
281pub const SIGTTOU: ::c_int = 22;
282pub const SIGXCPU: ::c_int = 24;
283pub const SIGXFSZ: ::c_int = 25;
284pub const SIGVTALRM: ::c_int = 26;
285pub const SIGPROF: ::c_int = 27;
286pub const SIGWINCH: ::c_int = 28;
287pub const SIGUSR1: ::c_int = 10;
288pub const SIGUSR2: ::c_int = 12;
289pub const SIGCONT: ::c_int = 18;
290pub const SIGSTOP: ::c_int = 19;
291pub const SIGTSTP: ::c_int = 20;
292pub const SIGURG: ::c_int = 23;
293pub const SIGIO: ::c_int = 29;
294pub const SIGSYS: ::c_int = 31;
295pub const SIGSTKFLT: ::c_int = 16;
296pub const SIGPOLL: ::c_int = 29;
297pub const SIGPWR: ::c_int = 30;
298pub const SIG_SETMASK: ::c_int = 2;
299pub const SIG_BLOCK: ::c_int = 0x000000;
300pub const SIG_UNBLOCK: ::c_int = 0x01;
301
Jorge Aparicio751bea32016-01-30 01:28:50 -0500302pub const MAP_HUGETLB: ::c_int = 0x040000;
303
Brian Anderson773aab82015-12-29 20:00:29 +0000304pub const F_GETLK: ::c_int = 5;
Jorge Aparicio751bea32016-01-30 01:28:50 -0500305pub const F_GETOWN: ::c_int = 9;
Brian Anderson773aab82015-12-29 20:00:29 +0000306pub const F_SETLK: ::c_int = 6;
307pub const F_SETLKW: ::c_int = 7;
Jorge Aparicio751bea32016-01-30 01:28:50 -0500308pub const F_SETOWN: ::c_int = 8;
309
310pub const VEOF: usize = 4;
Brian Anderson773aab82015-12-29 20:00:29 +0000311
Alex Crichtoned32e3f2016-08-28 11:53:09 -0700312pub const POLLWRNORM: ::c_short = 0x100;
313pub const POLLWRBAND: ::c_short = 0x200;
314
Kamal Marhubif9347242016-03-10 14:47:03 -0500315cfg_if! {
316 if #[cfg(target_arch = "aarch64")] {
317 mod aarch64;
318 pub use self::aarch64::*;
319 } else if #[cfg(any(target_arch = "powerpc64"))] {
320 mod powerpc64;
321 pub use self::powerpc64::*;
322 } else if #[cfg(any(target_arch = "x86_64"))] {
323 mod x86_64;
324 pub use self::x86_64::*;
325 } else {
326 // Unknown target_arch
327 }
328}