sys_statx(9)
π 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, orNULLor""when you're usingAT_EMPTY_PATH.flagsβ theAT_*flags that control the pathwalk. pathwalk vibes fr fr.maskβ the parts of thestatxstruct 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:
fill_mg_cmtime(9)generic_fillattr(9)generic_fill_statx_attr(9)generic_fill_statx_atomic_writes(9)vfs_getattr_nosec(9)vfs_fstat(9)vfs_statx(9)
later, bestie π β source/version: ./fs, date: October 2026. slay π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms