[PATCH 0/2] Unaligned mmap() on Mac OS X

Ken Thomases ken at codeweavers.com
Wed May 12 18:37:45 CDT 2010


On May 12, 2010, at 2:30 PM, Charles Davis wrote:

> In Mac OS X 10.5, mmap() was changed to conform to UNIX '03. Among other
> things, this means that mmap() no longer supports unaligned file offsets
> (like Linux).

What problems does this cause?


> However, by reading Darwin source, I learned that the check for unaligned
> file offsets is done at the library level, and not in the kernel. This is
> to support older binaries compiled for Tiger and earlier. This means that Wine
> compiled for Tiger should support unaligned file offsets, like want. But it
> also means that, if we make the syscall ourselves instead of calling libc, we
> can support them on Leopard (and by extension, Snow Leopard) too! This patch
> series does just that.

Can't we achieve that just by avoiding the mapping of the "mmap" identifier to the _mmap$UNIX2003 symbol?

http://developer.apple.com/mac/library/releasenotes/Darwin/SymbolVariantsRelNotes/index.html

It may be sufficient to #define _NONSTD_SOURCE, #include <sys/mman.h> as the first header, #undef _NONSTD_SOURCE, and then continue to include any other headers.


Alternatively, you can probably use an approach like this:

http://source.winehq.org/git/wine.git/?a=commitdiff;h=028b763f2f51e78084129975e6333271dd2f861c

Regards,
Ken




More information about the wine-devel mailing list