On 1/30/26 04:20, Damien Zammit wrote:
glibc already has this as non-static on __GNU__ systems.
Also, add the missing sys/ioctl.h header for the same platform.
Please just move the inclusion of sys/ioctl.h outside all #ifdefs, i.e.
...
#include <sys/ioctl.h>
#if defined(__APPLE__) && (__MACH__)
#if defined(HAVE_HOST_BLOCK_DEVICE)
#include <paths.h>
#include <sys/param.h>
...
and remove all the #includes for it after the first.
Thanks,
Paolo
Signed-off-by: Damien Zammit <[email protected]>
---
block/file-posix.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/block/file-posix.c b/block/file-posix.c
index 6265d2e248..5e4fdba49b 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -116,6 +116,10 @@
#include <sys/ioctl.h>
#endif
+#ifdef __GNU__
+#include <sys/ioctl.h>
+#endif
+
/* OS X does not have O_DSYNC */
#ifndef O_DSYNC
#ifdef O_SYNC
@@ -2113,7 +2117,7 @@ static int handle_aiocb_write_zeroes_unmap(void *opaque)
}
#ifndef HAVE_COPY_FILE_RANGE
-#ifndef EMSCRIPTEN
+#if !defined(EMSCRIPTEN) && !defined(__GNU__)
static
#endif
ssize_t copy_file_range(int in_fd, off_t *in_off, int out_fd,