Skip to content

Commit 1716138

Browse files
yujincheng08tgross35
authored andcommitted
android: add missing syscall constants
This adds all syscall constants that are available in NDK `r26` but were so far missing in this library. See `semver/android.txt` changes for the complete list. Refs: * https://android.googlesource.com/platform/bionic/+/refs/tags/ndk-r26/libc/kernel/uapi/asm-generic/unistd.h * https://android.googlesource.com/platform/bionic/+/refs/tags/ndk-r26/libc/include/bits/glibc-syscalls.h (backport <rust-lang#3558>) (cherry picked from commit e89781f)
1 parent bd40454 commit 1716138

File tree

8 files changed

+103
-2
lines changed

8 files changed

+103
-2
lines changed

libc-test/semver/android-aarch64.txt

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ PROT_MTE
1414
SYS_arch_specific_syscall
1515
SYS_fcntl
1616
SYS_lseek
17+
SYS_memfd_secret
1718
SYS_mmap
1819
SYS_syscalls
1920
__system_property_wait

libc-test/semver/android-x86_64.txt

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ SYS_arch_prctl
4646
SYS_epoll_ctl_old
4747
SYS_epoll_wait_old
4848
SYS_kexec_file_load
49+
SYS_memfd_secret
4950
SYS_msgctl
5051
SYS_msgget
5152
SYS_msgrcv

libc-test/semver/android.txt

+16
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,9 @@ SYS_clock_gettime
24882488
SYS_clock_nanosleep
24892489
SYS_clock_settime
24902490
SYS_clone
2491+
SYS_clone3
24912492
SYS_close
2493+
SYS_close_range
24922494
SYS_connect
24932495
SYS_copy_file_range
24942496
SYS_delete_module
@@ -2497,12 +2499,14 @@ SYS_dup3
24972499
SYS_epoll_create1
24982500
SYS_epoll_ctl
24992501
SYS_epoll_pwait
2502+
SYS_epoll_pwait2
25002503
SYS_eventfd2
25012504
SYS_execve
25022505
SYS_execveat
25032506
SYS_exit
25042507
SYS_exit_group
25052508
SYS_faccessat
2509+
SYS_faccessat2
25062510
SYS_fallocate
25072511
SYS_fanotify_init
25082512
SYS_fanotify_mark
@@ -2524,6 +2528,7 @@ SYS_fsopen
25242528
SYS_fspick
25252529
SYS_fsync
25262530
SYS_futex
2531+
SYS_futex_waitv
25272532
SYS_get_mempolicy
25282533
SYS_get_robust_list
25292534
SYS_getcpu
@@ -2569,6 +2574,9 @@ SYS_kcmp
25692574
SYS_kexec_load
25702575
SYS_keyctl
25712576
SYS_kill
2577+
SYS_landlock_add_rule
2578+
SYS_landlock_create_ruleset
2579+
SYS_landlock_restrict_self
25722580
SYS_lgetxattr
25732581
SYS_linkat
25742582
SYS_listen
@@ -2588,6 +2596,7 @@ SYS_mlock
25882596
SYS_mlock2
25892597
SYS_mlockall
25902598
SYS_mount
2599+
SYS_mount_setattr
25912600
SYS_move_mount
25922601
SYS_move_pages
25932602
SYS_mprotect
@@ -2608,8 +2617,11 @@ SYS_nfsservctl
26082617
SYS_open_by_handle_at
26092618
SYS_open_tree
26102619
SYS_openat
2620+
SYS_openat2
26112621
SYS_perf_event_open
26122622
SYS_personality
2623+
SYS_pidfd_getfd
2624+
SYS_pidfd_open
26132625
SYS_pidfd_send_signal
26142626
SYS_pipe2
26152627
SYS_pivot_root
@@ -2622,6 +2634,8 @@ SYS_pread64
26222634
SYS_preadv
26232635
SYS_preadv2
26242636
SYS_prlimit64
2637+
SYS_process_madvise
2638+
SYS_process_mrelease
26252639
SYS_process_vm_readv
26262640
SYS_process_vm_writev
26272641
SYS_pselect6
@@ -2630,6 +2644,7 @@ SYS_pwrite64
26302644
SYS_pwritev
26312645
SYS_pwritev2
26322646
SYS_quotactl
2647+
SYS_quotactl_fd
26332648
SYS_read
26342649
SYS_readahead
26352650
SYS_readlinkat
@@ -2669,6 +2684,7 @@ SYS_sendmmsg
26692684
SYS_sendmsg
26702685
SYS_sendto
26712686
SYS_set_mempolicy
2687+
SYS_set_mempolicy_home_node
26722688
SYS_set_robust_list
26732689
SYS_set_tid_address
26742690
SYS_setdomainname

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

