Synchronize mapped memory at address with the underlying file.
Declared in <bdls_filesystemutil.h>
static
int
sync(
char* address,
std::size_t numBytes,
bool syncFlag);
Synchronize the contents of the specified numBytes of mapped memory beginning at the specified address with the underlying file on disk. If the specified syncFlag is true, block until all writes to nonvolatile media have actually completed, otherwise, return once they have been scheduled. Return 0 on success, and a non-zero value otherwise. The behavior is undefined unless address is aligned on a page boundary, numBytes is a multiple of pageSize(), and 0 <= numBytes.
0 on success, and a non-zero value otherwise
| Name | Description |
|---|---|
| address | base address of the mapped memory to synchronize |
| numBytes | number of bytes to synchronize |
| syncFlag | true to block until writes complete; false to return once they have been scheduled |