Commit | Line | Data |
---|---|---|
15715acc KB |
1 | .\" Copyright (c) 1980, 1991, 1993 |
2 | .\" The Regents of the University of California. All rights reserved. | |
5f440b1e | 3 | .\" |
931b8415 | 4 | .\" %sccs.include.redist.man% |
5f440b1e | 5 | .\" |
15715acc | 6 | .\" @(#)sync.2 8.1 (Berkeley) %G% |
931b8415 CL |
7 | .\" |
8 | .Dd | |
9 | .Dt SYNC 2 | |
10 | .Os BSD 4 | |
11 | .Sh NAME | |
12 | .Nm sync | |
13 | .Nd "synchronize disk block in-core status with that on disk" | |
14 | .Sh SYNOPSIS | |
15 | .Fd #include <unistd.h> | |
16 | .Ft void | |
17 | .Fn sync void | |
18 | .Sh DESCRIPTION | |
19 | The | |
20 | .Fn sync | |
21 | function forces a write of dirty (modified) buffers | |
22 | in the block buffer cache out | |
23 | to disk. The kernel keeps this information in core to reduce | |
24 | the number of disk I/O transfers required by the system. | |
25 | As information in the cache is lost after a system crash a | |
26 | .Fn sync | |
27 | call is issued | |
28 | frequently | |
29 | by the user process | |
30 | .Xr update 8 | |
31 | (about every 30 seconds). | |
32 | .Pp | |
33 | The function | |
34 | .Xr fsync 2 | |
35 | may be used to synchronize individual file descriptor | |
36 | attributes. | |
37 | .Sh SEE ALSO | |
38 | .Xr fsync 2 , | |
39 | .Xr sync 8 , | |
40 | .Xr update 8 | |
41 | .Sh BUGS | |
42 | .Fn Sync | |
43 | may return before the buffers are completely flushed. | |
44 | .Sh HISTORY | |
45 | A | |
46 | .Nm | |
47 | function call appeared in Version 6 AT&T UNIX. |