No subject
Fri Feb 17 02:32:51 UTC 2012
void *
mmap(void * addr, size_t len, int prot, int flags, int fd, off_t offset)
BUGS
len is limited to 2GB. Mmapping slightly more than 2GB doesn't work, but
it is possible to map a window of size (filesize % 2GB) for file sizes of
slightly less than 2G, 4GB, 6GB and 8GB.
The limit is imposed for a variety of reasons. Most of them have to do
with FreeBSD not wanting to use 64 bit offsets in the VM system due to
the extreme performance penalty. So FreeBSD uses 32bit page indexes and
this gives FreeBSD a maximum of 8TB filesizes. It's actually bugs in the
filesystem code that causes the limit to be further restricted to 1TB
(loss of precision when doing blockno calculations).
Another reason for the 2GB limit is that filesystem metadata can reside
at negative offsets.
We currently can only deal with page aligned file offsets.
--
Ian Freislich
UUNET S.A. (Pty) Ltd
More information about the inn-workers
mailing list