Commit | Line | Data |
---|---|---|
fca9ff2c C |
1 | .TH FSYNC 2 "12 February 1983" |
2 | .UC 4 | |
3 | .SH NAME | |
4 | fsync \- synchronize a file's in-core state with that on disk | |
5 | .SH SYNOPSIS | |
6 | .ft B | |
7 | fsync(fd) | |
8 | .br | |
9 | int fd; | |
10 | .ft R | |
11 | .SH DESCRIPTION | |
12 | .I Fsync | |
13 | causes all modified data and attributes of \fIfd\fP | |
14 | to be moved to a permanent storage device. | |
15 | This normally results in all in-core modified copies | |
16 | of buffers for the associated file to be written to a disk. | |
17 | .PP | |
18 | .I Fsync | |
19 | should be used by programs which require a file to be | |
20 | in a known state; for example in building a simple transaction | |
21 | facility. | |
22 | .SH "RETURN VALUE | |
23 | A 0 value is returned on success. A \-1 value indicates | |
24 | an error. | |
25 | .SH "ERRORS | |
26 | The \fIfsync\fP fails if: | |
27 | .TP 15 | |
28 | [EBADF] | |
29 | \fIFd\fP is not a valid descriptor. | |
30 | .TP 15 | |
31 | [EINVAL] | |
32 | \fIFd\fP refers to a socket, not to a file. | |
33 | .SH "SEE ALSO" | |
34 | sync(2), sync(8), update(8) | |
35 | .SH BUGS | |
36 | The current implementation of this call is expensive for large files. |