RFR: 8338884: java/nio/file/attribute/BasicFileAttributeView/CreationTime.java#tmp fails on alinux3 [v6]

SendaoYan syan at openjdk.org
Thu Sep 5 08:44:29 UTC 2024


On Tue, 3 Sep 2024 16:08:36 GMT, SendaoYan <syan at openjdk.org> wrote:

>> test/jdk/java/nio/file/attribute/BasicFileAttributeView/libCreationTimeHelper.c line 35:
>> 
>>> 33:     void* statx_func = dlsym(RTLD_DEFAULT, "statx");
>>> 34:     return statx_func != NULL ? JNI_TRUE : JNI_FALSE;
>>> 35: #else
>> 
>> This is equivalent to the previous `Linker.nativeLinker().defaultLookup().find("statx").isPresent();` so isn't enough. You'd have to pass in the path and do an actual `statx` call, look at the returned statx buffer, get the mask and look whether birth time has been filled in.
>> 
>> See: https://github.com/openjdk/jdk/commit/c89a1c35bda9002ee687b3fa267f3ef9cba78b00
>> 
>> Only then it makes sense to go the jni route. Having said all that, for JDK head using FFM is preferred. Let's not consider backports just yet.
>
> Sorry, I already realized that the current solution is incomplete, so I do not click the previous `Resolve conversation`. I will finish the solution according your advice these days, Thanks.

The solution has been change to, get the result from `statx` linux syscall througt `FFM API`, to determine the testd file support birth time or not.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20687#discussion_r1745050319


More information about the nio-dev mailing list