Skip to content

Commit

Permalink
merge Linker.nativeLinker().defaultLookup().find("statx").isPresent()…
Browse files Browse the repository at this point in the history
… and !Files.getFileStore(file).type().contentEquals("tmpfs")
  • Loading branch information
sendaoYan committed Aug 24, 2024
1 parent 128e686 commit 25694d7
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ static void test(Path top) throws IOException {
supportsCreationTimeWrite = true;
}
} else if (Platform.isLinux()) {
// Creation time read depends on statx system call support
supportsCreationTimeRead = Linker.nativeLinker().defaultLookup().find("statx").isPresent();
// Linux system doesn't support birth time on tmpfs filesystem for now
if( Files.getFileStore(file).type().contentEquals("tmpfs") ) {
supportsCreationTimeRead = false;
// Creation time read depends on statx system call support and on the file
// system storing the birth time. The tmpfs file system type does not store
// the birth time.
boolean statxIsPresent = Linker.nativeLinker().defaultLookup().find("statx").isPresent();
if (statxIsPresent && !Files.getFileStore(file).type().contentEquals("tmpfs")) {
supportsCreationTimeRead = true;
}
// Creation time updates are not supported on Linux
supportsCreationTimeWrite = false;
Expand Down

0 comments on commit 25694d7

Please sign in to comment.