Skip to contentSkip to conversation

linux-user: Add missing mmap include

PATCH In review Patrick Leis 3 participants 3 messages Oct 28, 2024 – Nov 12, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: Add missing mmap include

From: Peter Foley <[email protected]>

error: use of undeclared identifier 'MAP_FIXED_NOREPLACE'

---
 linux-user/user-mmap.h | 2 ++
 1 file changed, 2 insertions(+)
linux-user/user-mmap.h +2 -0
index b94bcdcf83..de769f9253 100644
@@ -18,6 +18,8 @@
 #ifndef LINUX_USER_USER_MMAP_H
 #define LINUX_USER_USER_MMAP_H
 
+#include "linux/mman.h"
+
 /*
  * Guest parameters for the ADDR_COMPAT_LAYOUT personality
  * (at present this is the only layout supported by QEMU).
Signature · 1 line
2.47.0.163.g1226f6d8fa-goog
#1 lore raw
Quoted 15 lines · Patrick Leis

From: Peter Foley <[email protected]>

error: use of undeclared identifier 'MAP_FIXED_NOREPLACE'

---
  linux-user/user-mmap.h | 2 ++
  1 file changed, 2 insertions(+)
linux-user/user-mmap.h +0 -0
index b94bcdcf83..de769f9253 100644

linux-user/user-mmap.h line 25

Quoted 8 lines
linux-user/user-mmap.h +2 -0
@@ -18,6 +18,8 @@
  #ifndef LINUX_USER_USER_MMAP_H
  #define LINUX_USER_USER_MMAP_H
 
+#include "linux/mman.h"
+
  /*
   * Guest parameters for the ADDR_COMPAT_LAYOUT personality
   * (at present this is the only layout supported by QEMU).

In what context does this appear?
Both glibc and musl define this in <sys/mmap.h>.

r~

#2 lore raw
Quoted 15 lines · Richard Henderson
Quoted 14 lines · Patrick Leis

From: Peter Foley <[email protected]>
error: use of undeclared identifier 'MAP_FIXED_NOREPLACE'

---
  linux-user/user-mmap.h | 2 ++
  1 file changed, 2 insertions(+)
linux-user/user-mmap.h +0 -0
index b94bcdcf83..de769f9253 100644
@@ -18,6 +18,8 @@
  #ifndef LINUX_USER_USER_MMAP_H
  #define LINUX_USER_USER_MMAP_H
Quoted 8 lines

linux-user/user-mmap.h line 25

Quoted 5 lines
linux-user/user-mmap.h +1 -0
  +#include "linux/mman.h"
+
  /*
   * Guest parameters for the ADDR_COMPAT_LAYOUT personality
   * (at present this is the only layout supported by QEMU).

In what context does this appear?
Both glibc and musl define this in <sys/mmap.h>.

I'm going to take a wild guess it's bionic:

🕙16:33:53 alex@draig:bionic.git on  main
➜ git grep MAP_FIXED_NOREPLACE libc/kernel/uapi/asm-generic/mman-common.h:#define MAP_FIXED_NOREPLACE 0x100000

Quoted 3 lines

r~

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro