glibc already has this as non-static on __GNU__ systems.
Also, add the missing sys/ioctl.h header for the same platform.

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,
-- 
2.51.0



Reply via email to