While we do have stafs(2) it has a different signature, is deprecated and
undocumented, while statvfs() gives the behaviour we actually want.

--- jdk23u-jdk-23.0.1-ga/test/jdk/java/io/File/libGetXSpace.c.orig
+++ jdk23u-jdk-23.0.1-ga/test/jdk/java/io/File/libGetXSpace.c
@@ -34,9 +34,13 @@
 #include <sys/param.h>
 #include <sys/mount.h>
 #else
+#ifdef __sun__
+#include <sys/statvfs.h>
+#else
 #include <sys/statfs.h>
 #endif
 #endif
+#endif
 
 #ifdef __cplusplus
 extern "C" {
@@ -142,8 +146,13 @@
     chars[len] = '\0';
     (*env)->ReleaseStringChars(env, root, strchars);
 
+#ifdef __sun__
+    struct statvfs buf;
+    int result = statvfs(chars, &buf);
+#else
     struct statfs buf;
     int result = statfs(chars, &buf);
+#endif
     free(chars);
     if (result < 0) {
         JNU_ThrowByNameWithLastError(env, "java/lang/RuntimeException",