a3ea1cb458
Add statx shim for linux target This is an attempt to fix: https://github.com/rust-lang/miri/issues/999 (for linux only) Currently there is one problem that I haven't been able to solve. `std::fs::metadata` fails because the creation time is not available even though it is provided in the shim code. In order to inform the caller that the field was provided, the `stx_flag` field must have the bits of `STATX_BTIME` set (which they are). The creation time is in the `stx_btime` field of the `statx` struct (see [1]). The relevant code in `libstd` is here (probably?): https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/fs.rs#L322 Another important point is that we are just providing the fields that are available in "all" platforms (this is, without using any platform specific traits or so). This can be improved later. References: [1] Man page: http://man7.org/linux/man-pages/man2/statx.2.html [2] libc `statx` struct: https://docs.rs/libc/0.2.63/libc/struct.statx.html Edit: The problem is that my filesystem is not providing it and I thought all filesystems could provide it. I changed the code so it only provides those dates if they are available. now we are ready to go. r? @RalfJung @oli-obk |
||
---|---|---|
.. | ||
compile-fail | ||
run-pass | ||
compiletest.rs |