On 9/19/26 19:20, Warner Losh wrote:
+++ b/bsd-user/mmap.c
@@ -215,10 +215,13 @@ static int mmap_frag(abi_ulong real_start,
prot_new = prot | prot1;
if (fd != -1) {
- /* msync() won't work here, so we return an error if write is
- possible while it is a shared mapping */
- if ((flags & TARGET_BSD_MAP_FLAGMASK) == MAP_SHARED &&
- (prot & PROT_WRITE))
+ /*
+ * msync() won't work here, so we return an error if write is
+ * possible while it is a shared mapping
+ */
+ if (!(flags & MAP_ANON)
+ && (flags & MAP_TYPE) == MAP_SHARED
+ && (prot & PROT_WRITE))
return -1;
/* adjust protection to be able to read */
Need braces, even if they were missing beforehand. Otherwise,
Reviewed-by: Richard Henderson <[email protected]>
r~