MapRequest mreq;
Bool mreq_ok;
-#if defined(VGO_darwin)
+# if defined(VGO_darwin)
// Nb: we can't use this on Darwin, it has races:
// * needs to RETRY if advisory succeeds but map fails
// (could have been some other thread in a nonblocking call)
// (mmap will cheerfully smash whatever's already there, which might
// be a new mapping from some other thread in a nonblocking call)
VG_(core_panic)("can't use ML_(generic_PRE_sys_mmap) on Darwin");
-#endif
+# endif
if (arg2 == 0) {
/* SuSV3 says: If len is zero, mmap() shall fail and no mapping
return VG_(mk_SysRes_Error)( VKI_EINVAL );
}
+# if defined(VKI_MAP_32BIT)
+ /* We can't support MAP_32BIT (at least, not without significant
+ complication), and it's royally unportable, so if the client
+ asks for it, just fail it. */
+ if (arg4 & VKI_MAP_32BIT) {
+ return VG_(mk_SysRes_Error)( VKI_ENOMEM );
+ }
+# endif
+
/* Figure out what kind of allocation constraints there are
(fixed/hint/any), and ask aspacem what we should do. */
mreq.start = arg1;
#define VKI_MAP_PRIVATE 0x02 /* Changes are private */
#define VKI_MAP_FIXED 0x10 /* Interpret addr exactly */
#define VKI_MAP_ANONYMOUS 0x20 /* don't use a file */
+#define VKI_MAP_32BIT 0x40 /* only give out 32bit addresses */
#define VKI_MAP_NORESERVE 0x4000 /* don't check for reservations */
//----------------------------------------------------------------------