statx
Statx is a Linux system call introduced with the 4.11 kernel to fetch file status information and metadata. It is designed to augment and, where appropriate, replace the older stat family (stat, lstat, fstatat) by offering more flexible querying, finer control over returned data, and nanosecond-level timestamps. The interface allows callers to request only the metadata they need, reducing overhead in some scenarios.
The statx API takes a directory file descriptor, a pathname, a set of flags, a mask indicating
The statx structure provides extended information beyond what stat offers. Returned fields can include file size,
Statx requires kernel support and compatible C library interfaces. It is widely supported in current distributions,