Map a file section into read-only memory.
Declared in <bdls_fdstreambuf.h>
void*
mmap(
std::streamoff offset,
std::streamoff length);
Map to memory a section of the file starting at the specified offset from the start of the file and return a pointer to that memory. The section mapped is to be of the specified length. The behavior is undefined unless offset is a multiple of pageSize. Note that the memory is mapped for readonly access.
pointer to the mapped read-only memory
| Name | Description |
|---|---|
| offset | byte offset from the start of the file |
| length | length in bytes of the section to map |