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

Severin Gehwolf sgehwolf at openjdk.org
Fri Oct 13 09:06:20 UTC 2023


> 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 20 additional commits since the last revision:

 - Drop @enablePreview in CreationTime test
 - Merge branch 'master'
 - Move trace message after platform specific blocks
 - Drop word 'Debug:' in CreationTime test code
 - Keep wrapper function signature compatible to statx
 - Refactor test so as to use Linker from JEP 454.
   
   @enablePreview still needed as of yet. This can go once
   JDK-8312522 integrates.
 - Add missing returns when statx is available
 - Use custom but compatible statx struct always
 - Link libCreationTimeHelper with -ldl
 - Merge branch 'master' into JDK-8316304-statx-create-time-new
 - ... and 10 more: https://git.openjdk.org/jdk/compare/80229be5...9fcdd965

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/15792/files
  - new: https://git.openjdk.org/jdk/pull/15792/files/cbb24e38..9fcdd965

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=15792&range=13
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15792&range=12-13

  Stats: 20110 lines in 677 files changed: 10264 ins; 4891 del; 4955 mod
  Patch: https://git.openjdk.org/jdk/pull/15792.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15792/head:pull/15792

PR: https://git.openjdk.org/jdk/pull/15792


More information about the nio-dev mailing list