Skip to content

Commit da92ffc

Browse files
tgross35AkhilTThomas
authored andcommitted
Merge pull request rust-lang#3850 from tgross35/backport-android-constants
[0.2] Backport android constants
2 parents 6a2adb6 + 5428ffe commit da92ffc

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

src/unix/linux_like/android/b32/arm.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ pub const NGREG: c_int = 18;
539539
// From NDK's asm/auxvec.h
540540
pub const AT_SYSINFO_EHDR: c_ulong = 33;
541541

542+
// From NDK's asm/auxvec.h
543+
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
544+
542545
f! {
543546
// Sadly, Android before 5.0 (API level 21), the accept4 syscall is not
544547
// exposed by the libc. As work-around, we implement it through `syscall`

src/unix/linux_like/android/b32/x86/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,11 @@ pub const AT_SYSINFO: c_ulong = 32;
603603
pub const AT_SYSINFO_EHDR: c_ulong = 33;
604604
pub const AT_VECTOR_SIZE_ARCH: c_ulong = 3;
605605

606+
// From NDK's asm/auxvec.h
607+
pub const AT_SYSINFO: ::c_ulong = 32;
608+
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
609+
pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 3;
610+
606611
// socketcall values from linux/net.h (only the needed ones, and not public)
607612
const SYS_ACCEPT4: c_int = 18;
608613

src/unix/linux_like/android/mod.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3538,6 +3538,34 @@ pub const KLOG_CONSOLE_LEVEL: ::c_int = 8;
35383538
pub const KLOG_SIZE_UNREAD: ::c_int = 9;
35393539
pub const KLOG_SIZE_BUFFER: ::c_int = 10;
35403540

3541+
// From NDK's linux/auxvec.h
3542+
pub const AT_NULL: ::c_ulong = 0;
3543+
pub const AT_IGNORE: ::c_ulong = 1;
3544+
pub const AT_EXECFD: ::c_ulong = 2;
3545+
pub const AT_PHDR: ::c_ulong = 3;
3546+
pub const AT_PHENT: ::c_ulong = 4;
3547+
pub const AT_PHNUM: ::c_ulong = 5;
3548+
pub const AT_PAGESZ: ::c_ulong = 6;
3549+
pub const AT_BASE: ::c_ulong = 7;
3550+
pub const AT_FLAGS: ::c_ulong = 8;
3551+
pub const AT_ENTRY: ::c_ulong = 9;
3552+
pub const AT_NOTELF: ::c_ulong = 10;
3553+
pub const AT_UID: ::c_ulong = 11;
3554+
pub const AT_EUID: ::c_ulong = 12;
3555+
pub const AT_GID: ::c_ulong = 13;
3556+
pub const AT_EGID: ::c_ulong = 14;
3557+
pub const AT_PLATFORM: ::c_ulong = 15;
3558+
pub const AT_HWCAP: ::c_ulong = 16;
3559+
pub const AT_CLKTCK: ::c_ulong = 17;
3560+
pub const AT_SECURE: ::c_ulong = 23;
3561+
pub const AT_BASE_PLATFORM: ::c_ulong = 24;
3562+
pub const AT_RANDOM: ::c_ulong = 25;
3563+
pub const AT_HWCAP2: ::c_ulong = 26;
3564+
pub const AT_RSEQ_FEATURE_SIZE: ::c_ulong = 27;
3565+
pub const AT_RSEQ_ALIGN: ::c_ulong = 28;
3566+
pub const AT_EXECFN: ::c_ulong = 31;
3567+
pub const AT_MINSIGSTKSZ: ::c_ulong = 51;
3568+
35413569
// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
35423570
// following are only available on newer Linux versions than the versions
35433571
// currently used in CI in some configurations, so we define them here.

0 commit comments

Comments
 (0)