summaryrefslogtreecommitdiff
path: root/manual/llio.texi
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-02-11 09:54:25 +0000
committerUlrich Drepper <drepper@redhat.com>2001-02-11 09:54:25 +0000
commitb642f10105b7980c704c5b00f1505864365456ab (patch)
tree78d75158f1d1054fdc023fb45fbda4d3958dd445 /manual/llio.texi
parent8a2f1f5b5f7cdfcaf465415736a75a582bc5562a (diff)
(Currency Symbol): Add INT_ constants and CODESET:
Diffstat (limited to 'manual/llio.texi')
-rw-r--r--manual/llio.texi31
1 files changed, 25 insertions, 6 deletions
diff --git a/manual/llio.texi b/manual/llio.texi
index 4efb552b8f..782e5b13ff 100644
--- a/manual/llio.texi
+++ b/manual/llio.texi
@@ -1119,21 +1119,26 @@ of the file that a program actually accesses are loaded. Accesses to
not-yet-loaded parts of the mmapped region are handled in the same way as
swapped out pages.
-Since mmapped pages can be stored back to their file when physical memory
-is low, it is possible to mmap files orders of magnitude larger than both
-the physical memory @emph{and} swap space. The only limit is address
-space. The theoretical limit is 4GB on a 32-bit machine - however, the
-actual limit will be smaller since some areas will be reserved for other
-purposes.
+Since mmapped pages can be stored back to their file when physical
+memory is low, it is possible to mmap files orders of magnitude larger
+than both the physical memory @emph{and} swap space. The only limit is
+address space. The theoretical limit is 4GB on a 32-bit machine -
+however, the actual limit will be smaller since some areas will be
+reserved for other purposes. If the LFS interface is used the file size
+on 32-bit systems is not limited to 2GB (offsets are signed which
+reduces the addressable area of 4GB by half); the full 64-bit are
+available.
Memory mapping only works on entire pages of memory. Thus, addresses
for mapping must be page-aligned, and length values will be rounded up.
To determine the size of a page the machine uses one should use
+@vindex _SC_PAGESIZE
@smallexample
size_t page_size = (size_t) sysconf (_SC_PAGESIZE);
@end smallexample
+@noindent
These functions are declared in @file{sys/mman.h}.
@deftypefun {void *} mmap (void *@var{address}, size_t @var{length},int @var{protect}, int @var{flags}, int @var{filedes}, off_t @var{offset})
@@ -1252,6 +1257,20 @@ The file is on a filesystem that doesn't support mapping.
@end deftypefun
+@deftypefun {void *} mmap64 (void *@var{address}, size_t @var{length},int @var{protect}, int @var{flags}, int @var{filedes}, off64_t @var{offset})
+The @code{mmap64} function is equivalent to the @code{mmap} function but
+the @var{offset} parameter is of type @code{off64_t}. On 32-bit systems
+this allows the file associated with the @var{filedes} descriptor to be
+larger than 2GB. @var{filedes} must be a descriptor returned from a
+call to @code{open64} or @code{fopen64} and @code{freopen64} where the
+descriptor is retrieved with @code{fileno}.
+
+When the sources are translated with @code{_FILE_OFFSET_BITS == 64} this
+function is actually available under the name @code{mmap}. I.e., the
+new, extended API using 64 bit file sizes and offsets transparently
+replaces the old API.
+@end deftypefun
+
@deftypefun int munmap (void *@var{addr}, size_t @var{length})
@code{munmap} removes any memory maps from (@var{addr}) to (@var{addr} +