* [Qemu-devel] [PATCH] os-posix: include sys/mman.h
@ 2016-06-06 12:02 Paolo Bonzini
2016-06-06 12:11 ` Peter Maydell
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2016-06-06 12:02 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell
qemu/osdep.h checks whether MAP_ANONYMOUS is defined, but this
check is bogus without a previous include of sys/mman.h.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/sysemu/os-posix.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
index 07e3e5a..9c7dfdf 100644
--- a/include/sysemu/os-posix.h
+++ b/include/sysemu/os-posix.h
@@ -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>
--
2.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] os-posix: include sys/mman.h
2016-06-06 12:02 [Qemu-devel] [PATCH] os-posix: include sys/mman.h Paolo Bonzini
@ 2016-06-06 12:11 ` Peter Maydell
2016-06-06 13:59 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2016-06-06 12:11 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU Developers
On 6 June 2016 at 13:02, Paolo Bonzini <pbonzini@redhat.com> wrote:
> qemu/osdep.h checks whether MAP_ANONYMOUS is defined, but this
> check is bogus without a previous include of sys/mman.h.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> include/sysemu/os-posix.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
> index 07e3e5a..9c7dfdf 100644
> --- a/include/sysemu/os-posix.h
> +++ b/include/sysemu/os-posix.h
> @@ -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>
> --
> 2.5.5
Did you discover this because something broke, or just through
code inspection?
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
We could add mman.h to clean-includes and zap the other includes
of it I guess.
thanks
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] os-posix: include sys/mman.h
2016-06-06 12:11 ` Peter Maydell
@ 2016-06-06 13:59 ` Paolo Bonzini
0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2016-06-06 13:59 UTC (permalink / raw)
To: Peter Maydell; +Cc: QEMU Developers
On 06/06/2016 14:11, Peter Maydell wrote:
> On 6 June 2016 at 13:02, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> qemu/osdep.h checks whether MAP_ANONYMOUS is defined, but this
>> check is bogus without a previous include of sys/mman.h.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>> include/sysemu/os-posix.h | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
>> index 07e3e5a..9c7dfdf 100644
>> --- a/include/sysemu/os-posix.h
>> +++ b/include/sysemu/os-posix.h
>> @@ -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>
>> --
>> 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.
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
>
> We could add mman.h to clean-includes and zap the other includes
> of it I guess.
Yup, good idea.
Thanks,
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-06 13:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-06 12:02 [Qemu-devel] [PATCH] os-posix: include sys/mman.h Paolo Bonzini
2016-06-06 12:11 ` Peter Maydell
2016-06-06 13:59 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).