Skip to content

Commit 3e9945e

Browse files
authored
Merge pull request #1897 from Aaron1011/feature/sys-pidfd-open-clone3
Add SYS_pidfd_open and SYS_clone3
2 parents c7a095b + 8e58e82 commit 3e9945e

File tree

14 files changed

+35
-0
lines changed

14 files changed

+35
-0
lines changed

libc-test/build.rs

+7
Original file line numberDiff line numberDiff line change
@@ -2650,6 +2650,13 @@ fn test_linux(target: &str) {
26502650
// headers.
26512651
"P_PIDFD" => true,
26522652

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

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

+2
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

+2
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

+2
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

+3
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

+2
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

+2
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,8 @@ pub const SYS_pkey_mprotect: ::c_long = 288;
993993
pub const SYS_pkey_alloc: ::c_long = 289;
994994
pub const SYS_pkey_free: ::c_long = 290;
995995
pub const SYS_statx: ::c_long = 291;
996+
pub const SYS_pidfd_open: ::c_long = 434;
997+
pub const SYS_clone3: ::c_long = 435;
996998

997999
#[link(name = "util")]
9981000
extern "C" {

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

+2
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

+2
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,8 @@ pub const SYS_preadv2: ::c_long = 380;
10431043
pub const SYS_pwritev2: ::c_long = 381;
10441044
pub const SYS_kexec_file_load: ::c_long = 382;
10451045
pub const SYS_statx: ::c_long = 383;
1046+
pub const SYS_pidfd_open: ::c_long = 434;
1047+
pub const SYS_clone3: ::c_long = 435;
10461048

10471049
#[link(name = "util")]
10481050
extern "C" {

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

+2
Original file line numberDiff line numberDiff line change
@@ -863,3 +863,5 @@ pub const SYS_pkey_mprotect: ::c_long = 288;
863863
pub const SYS_pkey_alloc: ::c_long = 289;
864864
pub const SYS_pkey_free: ::c_long = 290;
865865
pub const SYS_statx: ::c_long = 291;
866+
pub const SYS_pidfd_open: ::c_long = 434;
867+
pub const SYS_clone3: ::c_long = 435;

src/unix/linux_like/linux/gnu/b64/s390x.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,8 @@ pub const SYS_setfsuid: ::c_long = 215;
10071007
pub const SYS_setfsgid: ::c_long = 216;
10081008
pub const SYS_newfstatat: ::c_long = 293;
10091009
pub const SYS_statx: ::c_long = 379;
1010+
pub const SYS_pidfd_open: ::c_long = 434;
1011+
pub const SYS_clone3: ::c_long = 435;
10101012

10111013
#[link(name = "util")]
10121014
extern "C" {

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

+3
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,9 @@ pub const SYS_copy_file_range: ::c_long = 357;
973973
pub const SYS_preadv2: ::c_long = 358;
974974
pub const SYS_pwritev2: ::c_long = 359;
975975
pub const SYS_statx: ::c_long = 360;
976+
pub const SYS_pidfd_open: ::c_long = 434;
977+
// Reserved in the kernel, but not actually implemented yet
978+
pub const SYS_clone3: ::c_long = 435;
976979

977980
#[link(name = "util")]
978981
extern "C" {

src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs

+2
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@ pub const SYS_pkey_mprotect: ::c_long = 329;
409409
pub const SYS_pkey_alloc: ::c_long = 330;
410410
pub const SYS_pkey_free: ::c_long = 331;
411411
pub const SYS_statx: ::c_long = 332;
412+
pub const SYS_pidfd_open: ::c_long = 434;
413+
pub const SYS_clone3: ::c_long = 435;
412414

413415
extern "C" {
414416
pub fn sysctl(

src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs

+2
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ pub const SYS_pkey_mprotect: ::c_long = __X32_SYSCALL_BIT + 329;
337337
pub const SYS_pkey_alloc: ::c_long = __X32_SYSCALL_BIT + 330;
338338
pub const SYS_pkey_free: ::c_long = __X32_SYSCALL_BIT + 331;
339339
pub const SYS_statx: ::c_long = __X32_SYSCALL_BIT + 332;
340+
pub const SYS_pidfd_open: ::c_long = __X32_SYSCALL_BIT + 434;
341+
pub const SYS_clone3: ::c_long = __X32_SYSCALL_BIT + 435;
340342
pub const SYS_rt_sigaction: ::c_long = __X32_SYSCALL_BIT + 512;
341343
pub const SYS_rt_sigreturn: ::c_long = __X32_SYSCALL_BIT + 513;
342344
pub const SYS_ioctl: ::c_long = __X32_SYSCALL_BIT + 514;

0 commit comments

Comments
 (0)