diff options
Diffstat (limited to 'third_party/libc/src/unix/notbsd/android/b32.rs')
-rw-r--r-- | third_party/libc/src/unix/notbsd/android/b32.rs | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/third_party/libc/src/unix/notbsd/android/b32.rs b/third_party/libc/src/unix/notbsd/android/b32.rs new file mode 100644 index 0000000..bd69ccf --- /dev/null +++ b/third_party/libc/src/unix/notbsd/android/b32.rs | |||
@@ -0,0 +1,151 @@ | |||
1 | pub type c_long = i32; | ||
2 | pub type c_ulong = u32; | ||
3 | pub type mode_t = u16; | ||
4 | pub type off64_t = ::c_longlong; | ||
5 | |||
6 | s! { | ||
7 | pub struct sigaction { | ||
8 | pub sa_sigaction: ::sighandler_t, | ||
9 | pub sa_mask: ::sigset_t, | ||
10 | pub sa_flags: ::c_ulong, | ||
11 | pub sa_restorer: ::dox::Option<extern fn()>, | ||
12 | } | ||
13 | |||
14 | pub struct stat { | ||
15 | pub st_dev: ::c_ulonglong, | ||
16 | __pad0: [::c_uchar; 4], | ||
17 | __st_ino: ::ino_t, | ||
18 | pub st_mode: ::c_uint, | ||
19 | pub st_nlink: ::c_uint, | ||
20 | pub st_uid: ::uid_t, | ||
21 | pub st_gid: ::gid_t, | ||
22 | pub st_rdev: ::c_ulonglong, | ||
23 | __pad3: [::c_uchar; 4], | ||
24 | pub st_size: ::c_longlong, | ||
25 | pub st_blksize: ::blksize_t, | ||
26 | pub st_blocks: ::c_ulonglong, | ||
27 | pub st_atime: ::c_ulong, | ||
28 | pub st_atime_nsec: ::c_ulong, | ||
29 | pub st_mtime: ::c_ulong, | ||
30 | pub st_mtime_nsec: ::c_ulong, | ||
31 | pub st_ctime: ::c_ulong, | ||
32 | pub st_ctime_nsec: ::c_ulong, | ||
33 | pub st_ino: ::c_ulonglong, | ||
34 | } | ||
35 | |||
36 | pub struct stat64 { | ||
37 | pub st_dev: ::c_ulonglong, | ||
38 | __pad0: [::c_uchar; 4], | ||
39 | __st_ino: ::ino_t, | ||
40 | pub st_mode: ::c_uint, | ||
41 | pub st_nlink: ::c_uint, | ||
42 | pub st_uid: ::uid_t, | ||
43 | pub st_gid: ::gid_t, | ||
44 | pub st_rdev: ::c_ulonglong, | ||
45 | __pad3: [::c_uchar; 4], | ||
46 | pub st_size: ::c_longlong, | ||
47 | pub st_blksize: ::blksize_t, | ||
48 | pub st_blocks: ::c_ulonglong, | ||
49 | pub st_atime: ::c_ulong, | ||
50 | pub st_atime_nsec: ::c_ulong, | ||
51 | pub st_mtime: ::c_ulong, | ||
52 | pub st_mtime_nsec: ::c_ulong, | ||
53 | pub st_ctime: ::c_ulong, | ||
54 | pub st_ctime_nsec: ::c_ulong, | ||
55 | pub st_ino: ::c_ulonglong, | ||
56 | } | ||
57 | |||
58 | pub struct pthread_attr_t { | ||
59 | pub flags: ::uint32_t, | ||
60 | pub stack_base: *mut ::c_void, | ||
61 | pub stack_size: ::size_t, | ||
62 | pub guard_size: ::size_t, | ||
63 | pub sched_policy: ::int32_t, | ||
64 | pub sched_priority: ::int32_t, | ||
65 | } | ||
66 | |||
67 | pub struct pthread_mutex_t { value: ::c_int } | ||
68 | |||
69 | pub struct pthread_cond_t { value: ::c_int } | ||
70 | |||
71 | pub struct pthread_rwlock_t { | ||
72 | lock: pthread_mutex_t, | ||
73 | cond: pthread_cond_t, | ||
74 | numLocks: ::c_int, | ||
75 | writerThreadId: ::c_int, | ||
76 | pendingReaders: ::c_int, | ||
77 | pendingWriters: ::c_int, | ||
78 | attr: i32, | ||
79 | __reserved: [::c_char; 12], | ||
80 | } | ||
81 | |||
82 | pub struct passwd { | ||
83 | pub pw_name: *mut ::c_char, | ||
84 | pub pw_passwd: *mut ::c_char, | ||
85 | pub pw_uid: ::uid_t, | ||
86 | pub pw_gid: ::gid_t, | ||
87 | pub pw_dir: *mut ::c_char, | ||
88 | pub pw_shell: *mut ::c_char, | ||
89 | } | ||
90 | |||
91 | pub struct statfs { | ||
92 | pub f_type: ::uint32_t, | ||
93 | pub f_bsize: ::uint32_t, | ||
94 | pub f_blocks: ::uint64_t, | ||
95 | pub f_bfree: ::uint64_t, | ||
96 | pub f_bavail: ::uint64_t, | ||
97 | pub f_files: ::uint64_t, | ||
98 | pub f_ffree: ::uint64_t, | ||
99 | pub f_fsid: ::__fsid_t, | ||
100 | pub f_namelen: ::uint32_t, | ||
101 | pub f_frsize: ::uint32_t, | ||
102 | pub f_flags: ::uint32_t, | ||
103 | pub f_spare: [::uint32_t; 4], | ||
104 | } | ||
105 | |||
106 | pub struct sysinfo { | ||
107 | pub uptime: ::c_long, | ||
108 | pub loads: [::c_ulong; 3], | ||
109 | pub totalram: ::c_ulong, | ||
110 | pub freeram: ::c_ulong, | ||
111 | pub sharedram: ::c_ulong, | ||
112 | pub bufferram: ::c_ulong, | ||
113 | pub totalswap: ::c_ulong, | ||
114 | pub freeswap: ::c_ulong, | ||
115 | pub procs: ::c_ushort, | ||
116 | pub pad: ::c_ushort, | ||
117 | pub totalhigh: ::c_ulong, | ||
118 | pub freehigh: ::c_ulong, | ||
119 | pub mem_unit: ::c_uint, | ||
120 | pub _f: [::c_char; 8], | ||
121 | } | ||
122 | } | ||
123 | |||
124 | pub const SYS_gettid: ::c_long = 224; | ||
125 | pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { | ||
126 | value: 0, | ||
127 | }; | ||
128 | pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { | ||
129 | value: 0, | ||
130 | }; | ||
131 | pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { | ||
132 | lock: PTHREAD_MUTEX_INITIALIZER, | ||
133 | cond: PTHREAD_COND_INITIALIZER, | ||
134 | numLocks: 0, | ||
135 | writerThreadId: 0, | ||
136 | pendingReaders: 0, | ||
137 | pendingWriters: 0, | ||
138 | attr: 0, | ||
139 | __reserved: [0; 12], | ||
140 | }; | ||
141 | pub const PTHREAD_STACK_MIN: ::size_t = 4096 * 2; | ||
142 | pub const CPU_SETSIZE: ::size_t = 32; | ||
143 | pub const __CPU_BITS: ::size_t = 32; | ||
144 | |||
145 | pub const UT_LINESIZE: usize = 8; | ||
146 | pub const UT_NAMESIZE: usize = 8; | ||
147 | pub const UT_HOSTSIZE: usize = 16; | ||
148 | |||
149 | extern { | ||
150 | pub fn timegm64(tm: *const ::tm) -> ::time64_t; | ||
151 | } | ||