]> git.ipfire.org Git - thirdparty/coreutils.git/commit
stat: Use statx where available and support --cached
authorJeff Layton <jlayton@kernel.org>
Tue, 28 May 2019 12:21:42 +0000 (08:21 -0400)
committerPádraig Brady <P@draigBrady.com>
Mon, 10 Jun 2019 21:59:28 +0000 (22:59 +0100)
commit6cc35de16fdc52d417602b66d5e90694d7e02994
treef6cc2240a9da5eab690b1465339110fbcc33532e
parentbb481a0c1d059266d33fd72bf827cb179bcaaf64
stat: Use statx where available and support --cached

* src/stat.c: Drop statbuf argument from out_epoch_sec().
Use statx() rather than [lf]stat() where available,
so a separate call is not required to get birth time.
Set STATX_* mask bits only for things we want to print,
which can be more efficient on some file systems.
Add a new --cache= command-line option that sets the appropriate hint
flags in the statx call.  These are primarily used with network
file systems to indicate what level of cache coherency is desired.
The new option is available unconditionally for better portability,
and ignored where not implemented.
* doc/coreutils.texi: Add documention for --cached.
* man/stat.x (SEE ALSO): Mention statx().
* NEWS: Mention the new feature.
NEWS
doc/coreutils.texi
man/stat.x
src/stat.c