Skip to content

Commit 8e58e82

Browse files
committed
Add SYS_pidfd_open and SYS_clone3
These syscalls were added recently, and therefore have consistent numbers across different architetures (other than the weird offsetting on some platforms).
1 parent 999e5e1 commit 8e58e82

File tree

14 files changed

+35
-0
lines changed

14 files changed

+35
-0
lines changed

libc-test/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,6 +2649,13 @@ fn test_linux(target: &str) {
26492649
// headers.
26502650
"P_PIDFD" => true,
26512651

2652+
// FIXME: Not currently available in headers
2653+
"SYS_pidfd_open" if mips => true,
2654+
2655+
// FIXME: Not currently available in headers on MIPS
2656+
// Not yet implemented on sparc64
2657+
"SYS_clone3" if mips | sparc64 => true,
2658+
26522659
_ => false,
26532660
}
26542661
});

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,8 @@ pub const SYS_pkey_mprotect: ::c_long = 394;
868868
pub const SYS_pkey_alloc: ::c_long = 395;
869869
pub const SYS_pkey_free: ::c_long = 396;
870870
pub const SYS_statx: ::c_long = 397;
871+
pub const SYS_pidfd_open: ::c_long = 434;
872+
pub const SYS_clone3: ::c_long = 435;
871873

872874
cfg_if! {
873875
if #[cfg(libc_align)] {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,8 @@ pub const SYS_pkey_mprotect: ::c_long = 4000 + 363;
527527
pub const SYS_pkey_alloc: ::c_long = 4000 + 364;
528528
pub const SYS_pkey_free: ::c_long = 4000 + 365;
529529
pub const SYS_statx: ::c_long = 4000 + 366;
530+
pub const SYS_pidfd_open: ::c_long = 4000 + 434;
531+
pub const SYS_clone3: ::c_long = 4000 + 435;
530532

531533
pub const O_DIRECT: ::c_int = 0x8000;
532534
pub const O_DIRECTORY: ::c_int = 0x10000;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,3 +872,5 @@ pub const SYS_preadv2: ::c_long = 380;
872872
pub const SYS_pwritev2: ::c_long = 381;
873873
pub const SYS_kexec_file_load: ::c_long = 382;
874874
pub const SYS_statx: ::c_long = 383;
875+
pub const SYS_pidfd_open: ::c_long = 434;
876+
pub const SYS_clone3: ::c_long = 435;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,9 @@ pub const SYS_copy_file_range: ::c_long = 357;
961961
pub const SYS_preadv2: ::c_long = 358;
962962
pub const SYS_pwritev2: ::c_long = 359;
963963
pub const SYS_statx: ::c_long = 360;
964+
pub const SYS_pidfd_open: ::c_long = 434;
965+
// Reserved in the kernel, but not actually implemented yet
966+
pub const SYS_clone3: ::c_long = 435;
964967

965968
#[link(name = "util")]
966969
extern "C" {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,8 @@ pub const SYS_pkey_mprotect: ::c_long = 380;
11031103
pub const SYS_pkey_alloc: ::c_long = 381;
11041104
pub const SYS_pkey_free: ::c_long = 382;
11051105
pub const SYS_statx: ::c_long = 383;
1106+
pub const SYS_pidfd_open: ::c_long = 434;
1107+
pub const SYS_clone3: ::c_long = 435;
11061108

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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,8 @@ pub const SYS_pkey_mprotect: ::c_long = 288;
987987
pub const SYS_pkey_alloc: ::c_long = 289;
988988
pub const SYS_pkey_free: ::c_long = 290;
989989
pub const SYS_statx: ::c_long = 291;
990+
pub const SYS_pidfd_open: ::c_long = 434;
991+
pub const SYS_clone3: ::c_long = 435;
990992

991993
#[link(name = "util")]
992994
extern "C" {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,8 @@ pub const SYS_pkey_mprotect: ::c_long = 5000 + 323;
577577
pub const SYS_pkey_alloc: ::c_long = 5000 + 324;
578578
pub const SYS_pkey_free: ::c_long = 5000 + 325;
579579
pub const SYS_statx: ::c_long = 5000 + 326;
580+
pub const SYS_pidfd_open: ::c_long = 5000 + 434;
581+
pub const SYS_clone3: ::c_long = 5000 + 435;
580582

581583
pub const SFD_CLOEXEC: ::c_int = 0x080000;
582584

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,8 @@ pub const SYS_preadv2: ::c_long = 380;
10371037
pub const SYS_pwritev2: ::c_long = 381;
10381038
pub const SYS_kexec_file_load: ::c_long = 382;
10391039
pub const SYS_statx: ::c_long = 383;
1040+
pub const SYS_pidfd_open: ::c_long = 434;
1041+
pub const SYS_clone3: ::c_long = 435;
10401042

10411043
#[link(name = "util")]
10421044
extern "C" {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,3 +857,5 @@ pub const SYS_pkey_mprotect: ::c_long = 288;
857857
pub const SYS_pkey_alloc: ::c_long = 289;
858858
pub const SYS_pkey_free: ::c_long = 290;
859859
pub const SYS_statx: ::c_long = 291;
860+
pub const SYS_pidfd_open: ::c_long = 434;
861+
pub const SYS_clone3: ::c_long = 435;

0 commit comments

Comments
 (0)