|
|
1.1 root 1: .\" Copyright (c) 1983 Regents of the University of California.
2: .\" All rights reserved. The Berkeley software License Agreement
3: .\" specifies the terms and conditions for redistribution.
4: .\"
5: .\" @(#)fsync.2 6.4 (Berkeley) 5/22/86
6: .\"
7: .TH FSYNC 2 "May 22, 1986"
8: .UC 5
9: .SH NAME
10: fsync \- synchronize a file's in-core state with that on disk
11: .SH SYNOPSIS
12: .ft B
13: fsync(fd)
14: .br
15: int fd;
16: .ft R
17: .SH DESCRIPTION
18: .I Fsync
19: causes all modified data and attributes of \fIfd\fP
20: to be moved to a permanent storage device.
21: This normally results in all in-core modified copies
22: of buffers for the associated file to be written to a disk.
23: .PP
24: .I Fsync
25: should be used by programs that require a file to be
26: in a known state, for example, in building a simple transaction
27: facility.
28: .SH "RETURN VALUE
29: A 0 value is returned on success. A \-1 value indicates
30: an error.
31: .SH "ERRORS
32: The \fIfsync\fP fails if:
33: .TP 15
34: [EBADF]
35: \fIFd\fP is not a valid descriptor.
36: .TP 15
37: [EINVAL]
38: \fIFd\fP refers to a socket, not to a file.
39: .TP 15
40: [EIO]
41: An I/O error occurred while reading from or writing to the file system.
42: .SH "SEE ALSO"
43: sync(2), sync(8), update(8)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.