|
1 |
| -pub type c_long = i64; |
2 |
| -pub type c_ulong = u64; |
3 |
| -pub type clock_t = i64; |
4 |
| -pub type time_t = i64; |
5 |
| -pub type suseconds_t = i64; |
| 1 | +pub type clock_t = c_long; |
| 2 | +pub type time_t = c_long; |
| 3 | +pub type suseconds_t = c_long; |
6 | 4 | pub type ino_t = u64;
|
7 | 5 | pub type off_t = i64;
|
8 | 6 | pub type blkcnt_t = i64;
|
| 7 | + |
| 8 | +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] |
9 | 9 | pub type c_char = i8;
|
10 |
| -pub type wchar_t = i32; |
11 |
| -pub type nlink_t = u64; |
12 |
| -pub type blksize_t = i64; |
13 | 10 |
|
14 |
| -s! { |
15 |
| - pub struct stat { |
16 |
| - pub st_dev: ::dev_t, |
17 |
| - pub st_ino: ::ino_t, |
18 |
| - pub st_nlink: ::nlink_t, |
19 |
| - pub st_mode: ::mode_t, |
20 |
| - pub st_uid: ::uid_t, |
21 |
| - pub st_gid: ::gid_t, |
22 |
| - __pad0: ::c_int, |
23 |
| - pub st_rdev: ::dev_t, |
24 |
| - pub st_size: ::off_t, |
25 |
| - pub st_blksize: ::blksize_t, |
26 |
| - pub st_blocks: ::blkcnt_t, |
27 |
| - pub st_atime: ::time_t, |
28 |
| - pub st_atime_nsec: ::c_long, |
29 |
| - pub st_mtime: ::time_t, |
30 |
| - pub st_mtime_nsec: ::c_long, |
31 |
| - pub st_ctime: ::time_t, |
32 |
| - pub st_ctime_nsec: ::c_long, |
33 |
| - __unused: [::c_long; 3], |
34 |
| - } |
| 11 | +#[cfg(any(target_arch = "arm", target_arch = "asmjs"))] |
| 12 | +pub type c_char = u8; |
35 | 13 |
|
36 |
| - pub struct stat64 { |
37 |
| - pub st_dev: ::dev_t, |
38 |
| - pub st_ino: ::ino64_t, |
39 |
| - pub st_nlink: ::nlink_t, |
40 |
| - pub st_mode: ::mode_t, |
41 |
| - pub st_uid: ::uid_t, |
42 |
| - pub st_gid: ::gid_t, |
43 |
| - __pad0: ::c_int, |
44 |
| - pub st_rdev: ::dev_t, |
45 |
| - pub st_size: ::off_t, |
46 |
| - pub st_blksize: ::blksize_t, |
47 |
| - pub st_blocks: ::blkcnt64_t, |
48 |
| - pub st_atime: ::time_t, |
49 |
| - pub st_atime_nsec: ::c_long, |
50 |
| - pub st_mtime: ::time_t, |
51 |
| - pub st_mtime_nsec: ::c_long, |
52 |
| - pub st_ctime: ::time_t, |
53 |
| - pub st_ctime_nsec: ::c_long, |
54 |
| - __reserved: [::c_long; 3], |
55 |
| - } |
| 14 | +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] |
| 15 | +pub type wchar_t = i32; |
56 | 16 |
|
57 |
| - pub struct pthread_attr_t { |
58 |
| - __size: [u64; 7] |
59 |
| - } |
| 17 | +#[cfg(any(target_arch = "arm", target_arch = "asmjs"))] |
| 18 | +pub type wchar_t = u32; |
60 | 19 |
|
61 |
| - pub struct sigset_t { |
62 |
| - __val: [::c_ulong; 16], |
63 |
| - } |
| 20 | +pub type nlink_t = usize; |
| 21 | +pub type blksize_t = c_long; |
| 22 | +pub type fsblkcnt_t = ::c_ulonglong; |
| 23 | +pub type fsfilcnt_t = ::c_ulonglong; |
64 | 24 |
|
| 25 | +s! { |
65 | 26 | pub struct sigaction {
|
66 | 27 | pub sa_sigaction: ::sighandler_t,
|
67 | 28 | pub sa_mask: ::sigset_t,
|
|
95 | 56 | __unused2: ::c_long
|
96 | 57 | }
|
97 | 58 |
|
98 |
| - pub struct shmid_ds { |
99 |
| - pub shm_perm: ::ipc_perm, |
100 |
| - pub shm_segsz: ::size_t, |
101 |
| - pub shm_atime: ::time_t, |
102 |
| - pub shm_dtime: ::time_t, |
103 |
| - pub shm_ctime: ::time_t, |
104 |
| - pub shm_cpid: ::pid_t, |
105 |
| - pub shm_lpid: ::pid_t, |
106 |
| - pub shm_nattch: ::c_ulong, |
107 |
| - __pad1: ::c_ulong, |
108 |
| - __pad2: ::c_ulong, |
109 |
| - } |
110 |
| - |
111 | 59 | pub struct statfs {
|
112 | 60 | pub f_type: ::c_ulong,
|
113 | 61 | pub f_bsize: ::c_ulong,
|
|
123 | 71 | pub f_spare: [::c_ulong; 4],
|
124 | 72 | }
|
125 | 73 |
|
126 |
| - pub struct msghdr { |
127 |
| - pub msg_name: *mut ::c_void, |
128 |
| - pub msg_namelen: ::socklen_t, |
129 |
| - pub msg_iov: *mut ::iovec, |
130 |
| - pub msg_iovlen: ::c_int, |
131 |
| - __pad1: ::c_int, |
132 |
| - pub msg_control: *mut ::c_void, |
133 |
| - pub msg_controllen: ::socklen_t, |
134 |
| - __pad2: ::socklen_t, |
135 |
| - pub msg_flags: ::c_int, |
136 |
| - } |
137 |
| - |
138 | 74 | pub struct termios {
|
139 | 75 | pub c_iflag: ::tcflag_t,
|
140 | 76 | pub c_oflag: ::tcflag_t,
|
@@ -353,10 +289,6 @@ pub const SIG_UNBLOCK: ::c_int = 0x01;
|
353 | 289 | pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
|
354 | 290 | pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
|
355 | 291 |
|
356 |
| -pub const _SC_2_C_VERSION: ::c_int = 96; |
357 |
| - |
358 |
| -pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; |
359 |
| -pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; |
360 | 292 | pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
|
361 | 293 |
|
362 | 294 | pub const CPU_SETSIZE: ::c_int = 128;
|
@@ -407,7 +339,6 @@ pub const PTRACE_SETREGS: ::c_uint = 13;
|
407 | 339 |
|
408 | 340 | pub const EFD_NONBLOCK: ::c_int = 0x800;
|
409 | 341 |
|
410 |
| -pub const F_GETLK: ::c_int = 5; |
411 | 342 | pub const F_GETOWN: ::c_int = 9;
|
412 | 343 | pub const F_SETOWN: ::c_int = 8;
|
413 | 344 |
|
@@ -469,3 +400,15 @@ extern {
|
469 | 400 | pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
|
470 | 401 | pub fn ptrace(request: ::c_int, ...) -> ::c_long;
|
471 | 402 | }
|
| 403 | + |
| 404 | +cfg_if! { |
| 405 | + if #[cfg(any(target_arch = "x86_64"))] { |
| 406 | + mod b64; |
| 407 | + pub use self::b64::*; |
| 408 | + } else if #[cfg(any(target_arch = "x86", |
| 409 | + target_arch = "arm", |
| 410 | + target_arch = "asmjs"))] { |
| 411 | + mod b32; |
| 412 | + pub use self::b32::*; |
| 413 | + } else { } |
| 414 | +} |
0 commit comments