Skip to content

Commit 7f9ed8c

Browse files
committed
Add getauxval for 64-bit Android
1 parent 96e6147 commit 7f9ed8c

File tree

1 file changed

+29
-0
lines changed
  • src/unix/linux_like/android/b64

1 file changed

+29
-0
lines changed

src/unix/linux_like/android/b64/mod.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,31 @@ pub const RTLD_GLOBAL: ::c_int = 0x00100;
256256
pub const RTLD_NOW: ::c_int = 2;
257257
pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
258258

259+
// From NDK's linux/auxvec.h
260+
pub const AT_NULL: ::c_ulong = 0;
261+
pub const AT_IGNORE: ::c_ulong = 1;
262+
pub const AT_EXECFD: ::c_ulong = 2;
263+
pub const AT_PHDR: ::c_ulong = 3;
264+
pub const AT_PHENT: ::c_ulong = 4;
265+
pub const AT_PHNUM: ::c_ulong = 5;
266+
pub const AT_PAGESZ: ::c_ulong = 6;
267+
pub const AT_BASE: ::c_ulong = 7;
268+
pub const AT_FLAGS: ::c_ulong = 8;
269+
pub const AT_ENTRY: ::c_ulong = 9;
270+
pub const AT_NOTELF: ::c_ulong = 10;
271+
pub const AT_UID: ::c_ulong = 11;
272+
pub const AT_EUID: ::c_ulong = 12;
273+
pub const AT_GID: ::c_ulong = 13;
274+
pub const AT_EGID: ::c_ulong = 14;
275+
pub const AT_PLATFORM: ::c_ulong = 15;
276+
pub const AT_HWCAP: ::c_ulong = 16;
277+
pub const AT_CLKTCK: ::c_ulong = 17;
278+
pub const AT_SECURE: ::c_ulong = 23;
279+
pub const AT_BASE_PLATFORM: ::c_ulong = 24;
280+
pub const AT_RANDOM: ::c_ulong = 25;
281+
pub const AT_HWCAP2: ::c_ulong = 26;
282+
pub const AT_EXECFN: ::c_ulong = 31;
283+
259284
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
260285
value: 0,
261286
__reserved: [0; 36],
@@ -280,6 +305,10 @@ pub const UT_LINESIZE: usize = 32;
280305
pub const UT_NAMESIZE: usize = 32;
281306
pub const UT_HOSTSIZE: usize = 256;
282307

308+
extern "C" {
309+
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
310+
}
311+
283312
cfg_if! {
284313
if #[cfg(target_arch = "x86_64")] {
285314
mod x86_64;

0 commit comments

Comments
 (0)