1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| 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 <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((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",
|
|