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

Severin Gehwolf sgehwolf at openjdk.org
Tue Oct 3 11:59:13 UTC 2023


On Tue, 3 Oct 2023 11:43:51 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c line 706:
>> 
>>> 704: #if defined(__linux__)
>>> 705:     }
>>> 706: #endif
>> 
>> Can you replace this with #if defined(__linux) .. #else .. #endif as it will make it easier to read. There are several places where we'll need to fix the indent with nested ifdef usage as it's hard to ready right now.
>
>> Can you replace this with #if defined(__linux) .. #else .. #endif as it will make it easier to read.
> 
> I'm not sure I follow. We need the `statx` code *and* the old `stat64` code on Linux as that's the fall-back code when `statx` isn't supported. We don't need the `statx` code on other platforms. If I used `#if defined(__linux__) ... #else ... #endif` instead, I wouldn't get the stat64 code on Linux without duplication. What am I missing?

I've added indents. Not sure if it's any better.

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

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


More information about the nio-dev mailing list