summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2006-03-23 23:37:06 +0000
committerpeter <peter@FreeBSD.org>2006-03-23 23:37:06 +0000
commit114d7f6536b9d4bb0c68cadedcbdfb2a72cad8d7 (patch)
tree6b5f61c2afbf6ad43c1dc312989ff9774431c818 /lib/libc
parent7d617251ccf3bd1070412da64297d4297326750f (diff)
downloadFreeBSD-src-114d7f6536b9d4bb0c68cadedcbdfb2a72cad8d7.zip
FreeBSD-src-114d7f6536b9d4bb0c68cadedcbdfb2a72cad8d7.tar.gz
Document that the documented 2GB mmap limit is actually a
documentation bug. We switched to page indexes some time around FreeBSD 2.2. The actual 'len' limit is the maximum file size or what will fit in your address space, whichever comes first. It should be possible to make 1TB files on 32 bit systems, but of course address space runs out long before then.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/sys/mmap.230
1 files changed, 8 insertions, 22 deletions
diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2
index f4c0b42..57f669f 100644
--- a/lib/libc/sys/mmap.2
+++ b/lib/libc/sys/mmap.2
@@ -350,29 +350,15 @@ sysctl.
The
.Fa len
argument
-is limited to 2GB.
-Mmapping slightly more than 2GB does not 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.
+is limited to the maximum file size or available userland address
+space.
+Files may not be able to be made more than 1TB large on 32 bit systems
+due to file systems restrictions and bugs, but address space is far more
+restrictive. Larger files may be possible on 64 bit systems.
.Pp
-The limit is imposed for a variety of reasons.
-Most of them have to do
-with
-.Fx
-not wanting to use 64 bit offsets in the VM system due to
-the extreme performance penalty.
-So
-.Fx
-uses 32bit page indexes and
-this gives
-.Fx
-a maximum of 8TB filesizes.
-It is actually bugs in
-the file system code that causes the limit to be further restricted to
-1TB (loss of precision when doing blockno calculations).
-.Pp
-Another reason for the 2GB limit is that file system metadata can
-reside at negative offsets.
+The previous documented limit of 2GB was a documentation bug.
+That limit has not existed since
+.Fx 2.2 .
.Pp
Note that an attempt to
.Fn mmap
OpenPOWER on IntegriCloud