We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53db2a0 commit b823b3eCopy full SHA for b823b3e
src/java.base/unix/native/libjava/io_util_md.c
@@ -32,6 +32,9 @@
32
33
#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX)
34
#include <sys/ioctl.h>
35
+#endif
36
+
37
+#if defined(__linux__)
38
#include <linux/fs.h>
39
#include <sys/stat.h>
40
#endif
@@ -250,14 +253,14 @@ handleGetLength(FD fd)
250
253
if (result < 0) {
251
254
return -1;
252
255
}
- #ifdef BLKGETSIZE64
256
+#if defined(__linux__) && defined(BLKGETSIZE64)
257
if (S_ISBLK(sb.st_mode)) {
258
uint64_t size;
259
if(ioctl(fd, BLKGETSIZE64, &size) < 0) {
260
261
262
return (jlong)size;
263
- #endif
264
265
return sb.st_size;
266
0 commit comments