1SYNC(2)                    Linux Programmer's Manual                   SYNC(2)
2
3
4

NAME

6       sync - commit buffer cache to disk
7

SYNOPSIS

9       #include <unistd.h>
10
11       void sync(void);
12

DESCRIPTION

14       sync() first commits inodes to buffers, and then buffers to disk.
15

ERRORS

17       This function is always successful.
18

CONFORMING TO

20       SVr4, 4.3BSD, POSIX.1-2001.
21

BUGS

23       According  to  the  standard specification (e.g., POSIX.1-2001), sync()
24       schedules the writes, but may return before the actual writing is done.
25       However,  since  version  1.3.20 Linux does actually wait.  (This still
26       does not guarantee data integrity: modern disks have large caches.)
27

NOTES

29       Since glibc 2.2.2 the Linux prototype is as listed above, following the
30       various  standards.  In libc4, libc5, and glibc up to 2.2.1 it was "int
31       sync(void)", and sync() always returned 0.
32

SEE ALSO

34       bdflush(2), fdatasync(2), fsync(2), sync(8), update(8)
35
36
37
38Linux 2.4                         2001-10-10                           SYNC(2)
Impressum