Next: modf, Previous: mlockall, Up: Function Substitutes [Contents][Index]
mmap
POSIX specification:
http://www.opengroup.org/onlinepubs/9699919799/functions/mmap.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
off_t
is a 32-bit type, this function may not
work correctly across the entire data range of files larger than 2 GB.
The fix is to use the AC_SYS_LARGEFILE
macro.
MAP_ANONYMOUS | MAP_PRIVATE
and -1
instead of a file descriptor;
on others you have to use a read-only file descriptor of /dev/zero.
MAP_FIXED
, often causes mmap
to fail. Better pass NULL
in this case.
MAP_FIXED
basically never works. On other platforms, it depends
on the circumstances whether memory can be returned at a given address.