From 4f28420d331d1345a6498bfd0cc163e40ac5b353 Mon Sep 17 00:00:00 2001 From: evenking Date: Tue, 17 Nov 2026 20:28:33 +0800 Subject: [PATCH] android: add missing AArch64 syscall constants Add 22 missing Android/AArch64 syscall constants available in NDK r27 and update SYS_syscalls to 462. Sources: https://android.googlesource.com/platform/bionic/+/361ba86734fb2821a6adcfdf775db8abd04e0de0/libc/kernel/uapi/asm-generic/unistd.h https://android.googlesource.com/platform/bionic/+/361ba86734fb2821a6adcfdf775db8abd04e0de0/libc/include/bits/glibc-syscalls.h --- libc-test/semver/android-aarch64.txt | 22 +++++++++++++++ .../linux_like/android/b64/aarch64/mod.rs | 27 ++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/libc-test/semver/android-aarch64.txt b/libc-test/semver/android-aarch64.txt index ecc3cef4f91ee..e3ad3bb4e20dc 100644 --- a/libc-test/semver/android-aarch64.txt +++ b/libc-test/semver/android-aarch64.txt @@ -12,11 +12,33 @@ HWCAP2_SVESM4 PROT_BTI PROT_MTE SYS_arch_specific_syscall +SYS_cachestat +SYS_fadvise64 +SYS_fchmodat2 SYS_fcntl +SYS_fstat +SYS_fstatfs +SYS_ftruncate +SYS_futex_requeue +SYS_futex_wait +SYS_futex_wake +SYS_io_pgetevents +SYS_kexec_file_load +SYS_listmount SYS_lseek +SYS_lsm_get_self_attr +SYS_lsm_list_modules +SYS_lsm_set_self_attr +SYS_map_shadow_stack SYS_memfd_secret SYS_mmap +SYS_newfstatat +SYS_rseq +SYS_sendfile +SYS_statfs +SYS_statmount SYS_syscalls +SYS_truncate __system_property_wait user_fpsimd_struct user_regs_struct diff --git a/src/unix/linux_like/android/b64/aarch64/mod.rs b/src/unix/linux_like/android/b64/aarch64/mod.rs index 39918d2de2e1d..372466c0a7f7f 100644 --- a/src/unix/linux_like/android/b64/aarch64/mod.rs +++ b/src/unix/linux_like/android/b64/aarch64/mod.rs @@ -212,6 +212,10 @@ pub const SYS_umount2: c_long = 39; pub const SYS_mount: c_long = 40; pub const SYS_pivot_root: c_long = 41; pub const SYS_nfsservctl: c_long = 42; +pub const SYS_statfs: c_long = 43; +pub const SYS_fstatfs: c_long = 44; +pub const SYS_truncate: c_long = 45; +pub const SYS_ftruncate: c_long = 46; pub const SYS_fallocate: c_long = 47; pub const SYS_faccessat: c_long = 48; pub const SYS_chdir: c_long = 49; @@ -236,6 +240,7 @@ pub const SYS_pread64: c_long = 67; pub const SYS_pwrite64: c_long = 68; pub const SYS_preadv: c_long = 69; pub const SYS_pwritev: c_long = 70; +pub const SYS_sendfile: c_long = 71; pub const SYS_pselect6: c_long = 72; pub const SYS_ppoll: c_long = 73; pub const SYS_signalfd4: c_long = 74; @@ -243,6 +248,8 @@ pub const SYS_vmsplice: c_long = 75; pub const SYS_splice: c_long = 76; pub const SYS_tee: c_long = 77; pub const SYS_readlinkat: c_long = 78; +pub const SYS_newfstatat: c_long = 79; +pub const SYS_fstat: c_long = 80; pub const SYS_sync: c_long = 81; pub const SYS_fsync: c_long = 82; pub const SYS_fdatasync: c_long = 83; @@ -385,6 +392,7 @@ pub const SYS_keyctl: c_long = 219; pub const SYS_clone: c_long = 220; pub const SYS_execve: c_long = 221; pub const SYS_mmap: c_long = 222; +pub const SYS_fadvise64: c_long = 223; pub const SYS_swapon: c_long = 224; pub const SYS_swapoff: c_long = 225; pub const SYS_mprotect: c_long = 226; @@ -438,6 +446,9 @@ pub const SYS_pkey_mprotect: c_long = 288; pub const SYS_pkey_alloc: c_long = 289; pub const SYS_pkey_free: c_long = 290; pub const SYS_statx: c_long = 291; +pub const SYS_io_pgetevents: c_long = 292; +pub const SYS_rseq: c_long = 293; +pub const SYS_kexec_file_load: c_long = 294; pub const SYS_pidfd_send_signal: c_long = 424; pub const SYS_io_uring_setup: c_long = 425; pub const SYS_io_uring_enter: c_long = 426; @@ -465,7 +476,21 @@ pub const SYS_memfd_secret: c_long = 447; pub const SYS_process_mrelease: c_long = 448; pub const SYS_futex_waitv: c_long = 449; pub const SYS_set_mempolicy_home_node: c_long = 450; -pub const SYS_syscalls: c_long = 451; +pub const SYS_cachestat: c_long = 451; +pub const SYS_fchmodat2: c_long = 452; +pub const SYS_map_shadow_stack: c_long = 453; +pub const SYS_futex_wake: c_long = 454; +pub const SYS_futex_wait: c_long = 455; +pub const SYS_futex_requeue: c_long = 456; +pub const SYS_statmount: c_long = 457; +pub const SYS_listmount: c_long = 458; +pub const SYS_lsm_get_self_attr: c_long = 459; +pub const SYS_lsm_set_self_attr: c_long = 460; +pub const SYS_lsm_list_modules: c_long = 461; + +/// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines) +/// for details. +pub const SYS_syscalls: c_long = 462; pub const PROT_BTI: c_int = 0x10; pub const PROT_MTE: c_int = 0x20;