While we do have stafs(2) it has a different signature, is deprecated and undocumented, while statvfs() gives the behaviour we actually want. --- a/test/jdk/java/io/File/libGetXSpace.c Wed Apr 5 22:54:38 2023 +++ b/test/jdk/java/io/File/libGetXSpace.c Thu Apr 6 14:28:43 2023 @@ -34,9 +34,13 @@ #include #include #else +#ifdef __sun__ +#include +#else #include #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((const char*)chars, &buf); +#else struct statfs buf; int result = statfs((const char*)chars, &buf); +#endif free(chars); if (result < 0) { JNU_ThrowByNameWithLastError(env, "java/lang/RuntimeException",