# std.fs: Rework to always use statx\(\) instead of fstat\(\)/fstatat\(\) on Linux\. · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/13945548fcd4fe3aab0879b670db1fe8131d8b0e)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 13945548fcd4fe3aab0879b670db1fe8131d8b0e

Requested commit: 13945548fcd4fe3aab0879b670db1fe8131d8b0e

Commit: 13945548fcd4fe3aab0879b670db1fe8131d8b0e

Tree: c3d78b69f446ebf0c62821a3b2866142818762e5

Author: Alex Rønne Petersen

Committer: Alex Rønne Petersen

## Message

```
std.fs: Rework to always use statx() instead of fstat()/fstatat() on Linux.

statx() is strictly superior to stat() and friends. We can do this because the
standard library declares Linux 4.19 to be the minimum version supported in
std.Target. This is also necessary on riscv32 where there is only statx().

While here, I improved std.fs.File.metadata() to gather as much information as
possible when calling statx() since that is the expectation from this particular
API.

```

## Parents

- [4e5068c35cef5e1b3366aa05de60023b9fcd98e6](https://git.cafe/gitcafe/zig/commit/4e5068c35cef5e1b3366aa05de60023b9fcd98e6?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/13945548fcd4fe3aab0879b670db1fe8131d8b0e?format=markdown)
