Skip to content

Commit 48e4bb9

Browse files
committed
Auto merge of #1577 - oxalica:statx-syscall, r=gnzlbg
Provide SYS_statx for more target_arch/target_env Fixes #1545 The syscall `statx` is provided by Linux Kernel, so it should be available on any `target_env`/`target_arch`, not only some arch on `gnu`. Syscall ids are got from [this commit of musl](http://git.etalabs.net/cgit/musl/commit/?id=9864f60e929100e253fc813bd4105d6dd7652787), except for hexagon, which is got from Linux Kernel (`make O=build ARCH=hexagon headers`). **Not tested yet**
2 parents 2d94f3f + d211ebf commit 48e4bb9

File tree

12 files changed

+21
-4
lines changed

12 files changed

+21
-4
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ pub const SYS_pwritev2: ::c_long = 4000 + 362;
526526
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;
529+
pub const SYS_statx: ::c_long = 4000 + 366;
529530

530531
pub const O_DIRECT: ::c_int = 0x8000;
531532
pub const O_DIRECTORY: ::c_int = 0x10000;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ pub const SYS_pwritev2: ::c_long = 287;
924924
pub const SYS_pkey_mprotect: ::c_long = 288;
925925
pub const SYS_pkey_alloc: ::c_long = 289;
926926
pub const SYS_pkey_free: ::c_long = 290;
927+
pub const SYS_statx: ::c_long = 291;
927928

928929
#[link(name = "util")]
929930
extern "C" {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ pub const SYS_pwritev2: ::c_long = 5000 + 322;
568568
pub const SYS_pkey_mprotect: ::c_long = 5000 + 323;
569569
pub const SYS_pkey_alloc: ::c_long = 5000 + 324;
570570
pub const SYS_pkey_free: ::c_long = 5000 + 325;
571+
pub const SYS_statx: ::c_long = 5000 + 326;
571572

572573
pub const SFD_CLOEXEC: ::c_int = 0x080000;
573574

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,7 @@ pub const SYS_chown: ::c_long = 212;
993993
pub const SYS_setfsuid: ::c_long = 215;
994994
pub const SYS_setfsgid: ::c_long = 216;
995995
pub const SYS_newfstatat: ::c_long = 293;
996+
pub const SYS_statx: ::c_long = 379;
996997

997998
#[link(name = "util")]
998999
extern "C" {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@ pub const SYS_pwritev2: ::c_long = 393;
827827
pub const SYS_pkey_mprotect: ::c_long = 394;
828828
pub const SYS_pkey_alloc: ::c_long = 395;
829829
pub const SYS_pkey_free: ::c_long = 396;
830+
pub const SYS_statx: ::c_long = 397;
830831

831832
extern "C" {
832833
pub fn getrandom(

src/unix/linux_like/linux/musl/b32/hexagon.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ pub const SYS_wait4: ::c_int = 260;
710710
pub const SYS_waitid: ::c_int = 95;
711711
pub const SYS_write: ::c_int = 64;
712712
pub const SYS_writev: ::c_int = 66;
713+
pub const SYS_statx: ::c_int = 291;
713714
pub const TCFLSH: ::c_int = 21515;
714715
pub const TCGETA: ::c_int = 21509;
715716
pub const TCGETS: ::c_int = 21505;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,10 @@ pub const SYS_mlock2: ::c_long = 4000 + 359;
836836
pub const SYS_copy_file_range: ::c_long = 4000 + 360;
837837
pub const SYS_preadv2: ::c_long = 4000 + 361;
838838
pub const SYS_pwritev2: ::c_long = 4000 + 362;
839+
pub const SYS_pkey_mprotect: ::c_long = 4000 + 363;
840+
pub const SYS_pkey_alloc: ::c_long = 4000 + 364;
841+
pub const SYS_pkey_free: ::c_long = 4000 + 365;
842+
pub const SYS_statx: ::c_long = 4000 + 366;
839843

840844
cfg_if! {
841845
if #[cfg(libc_align)] {

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,8 +914,10 @@ pub const SYS_mlock2: ::c_long = 376;
914914
pub const SYS_copy_file_range: ::c_long = 377;
915915
pub const SYS_preadv2: ::c_long = 378;
916916
pub const SYS_pwritev2: ::c_long = 379;
917-
// FIXME syscalls 380-382 have been added in musl 1.16
918-
// See discussion https://github.com/rust-lang/libc/pull/699
917+
pub const SYS_pkey_mprotect: ::c_long = 380;
918+
pub const SYS_pkey_alloc: ::c_long = 381;
919+
pub const SYS_pkey_free: ::c_long = 382;
920+
pub const SYS_statx: ::c_long = 383;
919921

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ pub const SYS_pwritev2: ::c_long = 287;
506506
pub const SYS_pkey_mprotect: ::c_long = 288;
507507
pub const SYS_pkey_alloc: ::c_long = 289;
508508
pub const SYS_pkey_free: ::c_long = 290;
509+
pub const SYS_statx: ::c_long = 291;
509510

510511
pub const RLIMIT_NLIMITS: ::c_int = 15;
511512
pub const TIOCINQ: ::c_int = ::FIONREAD;

src/unix/linux_like/linux/musl/b64/mips64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ pub const SYS_pwritev2: ::c_long = 5000 + 322;
424424
pub const SYS_pkey_mprotect: ::c_long = 5000 + 323;
425425
pub const SYS_pkey_alloc: ::c_long = 5000 + 324;
426426
pub const SYS_pkey_free: ::c_long = 5000 + 325;
427+
pub const SYS_statx: ::c_long = 5000 + 326;
427428

428429
pub const O_DIRECT: ::c_int = 0x8000;
429430
pub const O_DIRECTORY: ::c_int = 0x10000;

src/unix/linux_like/linux/musl/b64/powerpc64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ pub const SYS_copy_file_range: ::c_long = 379;
596596
pub const SYS_preadv2: ::c_long = 380;
597597
pub const SYS_pwritev2: ::c_long = 381;
598598
pub const SYS_kexec_file_load: ::c_long = 382;
599+
pub const SYS_statx: ::c_long = 383;
599600

600601
pub const FIOCLEX: ::c_int = 0x20006601;
601602
pub const FIONCLEX: ::c_int = 0x20006602;

src/unix/linux_like/linux/musl/b64/x86_64/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,10 @@ pub const SYS_mlock2: ::c_long = 325;
576576
pub const SYS_copy_file_range: ::c_long = 326;
577577
pub const SYS_preadv2: ::c_long = 327;
578578
pub const SYS_pwritev2: ::c_long = 328;
579-
// FIXME syscalls 329-331 have been added in musl 1.16
580-
// See discussion https://github.com/rust-lang/libc/pull/699
579+
pub const SYS_pkey_mprotect: ::c_long = 329;
580+
pub const SYS_pkey_alloc: ::c_long = 330;
581+
pub const SYS_pkey_free: ::c_long = 331;
582+
pub const SYS_statx: ::c_long = 332;
581583

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

0 commit comments

Comments
 (0)