Using msync()

The msync() interface causes all modified pages in the specified address range to be flushed to the objects mapped by those addresses. This command is similar to the fsync() function, which operates on files.

For more information, see the fsync(3C) and msync(3C) man pages.