sync2 - Flush file system metadata and data from memory buffers to disk
int sync2 (
unsigned int POLICY ,
Interfaces documented on this reference page conform to industry standards
Refer to the standards(5) reference page for more information about indus-
try standards and associated tags.
Flush the file system memory buffers to disk. The argument is one of
Flush all memory buffers. Specifying this flag causes the function
to behave the same as the sync function. See sync(2).
Flush all memory buffers except those under smooth sync control.
The name of a file system or fileset. Specify the optional path param-
eter when you want to have the POLICY act only on that file system
instead of all file systems. Specify a NULL argument when you want to
have the POLICY act on all file systems.
The sync2 function causes file system data to be flushed (written) to disk.
Which memory buffers are flushed to disk depends on the POLICY argument.
If the policy is SYNC_SYNCPOLICY, all memory buffers are flushed to disk.
If the policy is SYNC_SMOOTHSYNCPOLICY, all memory buffers except those
under smooth sync control are flushed to disk.
To which file systems the POLICY argument applies depends on the path argu-
ment. To apply the policy to one file system, name it in the path argu-
ment. To apply the policy to all file systems, specify the path argument
The writing, although scheduled, is not necessarily complete upon return
from the sync2 function.