Subject: kern/21948: Allow mmap(2) hint to be taken literally
To: None <gnats-bugs@gnats.netbsd.org>
From: None <tv@pobox.com>
List: netbsd-bugs
Date: 06/20/2003 21:05:25
>Number:         21948
>Category:       kern
>Synopsis:       Allow mmap(2) hint to be taken literally
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 21 01:08:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Todd Vierling
>Release:        NetBSD 1.6.1_STABLE
>Organization:
	DUH.ORG:  Pointing out the obvious since 1994.
>Environment:
System: NetBSD server.duh.org 1.6.1_STABLE NetBSD 1.6.1_STABLE (HOME) #2: Wed May 21 13:10:29 EDT 2003 tv@server.duh.org:/export/SRC/duh/netbsd-kernels/HOME i386
Architecture: i386
Machine: i386

>Description:

For full details, see:

    http://mail-index.netbsd.org/tech-kern/2003/06/20/0006.html

Basically, this provides a hook that gives "Linux-like" mmap(2) behavior
when MAP_FIXED is not specified, allowing CrossOver Office to mmap
memory regions in an efficient manner.  Included in the change here is
a hook to make use of this option by default under compat_linux.

>How-To-Repeat:

Run a Linux Wine binary, and get errors about .EXEs not having relocation
records because they cannot be mapped to 0x400000 and need to be
relocated.

>Fix:

Diff against -current as of 20030620.  This should pull up fine to the
1.6 branch with trivial or no merge conflicts.  (There are some one-line
changes from HEAD to netbsd-1-6 in the context diff lines, but these
should not cause cvs to raise conflicts.)

If happy with this change, please pull it up to 1.6; this is one of
several changes required to make CrossOver Office run on NetBSD/i386.

begin 644 src.diff.gz
M'XL("+*M\SX``W@`M55I3^-($/UL_XH:K;1+<`[;"0&,6!$-88G$I81AV4]1
MQRXG+7Q-=SLD.\Q_WVH?A`B0&*V("-WM=+VZ7CV/D@!7'LBU[/AIG#'5B7B2
MK_0A3I/R,(VY]-N^>?S_/^;XZP1"'J$''7\I19JJCA1^YR/^FTM3H!(<ESR9
M@Z!%\C0!I^W8A^U>VS4#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