+16
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,22 @@ pub const SYS_fsopen: ::c_long = 430;
508508
pub const SYS_fsconfig: ::c_long = 431;
509509
pub const SYS_fsmount: ::c_long = 432;
510510
pub const SYS_fspick: ::c_long = 433;
511+
pub const SYS_pidfd_open: ::c_long = 434;
512+
pub const SYS_clone3: ::c_long = 435;
513+
pub const SYS_close_range: ::c_long = 436;
514+
pub const SYS_openat2: ::c_long = 437;
515+
pub const SYS_pidfd_getfd: ::c_long = 438;
516+
pub const SYS_faccessat2: ::c_long = 439;
517+
pub const SYS_process_madvise: ::c_long = 440;
518+
pub const SYS_epoll_pwait2: ::c_long = 441;
519+
pub const SYS_mount_setattr: ::c_long = 442;
520+
pub const SYS_quotactl_fd: ::c_long = 443;
521+
pub const SYS_landlock_create_ruleset: ::c_long = 444;
522+
pub const SYS_landlock_add_rule: ::c_long = 445;
523+
pub const SYS_landlock_restrict_self: ::c_long = 446;
524+
pub const SYS_process_mrelease: ::c_long = 448;
525+
pub const SYS_futex_waitv: ::c_long = 449;
526+
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
511527

512528
// offsets in mcontext_t.gregs from sys/ucontext.h
513529
pub const REG_R0: ::c_int = 0;

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

+17
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,23 @@ pub const SYS_fsopen: ::c_long = 430;
546546
pub const SYS_fsconfig: ::c_long = 431;
547547
pub const SYS_fsmount: ::c_long = 432;
548548
pub const SYS_fspick: ::c_long = 433;
549+
pub const SYS_pidfd_open: ::c_long = 434;
550+
pub const SYS_clone3: ::c_long = 435;
551+
pub const SYS_close_range: ::c_long = 436;
552+
pub const SYS_openat2: ::c_long = 437;
553+
pub const SYS_pidfd_getfd: ::c_long = 438;
554+
pub const SYS_faccessat2: ::c_long = 439;
555+
pub const SYS_process_madvise: ::c_long = 440;
556+
pub const SYS_epoll_pwait2: ::c_long = 441;
557+
pub const SYS_mount_setattr: ::c_long = 442;
558+
pub const SYS_quotactl_fd: ::c_long = 443;
559+
pub const SYS_landlock_create_ruleset: ::c_long = 444;
560+
pub const SYS_landlock_add_rule: ::c_long = 445;
561+
pub const SYS_landlock_restrict_self: ::c_long = 446;
562+
pub const SYS_memfd_secret: ::c_long = 447;
563+
pub const SYS_process_mrelease: ::c_long = 448;
564+
pub const SYS_futex_waitv: ::c_long = 449;
565+
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
549566

550567
// offsets in user_regs_structs, from sys/reg.h
551568
pub const EBX: ::c_int = 0;

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

