@samitouri / QOSamiQemu / commits / 9c5fbd478f

block/file-posix: Clean up sys/ioctl import

Since all platforms except sun include this header, clean up the ifdefs. Signed-off-by: Damien Zammit <damien@zamaudio.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260208055858.2166524-5-damien@zamaudio.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Damien Zammit committed Feb 8, 2026 at 05:59 UTC 9c5fbd478f77ecf5d4dcf1d7d01e4defbafb6324
1 file changed +4 -11
block/file-posix.c
+4 -11
@@ -43,9 +43,11 @@
43 #include "scsi/constants.h"
44 #include "scsi/utils.h"
45
46 -#if defined(__APPLE__) && (__MACH__)
46 +#ifndef __sun__
47 #include <sys/ioctl.h>
48 -#if defined(HAVE_HOST_BLOCK_DEVICE)
48 +#endif
49 +
50 +#if defined(__APPLE__) && (__MACH__) && defined(HAVE_HOST_BLOCK_DEVICE)
51 #include <paths.h>
52 #include <sys/param.h>
53 #include <sys/mount.h>
@@ -57,7 +59,6 @@
59 //#include <IOKit/storage/IOCDTypes.h>
60 #include <IOKit/storage/IODVDMedia.h>
61 #include <CoreFoundation/CoreFoundation.h>
60 -#endif /* defined(HAVE_HOST_BLOCK_DEVICE) */
62 #endif
63
64 #ifdef __sun__
@@ -65,7 +66,6 @@
66 #include <sys/dkio.h>
67 #endif
68 #ifdef __linux__
68 -#include <sys/ioctl.h>
69 #include <sys/param.h>
70 #include <sys/syscall.h>
71 #include <sys/vfs.h>
@@ -95,27 +95,20 @@
95 #endif
96
97 #ifdef __OpenBSD__
98 -#include <sys/ioctl.h>
98 #include <sys/disklabel.h>
99 #include <sys/dkio.h>
100 #endif
101
102 #ifdef __NetBSD__
104 -#include <sys/ioctl.h>
103 #include <sys/disklabel.h>
104 #include <sys/dkio.h>
105 #include <sys/disk.h>
106 #endif
107
108 #ifdef __DragonFly__
111 -#include <sys/ioctl.h>
109 #include <sys/diskslice.h>
110 #endif
111
115 -#ifdef EMSCRIPTEN
116 -#include <sys/ioctl.h>
117 -#endif
118 -
112 /* OS X does not have O_DSYNC */
113 #ifndef O_DSYNC
114 #ifdef O_SYNC