os-posix: include sys/mman.h

qemu/osdep.h checks whether MAP_ANONYMOUS is defined, but this check
is bogus without a previous inclusion of sys/mman.h.  Include it in
sysemu/os-posix.h and remove it from everywhere else.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2016-06-06 13:57:39 +02:00
parent 89266923df
commit 02d0e09503
54 changed files with 4 additions and 68 deletions

View File

@ -22,7 +22,6 @@
* THE SOFTWARE.
*/
#include "qemu/osdep.h"
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/soundcard.h>
#include "qemu-common.h"

View File

@ -24,11 +24,6 @@
/* Needed for CONFIG_MADVISE */
#include "qemu/osdep.h"
#if defined(CONFIG_MADVISE) || defined(CONFIG_POSIX_MADVISE)
#include <sys/mman.h>
#endif
#include "block/block_int.h"
#include "qemu-common.h"
#include "qcow2.h"

View File

@ -1,7 +1,6 @@
/* This is the Linux kernel elf-loading code, ported into user space */
#include "qemu/osdep.h"
#include <sys/mman.h>
#include "qemu.h"
#include "disas/disas.h"

View File

@ -18,7 +18,6 @@
*/
#include "qemu/osdep.h"
#include <machine/trap.h>
#include <sys/mman.h>
#include "qemu.h"
#include "qemu/path.h"

View File

@ -17,7 +17,6 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
#include <sys/mman.h>
#include "qemu.h"
#include "qemu-common.h"

View File

@ -19,7 +19,6 @@
#include "qemu/osdep.h"
#include "qemu/cutils.h"
#include "qemu/path.h"
#include <sys/mman.h>
#include <sys/syscall.h>
#include <sys/param.h>
#include <sys/sysctl.h>

View File

@ -10,7 +10,6 @@
#include "qemu/host-utils.h"
#include "qemu/sockets.h"
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/un.h>

1
exec.c
View File

@ -19,7 +19,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#ifndef _WIN32
#include <sys/mman.h>
#endif
#include "qemu/cutils.h"

View File

@ -21,7 +21,6 @@
#include "qemu/osdep.h"
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/uio.h>
#include "hw/hw.h"

View File

@ -22,7 +22,6 @@
#include "qemu/osdep.h"
#include <sys/select.h>
#include <termios.h>
#include <sys/mman.h>
#include "hw/hw.h"
#include "sysemu/char.h"

View File

@ -25,7 +25,6 @@
*/
#include "qemu/osdep.h"
#include <sys/mman.h>
#include "hw/hw.h"
#include "ui/console.h"

View File

@ -22,7 +22,6 @@
*/
#include "qemu/osdep.h"
#include "qapi/error.h"
#include <sys/mman.h>
#include "hw/hw.h"
#include "hw/i386/pc.h"
#include "qemu/error-report.h"

View File

@ -36,8 +36,6 @@
#include "hw/misc/ivshmem.h"
#include <sys/mman.h>
#define PCI_VENDOR_ID_IVSHMEM PCI_VENDOR_ID_REDHAT_QUMRANET
#define PCI_DEVICE_ID_IVSHMEM 0x1110

View File

@ -36,9 +36,6 @@
*/
#include "qemu/osdep.h"
#if defined(CONFIG_POSIX)
#include <sys/mman.h>
#endif
#include "hw/hw.h"
#include "hw/qdev.h"
#include "hw/isa/isa.h"

View File

@ -22,7 +22,6 @@
#include "qemu/osdep.h"
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include "hw/hw.h"

View File

@ -21,7 +21,6 @@
#include "qemu/osdep.h"
#include <libusb.h>
#include <sys/mman.h>
#include "qemu-common.h"
#include "qemu/config-file.h"

View File

@ -20,7 +20,6 @@
#include "qemu/osdep.h"
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <linux/vfio.h>
#include "hw/vfio/vfio-common.h"

View File

@ -21,7 +21,6 @@
#include "qemu/osdep.h"
#include <linux/vfio.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include "hw/pci/msi.h"
#include "hw/pci/msix.h"

