summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2026-02-08 05:59:38 +0000
committerPaolo Bonzini <pbonzini@redhat.com>2026-06-17 15:15:43 +0200
commit9c5fbd478f77ecf5d4dcf1d7d01e4defbafb6324 (patch)
treee7bfccaaf65aa4c882b01d79377d7a5d6b8b5806 /block
parentcbac85630828bef1ddc084cc2edc02a932ad91c3 (diff)
downloadqemu-9c5fbd478f77ecf5d4dcf1d7d01e4defbafb6324.tar.gz
qemu-9c5fbd478f77ecf5d4dcf1d7d01e4defbafb6324.zip
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>
Diffstat (limited to 'block')
-rw-r--r--block/file-posix.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/block/file-posix.c b/block/file-posix.c
index 5019ddade9..5998448b1e 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -43,9 +43,11 @@
#include "scsi/constants.h"
#include "scsi/utils.h"
-#if defined(__APPLE__) && (__MACH__)
+#ifndef __sun__
#include <sys/ioctl.h>
-#if defined(HAVE_HOST_BLOCK_DEVICE)
+#endif
+
+#if defined(__APPLE__) && (__MACH__) && defined(HAVE_HOST_BLOCK_DEVICE)
#include <paths.h>
#include <sys/param.h>
#include <sys/mount.h>
@@ -57,7 +59,6 @@
//#include <IOKit/storage/IOCDTypes.h>
#include <IOKit/storage/IODVDMedia.h>
#include <CoreFoundation/CoreFoundation.h>
-#endif /* defined(HAVE_HOST_BLOCK_DEVICE) */
#endif
#ifdef __sun__
@@ -65,7 +66,6 @@
#include <sys/dkio.h>
#endif
#ifdef __linux__
-#include <sys/ioctl.h>
#include <sys/param.h>
#include <sys/syscall.h>
#include <sys/vfs.h>
@@ -95,27 +95,20 @@
#endif
#ifdef __OpenBSD__
-#include <sys/ioctl.h>
#include <sys/disklabel.h>
#include <sys/dkio.h>
#endif
#ifdef __NetBSD__
-#include <sys/ioctl.h>
#include <sys/disklabel.h>
#include <sys/dkio.h>
#include <sys/disk.h>
#endif
#ifdef __DragonFly__
-#include <sys/ioctl.h>
#include <sys/diskslice.h>
#endif
-#ifdef EMSCRIPTEN
-#include <sys/ioctl.h>
-#endif
-
/* OS X does not have O_DSYNC */
#ifndef O_DSYNC
#ifdef O_SYNC