os-posix: include sys/mman.h
PATCH 1/1 os-posix: include sys/mman.h
qemu/osdep.h checks whether MAP_ANONYMOUS is defined, but this check is bogus without a previous include of sys/mman.h.
--- include/sysemu/os-posix.h | 1 + 1 file changed, 1 insertion(+)
include/sysemu/os-posix.h +1 -0
@@ -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>
Signature · 1 line
2.5.5
Quoted 21 lines · Paolo Bonzini
qemu/osdep.hchecks whetherMAP_ANONYMOUSis defined, but this check is bogus without a previous include ofsys/mman.h.Signed-off-by Paolo Bonzini <[email protected]>--- include/sysemu/os-posix.h | 1 + 1 file changed, 1 insertion(+)include/sysemu/os-posix.h +1
-1@@ -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> --
Quoted 1 line
2.5.5
Did you discover this because something broke, or just through code inspection?
We could add mman.h to clean-includes and zap the other includes of it I guess.
thanks
-- PMM
Quoted 17 lines · Peter Maydell
Quoted 16 lines · Paolo Bonzini
qemu/osdep.hchecks whetherMAP_ANONYMOUSis defined, but this check is bogus without a previous include ofsys/mman.h.Signed-off-by Paolo Bonzini <[email protected]>--- include/sysemu/os-posix.h | 1 + 1 file changed, 1 insertion(+)include/sysemu/os-posix.h +0
-0@@ -26,6 +26,7 @@#ifndef QEMU_OS_POSIX_H #define QEMU_OS_POSIX_H
Quoted 9 lines
Quoted 6 lines
include/sysemu/os-posix.h +1
-1+#include <sys/mman.h> #include <sys/socket.h> #include <netinet/in.h> #include <netinet/tcp.h> --2.5.5
Did you discover this because something broke, or just through code inspection?
sparse complained, but I don't think anything else breaks.
Quoted 4 lines
Reviewed-by Peter Maydell <[email protected]>We could add
mman.hto clean-includes and zap the other includes of it I guess.
Yup, good idea.
Thanks,
Paolo