RFR: 8316304: (fs) Add support for BasicFileAttributes.creationTime() for Linux [v15]

Severin Gehwolf sgehwolf at openjdk.org
Fri Oct 13 14:51:10 UTC 2023


On Fri, 13 Oct 2023 14:50:44 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?
>
> Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix Linux Alpine build

src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c line 87:

> 85: typedef unsigned short     __uint16_t;
> 86: typedef unsigned long int  __uint64_t;
> 87: #endif

Not sure what changed on the lastest merge from master, but I was getting compile failures on Apine without this. It's a no-op for glibc. @AlanBateman @bplb Still ok?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15792#discussion_r1358366992


More information about the nio-dev mailing list