/* * Sample program for sync system call - No.35 * * sync - commit buffer chache to disk * * Synopsis * #include * * void sync(void); * * Description * sync first commits inodes to buffers, and then buffers to disk. * * sync causes all information in memory that should be on disk to be * written out. This includes modified super blocks, modified i-nodes, * and delayed block I/O. * * It should be used by programs that examine a file system, such as * fsck, df, etc. It is mandatory before a re-boot. * * The writing, although scheduled, is not necessarily completed before * sync returns. The fsync system call completes the writing before it * returns. */ #include main() { sync(); }