Skip to content

Commit c229819

Browse files
krajstephanosio
authored andcommitted
Define MAP_SYNC and MAP_SHARED_VALIDATE on needed linux systems
linux only wires MAP_SYNC and MAP_SHARED_VALIDATE for architectures which include asm-generic/mman.h and mips/powerpc are not including this file in linux/mman.h, therefore these should be defined for such architectures on Linux as well. This fixes build on mips/musl/linux Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/qemu-devel/2022-03/msg05298.html] Signed-off-by: Khem Raj <[email protected]> Cc: Zhang Yi <[email protected]> Cc: Michael S. Tsirkin <[email protected]>
1 parent 8d551fc commit c229819

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

util/mmap-alloc.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@
1010
* later. See the COPYING file in the top-level directory.
1111
*/
1212

13+
#include "qemu/osdep.h"
1314
#ifdef CONFIG_LINUX
1415
#include <linux/mman.h>
15-
#else /* !CONFIG_LINUX */
16+
#endif /* CONFIG_LINUX */
17+
18+
#ifndef MAP_SYNC
1619
#define MAP_SYNC 0x0
20+
#endif /* MAP_SYNC */
21+
#ifndef MAP_SHARED_VALIDATE
1722
#define MAP_SHARED_VALIDATE 0x0
18-
#endif /* CONFIG_LINUX */
23+
#endif /* MAP_SHARED_VALIDATE */
1924

20-
#include "qemu/osdep.h"
2125
#include "qemu/mmap-alloc.h"
2226
#include "qemu/host-utils.h"
2327
#include "qemu/cutils.h"

0 commit comments

Comments
 (0)