diff --git a/test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTime.java b/test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTime.java index 684f3f25662e8..73bd440783fe3 100644 --- a/test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTime.java +++ b/test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTime.java @@ -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;