sys_statx(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sys_statx(9) πŸ’…

hii bestie, welcome to the Kernel API Manual πŸ’– this page is all about sys_statx, and it's gonna be iconic. no cap.

🌸 NAME 🌸

sys_statx β€” system call to get enhanced stats ✨

πŸŽ€ SYNOPSIS πŸŽ€

long sys_statx (int dfd , const char __user * filename , unsigned flags , unsigned int mask , struct statx __user * buffer );

πŸ¦‹ ARGUMENTS πŸ¦‹

okay so here's the whole squad of parameters, and every single one matters:

  • dfd β€” the base directory to pathwalk from or the fd to stat. yes, it's giving duality πŸ’…
  • filename β€” the file to stat, or NULL or "" when you're using AT_EMPTY_PATH.
  • flags β€” the AT_* flags that control the pathwalk. pathwalk vibes fr fr.
  • mask β€” the parts of the statx struct that are actually required.
  • buffer β€” the result buffer. that's where the stats land 🫢

πŸ’œ DESCRIPTION πŸ’œ

big note, bestie: fstat can be emulated by setting dfd to the fd of interest, supplying "" (or preferably NULL) as the filename, and setting AT_EMPTY_PATH in the flags. literally that's the whole move. πŸ’«

🌈 SEE ALSO 🌈

Kernel file ./fs/stat.c is part of the lore, and so are these:


later, bestie πŸ’– β€” source/version: ./fs, date: October 2026. slay πŸŽ€

πŸ“¦ where this page comes from