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<[email protected]>
---
  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