BSD 4_3_Tahoe development
[unix-history] / usr / man / cat2 / fsync.0
FSYNC(2) UNIX Programmer's Manual FSYNC(2)
N\bNA\bAM\bME\bE
fsync - synchronize a file's in-core state with that on disk
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
f\bfs\bsy\byn\bnc\bc(\b(f\bfd\bd)\b)
i\bin\bnt\bt f\bfd\bd;\b;
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
_\bF_\bs_\by_\bn_\bc causes all modified data and attributes of _\bf_\bd to be
moved to a permanent storage device. This normally results
in all in-core modified copies of buffers for the associated
file to be written to a disk.
_\bF_\bs_\by_\bn_\bc should be used by programs that require a file to be
in a known state, for example, in building a simple transac-
tion facility.
R\bRE\bET\bTU\bUR\bRN\bN V\bVA\bAL\bLU\bUE\bE
A 0 value is returned on success. A -1 value indicates an
error.
E\bER\bRR\bRO\bOR\bRS\bS
The _\bf_\bs_\by_\bn_\bc fails if:
[EBADF] _\bF_\bd is not a valid descriptor.
[EINVAL] _\bF_\bd refers to a socket, not to a file.
[EIO] An I/O error occurred while reading from or
writing to the file system.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
sync(2), sync(8), update(8)
Printed 7/9/88 May 22, 1986 1