View File

@ -27,10 +27,6 @@
#include "qapi-event.h"
#include "trace.h"
#if defined(__linux__)
#include <sys/mman.h>
#endif
#include "hw/virtio/virtio-bus.h"
#include "hw/virtio/virtio-access.h"

View File

@ -23,7 +23,6 @@
*/
#include "qemu/osdep.h"
#include <sys/mman.h>
#include <sys/signal.h>
#include "hw/hw.h"

View File

@ -10,7 +10,6 @@
*/
#include "qemu/osdep.h"
#include <sys/mman.h>
#include "hw/xen/xen_backend.h"
#include "xen_pt.h"

View File

@ -197,8 +197,6 @@ void qemu_anon_ram_free(void *ptr, size_t size);
#if defined(CONFIG_MADVISE)
#include <sys/mman.h>
#define QEMU_MADV_WILLNEED MADV_WILLNEED
#define QEMU_MADV_DONTNEED MADV_DONTNEED
#ifdef MADV_DONTFORK

View File

@ -26,6 +26,7 @@
#ifndef QEMU_OS_POSIX_H
#define QEMU_OS_POSIX_H
#include <sys/mman.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>

View File

@ -15,7 +15,6 @@
#include "qemu/osdep.h"
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <linux/kvm.h>

View File

@ -2,7 +2,6 @@
#include "qemu/osdep.h"
#include <sys/param.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include "qemu.h"

View File

@ -34,7 +34,6 @@
/****************************************************************************/
#include "qemu/osdep.h"
#include <sys/mman.h>
#include "qemu.h"
#include "flat.h"

View File

@ -18,7 +18,6 @@
*/
#include "qemu/osdep.h"
#include "qemu-version.h"
#include <sys/mman.h>
#include <sys/syscall.h>
#include <sys/resource.h>

View File

@ -17,7 +17,6 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
#include <sys/mman.h>
#include <linux/mman.h>
#include <linux/unistd.h>

View File

@ -5,7 +5,6 @@
#include <sys/shm.h>
#include <sys/select.h>
#include <sys/mount.h>
#include <sys/mman.h>
#include <sched.h>
#include "qemu.h"

View File

@ -32,7 +32,6 @@
#include <sys/personality.h>
#include <sys/prctl.h>
#include <sys/resource.h>
#include <sys/mman.h>
#include <sys/swap.h>
#include <linux/capability.h>
#include <sched.h>

View File

@ -51,7 +51,6 @@ struct PostcopyDiscardState {
#if defined(__linux__)
#include <poll.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <asm/types.h> /* for __u64 */

View File

@ -26,7 +26,6 @@
#include "qemu/osdep.h"
#include <sys/ioctl.h>
#include <net/if.h>
#include <sys/mman.h>
#define NETMAP_WITH_LIBS
#include <net/netmap.h>
#include <net/netmap_user.h>

View File

@ -26,7 +26,6 @@
#include "qemu/osdep.h"
#include <sys/wait.h>
/*needed for MAP_POPULATE before including qemu-options.h */
#include <sys/mman.h>
#include <pwd.h>
#include <grp.h>
#include <libgen.h>

View File

@ -47,7 +47,6 @@
#include <sys/times.h>
#include <sys/wait.h>
#include <termios.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/resource.h>
#include <sys/socket.h>

View File

@ -105,6 +105,8 @@ for f in "$@"; do
*include/qemu/osdep.h | \
*include/qemu/compiler.h | \
*include/glib-compat.h | \
*include/sysemu/os-posix.h | \
*include/sysemu/os-win32.h | \
*include/standard-headers/ )
# Removing include lines from osdep.h itself would be counterproductive.
echo "SKIPPING $f (special case header)"
@ -145,6 +147,7 @@ for f in "$@"; do
<stdlib.h> <stdio.h> <string.h> <strings.h> <inttypes.h>
<limits.h> <unistd.h> <time.h> <ctype.h> <errno.h> <fcntl.h>
<sys/stat.h> <sys/time.h> <assert.h> <signal.h> <glib.h>
<sys/stat.h> <sys/time.h> <assert.h> <signal.h> <glib.h> <sys/mman.h>
"sysemu/os-posix.h, sysemu/os-win32.h "glib-compat.h"
"qemu/typedefs.h"
))' "$f"

