RFR: 8316304: (fs) Add support for BasicFileAttributes.creationTime() for Linux
Alan Bateman
alanb at openjdk.org
Tue Sep 19 14:20:41 UTC 2023
On Mon, 18 Sep 2023 17:05:11 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
> Please review this nio change which adds `BasicFileAttributes.creationTime()` support for Linux by means of the `statx` Linux specific system call. The patch does a dynamic lookup of the function and if it is available, uses it to set the support birth time capability in `UnixNativeDispatcher`. When `statx` is not available, it won't use it and fall back to the old behaviour on such systems. It should, however, compile fine on Linux systems not supporting the `statx` system call.
>
> Testing:
> - [x] GHA (MacOS X failure seems unrelated)
> - [x] `java.nio` tests.
> - [x] Manual builds and tests on older glibc versions (2.17 => fallback, 2.28+ => works). Compiles fine and falls back to the not supported case as it was before this patch.
>
> Thoughts?
Is statx a complete superset of stat? If so, then the prototype should use it instead of stat, not in addition, meaning there should be one syscall rather than two.
If this goes ahead then I think should look at what it would take to move it src/java.base/linux, meaning the LinuxFileSystemProvider.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15792#issuecomment-1725699261
More information about the nio-dev
mailing list