[PATCH] linux-user: Add missing mmap include

Patrick Leis posted 1 patch 3 weeks, 4 days ago
linux-user/user-mmap.h | 2 ++
1 file changed, 2 insertions(+)
[PATCH] linux-user: Add missing mmap include
Posted by Patrick Leis 3 weeks, 4 days ago
From: Peter Foley <pefoley@google.com>

error: use of undeclared identifier 'MAP_FIXED_NOREPLACE'

Signed-off-by: Patrick Leis <venture@google.com>
Signed-off-by: Peter Foley <pefoley@google.com>
---
 linux-user/user-mmap.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/linux-user/user-mmap.h b/linux-user/user-mmap.h
index b94bcdcf83..de769f9253 100644
--- a/linux-user/user-mmap.h
+++ b/linux-user/user-mmap.h
@@ -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).
-- 
2.47.0.163.g1226f6d8fa-goog
Re: [PATCH] linux-user: Add missing mmap include
Posted by Richard Henderson 1 week, 3 days ago
On 10/28/24 11:18, Patrick Leis wrote:
> From: Peter Foley <pefoley@google.com>
> 
> error: use of undeclared identifier 'MAP_FIXED_NOREPLACE'
> 
> Signed-off-by: Patrick Leis <venture@google.com>
> Signed-off-by: Peter Foley <pefoley@google.com>
> ---
>   linux-user/user-mmap.h | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/linux-user/user-mmap.h b/linux-user/user-mmap.h
> index b94bcdcf83..de769f9253 100644
> --- a/linux-user/user-mmap.h
> +++ b/linux-user/user-mmap.h
> @@ -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~
Re: [PATCH] linux-user: Add missing mmap include
Posted by Alex Bennée 1 week, 3 days ago
Richard Henderson <richard.henderson@linaro.org> writes:

> On 10/28/24 11:18, Patrick Leis wrote:
>> From: Peter Foley <pefoley@google.com>
>> error: use of undeclared identifier 'MAP_FIXED_NOREPLACE'
>> Signed-off-by: Patrick Leis <venture@google.com>
>> Signed-off-by: Peter Foley <pefoley@google.com>
>> ---
>>   linux-user/user-mmap.h | 2 ++
>>   1 file changed, 2 insertions(+)
>> diff --git a/linux-user/user-mmap.h b/linux-user/user-mmap.h
>> index b94bcdcf83..de769f9253 100644
>> --- a/linux-user/user-mmap.h
>> +++ b/linux-user/user-mmap.h
>> @@ -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>.

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

>
>
> r~

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro