qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 02/16] bsd-user: Ifdef a few MAP_ constants for NetBSD


From: Richard Henderson
Subject: Re: [PATCH 02/16] bsd-user: Ifdef a few MAP_ constants for NetBSD
Date: Sat, 8 Apr 2023 12:03:16 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

On 4/5/23 14:35, Warner Losh wrote:
MAP_GUARD, MAP_EXCL, and MAP_NOCORE are FreeBSD only. Add back the
ifdefs that I removed in 36d5d891559f (but only these ifdefs, the
rest of the commit is not reverted).

Signed-off-by: Warner Losh<imp@bsdimp.com>
---
  bsd-user/mmap.c | 10 ++++++++++
  1 file changed, 10 insertions(+)

diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index d6c5a344c9b..f732a6f6f2b 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -416,27 +416,33 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int 
prot,
              qemu_log("MAP_ALIGNED(%u) ",
                       (flags & MAP_ALIGNMENT_MASK) >> MAP_ALIGNMENT_SHIFT);
          }
+#ifdef MAP_GUARD
          if (flags & MAP_GUARD) {
              qemu_log("MAP_GUARD ");
          }
+#endif

Maybe better as

#ifndef MAP_GUARD
#define MAP_GUARD 0
#endif

etc, somewhere common, and let the compiler eliminate the always false 
conditions.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]