sync Subroutine

Purpose

Updates all file systems.

Library

Standard C Library (libc.a)

Syntax

#include <unistd.h>
 
void sync ( )

Description

The sync subroutine causes all information in memory that should be on disk to be written out. The writing, although scheduled, is not necessarily complete upon return from this subroutine. Types of information to be written include modified superblocks, i-nodes, data blocks, and indirect blocks.

The sync subroutine should be used by programs that examine a file system, such as the df and fsck commands.

If Network File System (NFS) is installed on your system, information in memory that relates to remote files is scheduled to be sent to the remote node.