Skip to content

Commit

Permalink
adding new syscall id fchmodat2 for glibc/musl x86 (kernel >= 6.6).
Browse files Browse the repository at this point in the history
(backport <rust-lang#3588>)
(cherry picked from commit 14bc9fb)
  • Loading branch information
devnexen authored and tgross35 committed Aug 29, 2024
1 parent 567c854 commit 839bfc2
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4210,6 +4210,9 @@ fn test_linux(target: &str) {
true
}

// FIXME: Requires >= 6.6 kernel headers.
"SYS_fchmodat2" => true,

// FIXME: seems to not be available all the time (from <include/linux/sched.h>:
"PF_VCPU"
| "PF_IDLE"
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b32/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,7 @@ 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_fchmodat2: ::c_long = 452;

// offsets in user_regs_structs, from sys/reg.h
pub const EBX: ::c_int = 0;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ 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_fchmodat2: ::c_long = 452;

extern "C" {
pub fn sysctl(
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ pub const SYS_memfd_secret: ::c_long = __X32_SYSCALL_BIT + 447;
pub const SYS_process_mrelease: ::c_long = __X32_SYSCALL_BIT + 448;
pub const SYS_futex_waitv: ::c_long = __X32_SYSCALL_BIT + 449;
pub const SYS_set_mempolicy_home_node: ::c_long = __X32_SYSCALL_BIT + 450;
pub const SYS_fchmodat2: ::c_long = __X32_SYSCALL_BIT + 452;
pub const SYS_rt_sigaction: ::c_long = __X32_SYSCALL_BIT + 512;
pub const SYS_rt_sigreturn: ::c_long = __X32_SYSCALL_BIT + 513;
pub const SYS_ioctl: ::c_long = __X32_SYSCALL_BIT + 514;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b32/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ 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_fchmodat2: ::c_long = 452;

// offsets in user_regs_structs, from sys/reg.h
pub const EBX: ::c_int = 0;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ 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_fchmodat2: ::c_long = 452;

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

0 comments on commit 839bfc2

Please sign in to comment.