#linux #syscalls #stats #fs

no-std linux-stat

A pure Rust library that implements stat functions on linux with only syscalls

6 releases

0.3.3 Jul 23, 2023
0.3.2 Jul 13, 2023
0.3.0 Jun 27, 2023
0.2.0 Jun 27, 2023
0.1.0 Jun 26, 2023

#685 in Filesystem

MIT license

135KB
3.5K SLoC

linux-stat

GitHub Workflow Status (with branch) Crates.io docs.rs Crates.io

A pure Rust library that implements stat functions on linux with only syscalls.

tl;dr

It tries to use statx syscall and fallback to fstatat.

Feature flags

  • std: enable std support.
  • linux_4_11: assume that kernel is at least 4.11.0 so statx is used.

#![no_std]

Enable #![no_std] support by disabling the default std feature:

[dependencies]
linux-stat = { version = "*", default-features = false }

Platforms

  • aarch64
  • arm
  • mips
  • mips64
  • mips64el
  • mipsel
  • powerpc
  • powerpc64
  • powerpc64el
  • riscv64
  • s390x
  • x86
  • x86_64
  • loongarch64

MSRV

1.46.0

Dependencies

~1.6–4MB
~89K SLoC