[#BloombergLP-bdls-FilesystemUtil-sync]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FilesystemUtil.adoc[FilesystemUtil]::sync
:relfileprefix: ../../../
:mrdocs:

Synchronize the contents of the specified `numBytes` of mapped memory beginning at the specified `address` with the underlying file on disk&period; If the specified `syncFlag` is true, block until all writes to nonvolatile media have actually completed, otherwise, return once they have been scheduled&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; The behavior is undefined unless `address` is aligned on a page boundary, `numBytes` is a multiple of `pageSize()`, and `0 &lt;&equals; numBytes`&period;

== Synopsis

Declared in `&lt;bdls&lowbar;filesystemutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
sync(
    char* address,
    std::size&lowbar;t numBytes,
    bool syncFlag);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
