Go to main content

man pages section 2: System Calls

Exit Print View

Updated: Thursday, June 13, 2019
 
 

sync(2)

Name

sync - update super block

Synopsis

#include <unistd.h>

void sync(void);

Description

The sync() function writes all information in memory that should be on disk, including modified super blocks, modified inodes, and delayed block I/O.

Unlike fsync(3C), which completes the writing before it returns, sync() schedules but does not necessarily complete the writing before returning.

Usage

The sync() function should be used by applications that examine a file system, such as fsck(8), and df(8), and is mandatory before rebooting.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
Standard

See Also

fsync(3C), attributes(7), standards(7), df(8), fsck(8)