View File

@ -10,7 +10,6 @@
#include "qemu/osdep.h"
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <linux/kvm.h>

View File

@ -10,7 +10,6 @@
#include "qemu/osdep.h"
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <linux/kvm.h>

View File

@ -11,7 +11,6 @@
#include "qemu/osdep.h"
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/ptrace.h>
#include <linux/elf.h>

View File

@ -15,7 +15,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/utsname.h>
#include <linux/kvm.h>

View File

@ -11,7 +11,6 @@
#include "qemu/osdep.h"
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <linux/kvm.h>

View File

@ -17,7 +17,6 @@
#include "qemu/osdep.h"
#include <dirent.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/vfs.h>
#include <linux/kvm.h>

View File

@ -23,7 +23,6 @@
#include "qemu/osdep.h"
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <linux/kvm.h>
#include <asm/ptrace.h>

View File

@ -13,7 +13,6 @@
*/
#include "qemu/osdep.h"
#include <sys/mman.h>
#include "libqtest.h"
#include "libqos/pci.h"

View File

@ -10,7 +10,6 @@
#include "qemu/osdep.h"
#include <glib/gstdio.h>
#include <sys/mman.h>
#include "contrib/ivshmem-server/ivshmem-server.h"
#include "libqos/pci-pc.h"
#include "libqtest.h"

View File

@ -26,7 +26,6 @@ const unsigned end_address = 100 * 1024 * 1024;
bool got_stop;
#if defined(__linux__)
#include <sys/mman.h>
#include <sys/syscall.h>
#include <sys/vfs.h>
#endif

View File

@ -33,7 +33,6 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/unistd.h>
#include <sys/mman.h>
#include <sys/eventfd.h>
#include <arpa/inet.h>
#include <netdb.h>

View File

@ -17,7 +17,6 @@
#include "sysemu/sysemu.h"
#include <linux/vhost.h>
#include <sys/mman.h>
#include <sys/vfs.h>
#include <qemu/sockets.h>

View File

@ -18,8 +18,6 @@
*/
#ifdef _WIN32
#include <windows.h>
#else
#include <sys/mman.h>
#endif
#include "qemu/osdep.h"

View File

@ -29,8 +29,6 @@
#include <glib/gprintf.h>
#include <sys/mman.h>
#include "qemu/memfd.h"
#ifdef CONFIG_MEMFD

View File

@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
#include <qemu/mmap-alloc.h>
#include <sys/mman.h>
#define HUGETLBFS_MAGIC 0x958458f6

View File

@ -25,10 +25,6 @@
/* Needed early for CONFIG_BSD etc. */
#if defined(CONFIG_MADVISE) || defined(CONFIG_POSIX_MADVISE)
#include <sys/mman.h>
#endif
#ifdef CONFIG_SOLARIS
#include <sys/statvfs.h>
/* See MySQL bug #7156 (http://bugs.mysql.com/bug.php?id=7156) for

View File

@ -36,7 +36,6 @@
#include "trace.h"
#include "qapi/error.h"
#include "qemu/sockets.h"
#include <sys/mman.h>
#include <libgen.h>
#include <sys/signal.h>
#include "qemu/cutils.h"

View File

@ -9,7 +9,6 @@
*/
#include "qemu/osdep.h"
#include <sys/mman.h>
#include "cpu.h"
#include "hw/pci/pci.h"

View File

@ -17,7 +17,6 @@
#include "qemu/bitmap.h"
#include <xen/hvm/params.h>
#include <sys/mman.h>
#include "sysemu/xen-mapcache.h"
#include "trace.h"