On success, a call to mmap() returns the location of the mapping. On failure, the call returns MAP_FAILED, and setserrnoappropriately. A call tommap()never returns0.
The given file descriptor is not a regular file, or the
mode with which it was opened conflicts withprot
The file has been locked via a file lock.
The given file descriptor is not valid.
One or more of the parametersaddr,len, oroff
The system-wide limit on open files has been
The filesystem on which the file to map resides does
not support memory mapping.
The process does not have enough memory.
The result ofaddr+lenexceeds the size of the
blog comments powered by
PROT_EXECwas given, but the filesystem is mounted