@node sync, unix @subheading Syntax @example #include int sync(void); @end example @subheading Description Intended to assist porting Unix programs. Under Unix, @code{sync} flushes all caches of previously written data. In this implementation, @code{sync} calls @code{fsync} on every open file. @xref{fsync}. It also calls @code{_flush_disk_cache} (@pxref{_flush_disk_cache}) to try to force cached data to the disk. @subheading Return Value Always returns 0. @subheading Portability @portability !ansi, !posix @subheading Example @example sync(); @end example