|
1 | 1 | //! Android-specific definitions for linux-like values
|
2 | 2 |
|
3 | 3 | pub type c_char = u8;
|
4 |
| -pub type c_long = i32; |
5 |
| -pub type c_ulong = u32; |
6 |
| -pub type clock_t = i32; |
7 |
| -pub type time_t = i32; |
8 |
| -pub type suseconds_t = i32; |
| 4 | +pub type clock_t = ::c_long; |
| 5 | +pub type time_t = ::c_long; |
| 6 | +pub type suseconds_t = ::c_long; |
9 | 7 | pub type wchar_t = u32;
|
10 |
| -pub type off_t = i32; |
11 |
| -pub type off64_t = i64; |
12 |
| -pub type ino_t = u32; |
13 |
| -pub type blkcnt_t = u32; |
14 |
| -pub type blksize_t = u32; |
15 |
| -pub type dev_t = u32; |
| 8 | +pub type off_t = ::c_long; |
| 9 | +pub type blkcnt_t = ::c_ulong; |
| 10 | +pub type blksize_t = ::c_ulong; |
16 | 11 | pub type nlink_t = u32;
|
17 | 12 | pub type useconds_t = u32;
|
18 | 13 | pub type socklen_t = i32;
|
19 |
| -pub type pthread_t = c_long; |
| 14 | +pub type pthread_t = ::c_long; |
20 | 15 | pub type pthread_mutexattr_t = ::c_long;
|
21 |
| -pub type sigset_t = c_ulong; |
22 |
| -pub type time64_t = i64; |
| 16 | +pub type sigset_t = ::c_ulong; |
| 17 | +pub type time64_t = i64; // N/A on android |
23 | 18 | pub type fsfilcnt_t = ::c_ulong;
|
24 | 19 | pub type fsblkcnt_t = ::c_ulong;
|
25 | 20 | pub type nfds_t = ::c_uint;
|
26 |
| -pub type rlim_t = c_ulong; |
| 21 | +pub type rlim_t = ::c_ulong; |
27 | 22 |
|
28 | 23 | s! {
|
29 | 24 | pub struct stat {
|
30 | 25 | pub st_dev: ::c_ulonglong,
|
31 | 26 | __pad0: [::c_uchar; 4],
|
32 | 27 | __st_ino: ::ino_t,
|
33 |
| - pub st_mode: ::c_uint, |
34 |
| - pub st_nlink: ::c_uint, |
| 28 | + pub st_mode: ::mode_t, |
| 29 | + pub st_nlink: ::nlink_t, |
35 | 30 | pub st_uid: ::uid_t,
|
36 | 31 | pub st_gid: ::gid_t,
|
37 | 32 | pub st_rdev: ::c_ulonglong,
|
38 | 33 | __pad3: [::c_uchar; 4],
|
39 | 34 | pub st_size: ::c_longlong,
|
40 |
| - pub st_blksize: blksize_t, |
41 |
| - pub st_blocks: ::c_ulonglong, |
42 |
| - pub st_atime: ::c_ulong, |
43 |
| - pub st_atime_nsec: ::c_ulong, |
44 |
| - pub st_mtime: ::c_ulong, |
45 |
| - pub st_mtime_nsec: ::c_ulong, |
46 |
| - pub st_ctime: ::c_ulong, |
47 |
| - pub st_ctime_nsec: ::c_ulong, |
48 |
| - pub st_ino: ::c_ulonglong, |
49 |
| - } |
50 |
| - |
51 |
| - pub struct stat64 { |
52 |
| - pub st_dev: ::c_ulonglong, |
53 |
| - __pad0: [::c_uchar; 4], |
54 |
| - __st_ino: ::ino_t, |
55 |
| - pub st_mode: ::c_uint, |
56 |
| - pub st_nlink: ::c_uint, |
57 |
| - pub st_uid: ::uid_t, |
58 |
| - pub st_gid: ::gid_t, |
59 |
| - pub st_rdev: ::c_ulonglong, |
60 |
| - __pad3: [::c_uchar; 4], |
61 |
| - pub st_size: ::c_longlong, |
62 |
| - pub st_blksize: blksize_t, |
| 35 | + pub st_blksize: ::blksize_t, |
63 | 36 | pub st_blocks: ::c_ulonglong,
|
64 | 37 | pub st_atime: ::c_ulong,
|
65 | 38 | pub st_atime_nsec: ::c_ulong,
|
|
91 | 64 | pub rlim_max: u64,
|
92 | 65 | }
|
93 | 66 |
|
94 |
| - pub struct pthread_attr_t { |
95 |
| - pub flags: ::uint32_t, |
96 |
| - pub stack_base: *mut ::c_void, |
97 |
| - pub stack_size: ::size_t, |
98 |
| - pub guard_size: ::size_t, |
99 |
| - pub sched_policy: ::int32_t, |
100 |
| - pub sched_priority: ::int32_t, |
101 |
| - } |
102 |
| - |
103 |
| - pub struct pthread_mutex_t { value: ::c_int } |
104 |
| - |
105 |
| - pub struct pthread_cond_t { value: ::c_int } |
106 |
| - |
107 |
| - pub struct pthread_rwlock_t { |
108 |
| - lock: pthread_mutex_t, |
109 |
| - cond: pthread_cond_t, |
110 |
| - numLocks: ::c_int, |
111 |
| - writerThreadId: ::c_int, |
112 |
| - pendingReaders: ::c_int, |
113 |
| - pendingWriters: ::c_int, |
114 |
| - reserved: [*mut ::c_void; 4], |
115 |
| - } |
116 |
| - |
117 |
| - pub struct passwd { |
118 |
| - pub pw_name: *mut ::c_char, |
119 |
| - pub pw_passwd: *mut ::c_char, |
120 |
| - pub pw_uid: ::uid_t, |
121 |
| - pub pw_gid: ::gid_t, |
122 |
| - pub pw_dir: *mut ::c_char, |
123 |
| - pub pw_shell: *mut ::c_char, |
124 |
| - } |
125 |
| - |
126 | 67 | pub struct stack_t {
|
127 | 68 | pub ss_sp: *mut ::c_void,
|
128 | 69 | pub ss_flags: ::c_int,
|
|
136 | 77 | pub _pad: [::c_int; 29],
|
137 | 78 | }
|
138 | 79 |
|
139 |
| - pub struct statfs { |
140 |
| - pub f_type: ::uint32_t, |
141 |
| - pub f_bsize: ::uint32_t, |
142 |
| - pub f_blocks: ::uint64_t, |
143 |
| - pub f_bfree: ::uint64_t, |
144 |
| - pub f_bavail: ::uint64_t, |
145 |
| - pub f_files: ::uint64_t, |
146 |
| - pub f_ffree: ::uint64_t, |
147 |
| - pub f_fsid: ::__fsid_t, |
148 |
| - pub f_namelen: ::uint32_t, |
149 |
| - pub f_frsize: ::uint32_t, |
150 |
| - pub f_flags: ::uint32_t, |
151 |
| - pub f_spare: [::uint32_t; 4], |
152 |
| - } |
153 |
| - |
154 | 80 | pub struct __fsid_t {
|
155 | 81 | __val: [::c_int; 2],
|
156 | 82 | }
|
@@ -251,22 +177,6 @@ pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 84;
|
251 | 177 | pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 85;
|
252 | 178 | pub const _SC_NPROCESSORS_ONLN: ::c_int = 97;
|
253 | 179 |
|
254 |
| -pub const PTHREAD_STACK_MIN: ::size_t = 8192; |
255 |
| -pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { |
256 |
| - value: 0, |
257 |
| -}; |
258 |
| -pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { |
259 |
| - value: 0, |
260 |
| -}; |
261 |
| -pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { |
262 |
| - lock: PTHREAD_MUTEX_INITIALIZER, |
263 |
| - cond: PTHREAD_COND_INITIALIZER, |
264 |
| - numLocks: 0, |
265 |
| - writerThreadId: 0, |
266 |
| - pendingReaders: 0, |
267 |
| - pendingWriters: 0, |
268 |
| - reserved: [0 as *mut _; 4], |
269 |
| -}; |
270 | 180 | pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
|
271 | 181 |
|
272 | 182 | pub const FIOCLEX: ::c_int = 0x5451;
|
|
0 commit comments