Skip to content

Commit a74954e

Browse files
committed
Auto merge of #2904 - cd-work:linux_syscalls, r=JohnTitor
Add new Linux system call constants This adds the latest Linux system call constants based on the Kernel's system call table: https://github.com/torvalds/linux/blob/master/arch/x86/entry/syscalls/syscall_64.tbl
2 parents c20064f + 5f5d0de commit a74954e

File tree

24 files changed

+195
-0
lines changed

24 files changed

+195
-0
lines changed

libc-test/build.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3152,6 +3152,17 @@ fn test_linux(target: &str) {
31523152
| "SYS_epoll_pwait2"
31533153
| "SYS_mount_setattr" => true,
31543154

3155+
// FIXME: these syscalls were added in Linux 5.13 or later
3156+
// and are currently not included in the glibc headers.
3157+
| "SYS_quotactl_fd"
3158+
| "SYS_landlock_create_ruleset"
3159+
| "SYS_landlock_add_rule"
3160+
| "SYS_landlock_restrict_self"
3161+
| "SYS_memfd_secret"
3162+
| "SYS_process_mrelease"
3163+
| "SYS_futex_waitv"
3164+
| "SYS_set_mempolicy_home_node" => true,
3165+
31553166
// Requires more recent kernel headers:
31563167
| "IFLA_PROP_LIST"
31573168
| "IFLA_ALT_IFNAME"

src/unix/linux_like/linux/gnu/b32/arm/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,14 @@ pub const SYS_faccessat2: ::c_long = 439;
835835
pub const SYS_process_madvise: ::c_long = 440;
836836
pub const SYS_epoll_pwait2: ::c_long = 441;
837837
pub const SYS_mount_setattr: ::c_long = 442;
838+
pub const SYS_quotactl_fd: ::c_long = 443;
839+
pub const SYS_landlock_create_ruleset: ::c_long = 444;
840+
pub const SYS_landlock_add_rule: ::c_long = 445;
841+
pub const SYS_landlock_restrict_self: ::c_long = 446;
842+
pub const SYS_memfd_secret: ::c_long = 447;
843+
pub const SYS_process_mrelease: ::c_long = 448;
844+
pub const SYS_futex_waitv: ::c_long = 449;
845+
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
838846

839847
cfg_if! {
840848
if #[cfg(libc_align)] {

src/unix/linux_like/linux/gnu/b32/mips/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,14 @@ pub const SYS_faccessat2: ::c_long = 4000 + 439;
536536
pub const SYS_process_madvise: ::c_long = 4000 + 440;
537537
pub const SYS_epoll_pwait2: ::c_long = 4000 + 441;
538538
pub const SYS_mount_setattr: ::c_long = 4000 + 442;
539+
pub const SYS_quotactl_fd: ::c_long = 4000 + 443;
540+
pub const SYS_landlock_create_ruleset: ::c_long = 4000 + 444;
541+
pub const SYS_landlock_add_rule: ::c_long = 4000 + 445;
542+
pub const SYS_landlock_restrict_self: ::c_long = 4000 + 446;
543+
pub const SYS_memfd_secret: ::c_long = 4000 + 447;
544+
pub const SYS_process_mrelease: ::c_long = 4000 + 448;
545+
pub const SYS_futex_waitv: ::c_long = 4000 + 449;
546+
pub const SYS_set_mempolicy_home_node: ::c_long = 4000 + 450;
539547

540548
pub const O_DIRECT: ::c_int = 0x8000;
541549
pub const O_DIRECTORY: ::c_int = 0x10000;

src/unix/linux_like/linux/gnu/b32/powerpc.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,3 +814,11 @@ pub const SYS_faccessat2: ::c_long = 439;
814814
pub const SYS_process_madvise: ::c_long = 440;
815815
pub const SYS_epoll_pwait2: ::c_long = 441;
816816
pub const SYS_mount_setattr: ::c_long = 442;
817+
pub const SYS_quotactl_fd: ::c_long = 443;
818+
pub const SYS_landlock_create_ruleset: ::c_long = 444;
819+
pub const SYS_landlock_add_rule: ::c_long = 445;
820+
pub const SYS_landlock_restrict_self: ::c_long = 446;
821+
pub const SYS_memfd_secret: ::c_long = 447;
822+
pub const SYS_process_mrelease: ::c_long = 448;
823+
pub const SYS_futex_waitv: ::c_long = 449;
824+
pub const SYS_set_mempolicy_home_node: ::c_long = 450;

src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,14 @@ pub const SYS_faccessat2: ::c_long = 439;
758758
pub const SYS_process_madvise: ::c_long = 440;
759759
pub const SYS_epoll_pwait2: ::c_long = 441;
760760
pub const SYS_mount_setattr: ::c_long = 442;
761+
pub const SYS_quotactl_fd: ::c_long = 443;
762+
pub const SYS_landlock_create_ruleset: ::c_long = 444;
763+
pub const SYS_landlock_add_rule: ::c_long = 445;
764+
pub const SYS_landlock_restrict_self: ::c_long = 446;
765+
pub const SYS_memfd_secret: ::c_long = 447;
766+
pub const SYS_process_mrelease: ::c_long = 448;
767+
pub const SYS_futex_waitv: ::c_long = 449;
768+
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
761769

762770
cfg_if! {
763771
if #[cfg(libc_align)] {

src/unix/linux_like/linux/gnu/b32/sparc/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,14 @@ pub const SYS_faccessat2: ::c_long = 439;
839839
pub const SYS_process_madvise: ::c_long = 440;
840840
pub const SYS_epoll_pwait2: ::c_long = 441;
841841
pub const SYS_mount_setattr: ::c_long = 442;
842+
pub const SYS_quotactl_fd: ::c_long = 443;
843+
pub const SYS_landlock_create_ruleset: ::c_long = 444;
844+
pub const SYS_landlock_add_rule: ::c_long = 445;
845+
pub const SYS_landlock_restrict_self: ::c_long = 446;
846+
pub const SYS_memfd_secret: ::c_long = 447;
847+
pub const SYS_process_mrelease: ::c_long = 448;
848+
pub const SYS_futex_waitv: ::c_long = 449;
849+
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
842850

843851
cfg_if! {
844852
if #[cfg(libc_align)] {

src/unix/linux_like/linux/gnu/b32/x86/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,14 @@ pub const SYS_faccessat2: ::c_long = 439;
10401040
pub const SYS_process_madvise: ::c_long = 440;
10411041
pub const SYS_epoll_pwait2: ::c_long = 441;
10421042
pub const SYS_mount_setattr: ::c_long = 442;
1043+
pub const SYS_quotactl_fd: ::c_long = 443;
1044+
pub const SYS_landlock_create_ruleset: ::c_long = 444;
1045+
pub const SYS_landlock_add_rule: ::c_long = 445;
1046+
pub const SYS_landlock_restrict_self: ::c_long = 446;
1047+
pub const SYS_memfd_secret: ::c_long = 447;
1048+
pub const SYS_process_mrelease: ::c_long = 448;
1049+
pub const SYS_futex_waitv: ::c_long = 449;
1050+
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
10431051

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

src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,14 @@ pub const SYS_faccessat2: ::c_long = 439;
885885
pub const SYS_process_madvise: ::c_long = 440;
886886
pub const SYS_epoll_pwait2: ::c_long = 441;
887887
pub const SYS_mount_setattr: ::c_long = 442;
888+
pub const SYS_quotactl_fd: ::c_long = 443;
889+
pub const SYS_landlock_create_ruleset: ::c_long = 444;
890+
pub const SYS_landlock_add_rule: ::c_long = 445;
891+
pub const SYS_landlock_restrict_self: ::c_long = 446;
892+
pub const SYS_memfd_secret: ::c_long = 447;
893+
pub const SYS_process_mrelease: ::c_long = 448;
894+
pub const SYS_futex_waitv: ::c_long = 449;
895+
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
888896

889897
extern "C" {
890898
pub fn sysctl(

src/unix/linux_like/linux/gnu/b64/mips64/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,14 @@ pub const SYS_faccessat2: ::c_long = 5000 + 439;
587587
pub const SYS_process_madvise: ::c_long = 5000 + 440;
588588
pub const SYS_epoll_pwait2: ::c_long = 5000 + 441;
589589
pub const SYS_mount_setattr: ::c_long = 5000 + 442;
590+
pub const SYS_quotactl_fd: ::c_long = 5000 + 443;
591+
pub const SYS_landlock_create_ruleset: ::c_long = 5000 + 444;
592+
pub const SYS_landlock_add_rule: ::c_long = 5000 + 445;
593+
pub const SYS_landlock_restrict_self: ::c_long = 5000 + 446;
594+
pub const SYS_memfd_secret: ::c_long = 5000 + 447;
595+
pub const SYS_process_mrelease: ::c_long = 5000 + 448;
596+
pub const SYS_futex_waitv: ::c_long = 5000 + 449;
597+
pub const SYS_set_mempolicy_home_node: ::c_long = 5000 + 450;
590598

591599
pub const SFD_CLOEXEC: ::c_int = 0x080000;
592600

src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,14 @@ pub const SYS_faccessat2: ::c_long = 439;
948948
pub const SYS_process_madvise: ::c_long = 440;
949949
pub const SYS_epoll_pwait2: ::c_long = 441;
950950
pub const SYS_mount_setattr: ::c_long = 442;
951+
pub const SYS_quotactl_fd: ::c_long = 443;
952+
pub const SYS_landlock_create_ruleset: ::c_long = 444;
953+
pub const SYS_landlock_add_rule: ::c_long = 445;
954+
pub const SYS_landlock_restrict_self: ::c_long = 446;
955+
pub const SYS_memfd_secret: ::c_long = 447;
956+
pub const SYS_process_mrelease: ::c_long = 448;
957+
pub const SYS_futex_waitv: ::c_long = 449;
958+
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
951959

952960
extern "C" {
953961
pub fn sysctl(

0 commit comments

Comments
 (0)