diff mbox series

[2/3] linux-user: Fix the build on systems without MAP_SHARED_VALIDATE

Message ID 20230810215706.1394220-3-iii@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series Fix the build on CentOS 7 | expand

Commit Message

Ilya Leoshkevich Aug. 10, 2023, 9:51 p.m. UTC
CentOS 7 does not define MAP_SHARED_VALIDATE. Use a definition provided
by the QEMU's copy of linux/mman.h.

Fixes: 4b840f96096d ("linux-user: Populate more bits in mmap_flags_tbl")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
 linux-user/syscall.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Helge Deller Aug. 10, 2023, 10:03 p.m. UTC | #1
On 8/10/23 23:51, Ilya Leoshkevich wrote:
> CentOS 7 does not define MAP_SHARED_VALIDATE. Use a definition provided
> by the QEMU's copy of linux/mman.h.
>
> Fixes: 4b840f96096d ("linux-user: Populate more bits in mmap_flags_tbl")
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>

Does it fix the missing MADV_WIPEONFORK as well?
https://gitlab.com/qemu-project/qemu/-/issues/1824#note_1507837354

Helge

> ---
>   linux-user/syscall.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 42f4aed8e84..256f38cdd5d 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -121,6 +121,7 @@
>   #ifdef HAVE_BTRFS_H
>   #include <linux/btrfs.h>
>   #endif
> +#include <linux/mman.h>
>   #ifdef HAVE_DRM_H
>   #include <libdrm/drm.h>
>   #include <libdrm/i915_drm.h>
Ilya Leoshkevich Aug. 10, 2023, 10:13 p.m. UTC | #2
On Fri, 2023-08-11 at 00:03 +0200, Helge Deller wrote:
> On 8/10/23 23:51, Ilya Leoshkevich wrote:
> > CentOS 7 does not define MAP_SHARED_VALIDATE. Use a definition
> > provided
> > by the QEMU's copy of linux/mman.h.
> > 
> > Fixes: 4b840f96096d ("linux-user: Populate more bits in
> > mmap_flags_tbl")
> > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> 
> Does it fix the missing MADV_WIPEONFORK as well?
> https://gitlab.com/qemu-project/qemu/-/issues/1824#note_1507837354
> 
> Helge

What a coincidence, that multiple people ran into this on the same day.

This should be fixed by [3/3] of this series.

Best regards,
Ilya
diff mbox series

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 42f4aed8e84..256f38cdd5d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -121,6 +121,7 @@ 
 #ifdef HAVE_BTRFS_H
 #include <linux/btrfs.h>
 #endif
+#include <linux/mman.h>
 #ifdef HAVE_DRM_H
 #include <libdrm/drm.h>
 #include <libdrm/i915_drm.h>