RFR: 8316304: (fs) Add support for BasicFileAttributes.creationTime() for Linux [v8]
Severin Gehwolf
sgehwolf at openjdk.org
Wed Oct 4 16:11:23 UTC 2023
On Wed, 4 Oct 2023 13:21:51 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c line 80:
>>
>>> 78: // support. We still want to ensure we can call statx at runtime
>>> 79: // if the runtime glibc version supports it (>= 2.28)
>>> 80: #ifndef __NR_statx
>>
>> As long as we have to accommodate the case where struct statx is not defined, we may just as well do it always: just define a structure binary compatible to statx but named differently (e.g. my_statx) to prevent name clashes in case the structure happens to be defined already from libc; then use that structure as return type for your function pointer.
>>
>> The advantage would be you don't need to know and depend on __NR_statx, and you don't need to include asm/unistd. And no two cases to build and test.
>>
>> We do this already in other places, see e.g. the dynamic inclusion of mallinfo2() in os_linux.cpp.
>
> OK.
Should be done now in the latest patch.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15792#discussion_r1345930010
More information about the nio-dev
mailing list