+18-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,24 @@ pub const SYS_fsopen: ::c_long = 430;
444444
pub const SYS_fsconfig: ::c_long = 431;
445445
pub const SYS_fsmount: ::c_long = 432;
446446
pub const SYS_fspick: ::c_long = 433;
447-
pub const SYS_syscalls: ::c_long = 436;
447+
pub const SYS_pidfd_open: ::c_long = 434;
448+
pub const SYS_clone3: ::c_long = 435;
449+
pub const SYS_close_range: ::c_long = 436;
450+
pub const SYS_openat2: ::c_long = 437;
451+
pub const SYS_pidfd_getfd: ::c_long = 438;
452+
pub const SYS_faccessat2: ::c_long = 439;
453+
pub const SYS_process_madvise: ::c_long = 440;
454+
pub const SYS_epoll_pwait2: ::c_long = 441;
455+
pub const SYS_mount_setattr: ::c_long = 442;
456+
pub const SYS_quotactl_fd: ::c_long = 443;
457+
pub const SYS_landlock_create_ruleset: ::c_long = 444;
458+
pub const SYS_landlock_add_rule: ::c_long = 445;
459+
pub const SYS_landlock_restrict_self: ::c_long = 446;
460+
pub const SYS_memfd_secret: ::c_long = 447;
461+
pub const SYS_process_mrelease: ::c_long = 448;
462+
pub const SYS_futex_waitv: ::c_long = 449;
463+
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
464+
pub const SYS_syscalls: ::c_long = 451;
448465

449466
pub const PROT_BTI: ::c_int = 0x10;
450467
pub const PROT_MTE: ::c_int = 0x20;

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

+17-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,23 @@ pub const SYS_fsopen: ::c_long = 430;
351351
pub const SYS_fsconfig: ::c_long = 431;
352352
pub const SYS_fsmount: ::c_long = 432;
353353
pub const SYS_fspick: ::c_long = 433;
354-
pub const SYS_syscalls: ::c_long = 436;
354+
pub const SYS_pidfd_open: ::c_long = 434;
355+
pub const SYS_clone3: ::c_long = 435;
356+
pub const SYS_close_range: ::c_long = 436;
357+
pub const SYS_openat2: ::c_long = 437;
358+
pub const SYS_pidfd_getfd: ::c_long = 438;
359+
pub const SYS_faccessat2: ::c_long = 439;
360+
pub const SYS_process_madvise: ::c_long = 440;
361+
pub const SYS_epoll_pwait2: ::c_long = 441;
362+
pub const SYS_mount_setattr: ::c_long = 442;
363+
pub const SYS_quotactl_fd: ::c_long = 443;
364+
pub const SYS_landlock_create_ruleset: ::c_long = 444;
365+
pub const SYS_landlock_add_rule: ::c_long = 445;
366+
pub const SYS_landlock_restrict_self: ::c_long = 446;
367+
pub const SYS_memfd_secret: ::c_long = 447;
368+
pub const SYS_process_mrelease: ::c_long = 448;
369+
pub const SYS_futex_waitv: ::c_long = 449;
370+
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
355371

356372
// From NDK's asm/auxvec.h
357373
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;

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

+17
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,23 @@ pub const SYS_fsopen: ::c_long = 430;
741741
pub const SYS_fsconfig: ::c_long = 431;
742742
pub const SYS_fsmount: ::c_long = 432;
743743
pub const SYS_fspick: ::c_long = 433;
744+
pub const SYS_pidfd_open: ::c_long = 434;
745+
pub const SYS_clone3: ::c_long = 435;
746+
pub const SYS_close_range: ::c_long = 436;
747+
pub const SYS_openat2: ::c_long = 437;
748+
pub const SYS_pidfd_getfd: ::c_long = 438;
749+
pub const SYS_faccessat2: ::c_long = 439;
750+
pub const SYS_process_madvise: ::c_long = 440;
751+
pub const SYS_epoll_pwait2: ::c_long = 441;
752+
pub const SYS_mount_setattr: ::c_long = 442;
753+
pub const SYS_quotactl_fd: ::c_long = 443;
754+
pub const SYS_landlock_create_ruleset: ::c_long = 444;
755+
pub const SYS_landlock_add_rule: ::c_long = 445;
756+
pub const SYS_landlock_restrict_self: ::c_long = 446;
757+
pub const SYS_memfd_secret: ::c_long = 447;
758+
pub const SYS_process_mrelease: ::c_long = 448;
759+
pub const SYS_futex_waitv: ::c_long = 449;
760+
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
744761

745762
// offsets in user_regs_structs, from sys/reg.h
746763
pub const R15: ::c_int = 0;

0 commit comments

Comments
 (0)