Next: modf
, Previous: mlockall
, Up: ISO C and POSIX Function Substitutes [Contents][Index]
mmap
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html
Gnulib module: —
Portability problems fixed by Gnulib:
off_t
is a 32-bit type, this function may not
work correctly across the entire data range of files 2 GiB and larger.
See Large File Support.
Portability problems not fixed by Gnulib:
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.