Skip to content

Commit

Permalink
return false early if statx syscall is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
sendaoYan committed Sep 7, 2024
1 parent c8e22c1 commit be64c32
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit be64c32

Please sign in to comment.