Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143795770
D9373.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
993 B
Referenced Files
None
Subscribers
None
D9373.diff
View Options
Index: head/sys/compat/linux/linux_mmap.c
===================================================================
--- head/sys/compat/linux/linux_mmap.c
+++ head/sys/compat/linux/linux_mmap.c
@@ -203,8 +203,23 @@
}
}
- error = kern_mmap(td, addr, len, prot, bsd_flags, fd, pos);
+ /*
+ * FreeBSD is free to ignore the address hint if MAP_FIXED wasn't
+ * passed. However, some Linux applications, like the ART runtime,
+ * depend on the hint. If the MAP_FIXED wasn't passed, but the
+ * address is not zero, try with MAP_FIXED and MAP_EXCL first,
+ * and fall back to the normal behaviour if that fails.
+ */
+ if (addr != 0 && (bsd_flags & MAP_FIXED) == 0 &&
+ (bsd_flags & MAP_EXCL) == 0) {
+ error = kern_mmap(td, addr, len, prot,
+ bsd_flags | MAP_FIXED | MAP_EXCL, fd, pos);
+ if (error == 0)
+ goto out;
+ }
+ error = kern_mmap(td, addr, len, prot, bsd_flags, fd, pos);
+out:
LINUX_CTR2(mmap2, "return: %d (%p)", error, td->td_retval[0]);
return (error);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 1, 2:03 PM (2 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28120751
Default Alt Text
D9373.diff (993 B)
Attached To
Mode
D9373: Tweak linux mmap address hint handling.
Attached
Detach File
Event Timeline
Log In to Comment