|
Maps a file into memory, and returns a pointer to it.
- Parameters:
-
addr |
Suggested address for the mapping |
len |
The number of bytes in the mapped region. The combination of len and offset must not exceed the length of the mapped file |
prot |
Either PROT_NONE, or a combination of the other PROT_* flags |
flags |
One of MAP_PRIVATE, MAP_ANONYMOUS or MAP_FIXED. |
fd |
The file descriptor of the file to map, or -1 to allocate an anonymous map |
offset |
The offset within the file to start the mapped region |
- Return values:
-
pointer |
to mapped region if successful |
MAP_FAILED |
if failed |
- Note:
-
The current implementation supports the following three modes: 1. Read-only file; 2. Read-write file; 3. Anonymous Read-write block of system paging file.
|