From be64c32abcafc2a73d2e488ce577c75205d590ab Mon Sep 17 00:00:00 2001 From: sendaoYan Date: Sat, 7 Sep 2024 10:30:52 +0800 Subject: [PATCH] return false early if statx syscall is not available --- .../attribute/BasicFileAttributeView/CreationTimeHelper.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTimeHelper.java b/test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTimeHelper.java index 186ec865620a3..2236ea0ac58e3 100644 --- a/test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTimeHelper.java +++ b/test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTimeHelper.java @@ -44,6 +44,8 @@ public class CreationTimeHelper extends NativeTestHelper { // Helper so as to determine 'statx' support on the runtime system // static boolean linuxIsCreationTimeSupported(String file); static boolean linuxIsCreationTimeSupported(String file) throws Throwable { + if (!abi.defaultLookup().find("statx").isPresent()) + return false; try (var arena = Arena.ofConfined()) { MemorySegment s = arena.allocateFrom(file); return (boolean)methodHandle.invokeExact(s);