Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fsync.bsd(2) — Domain/IX SR9.5

Media Vault

Software Library

Restoration Projects

Artifacts Sought

FSYNC(2)

NAME

fsync − synchronize a file’s in-core state with that on disk

USAGE

fsync(fd) int fd;

DESCRIPTION

Fsync causes all modified data and attributes of the object referenced by fd to be moved to a permanent (typically disk) storage device.  This normally force-writes all modified copies of buffers for the associated file. 

Fsync should be used by programs that require a file to be in a known state; for example in building a simple transaction facility. 

RETURN VALUE

A successful call returns zero.  A failed call returns -1 and sets errno as indicated below. 

ERRORS

The fsync fails if:

[EBADF] Fd is not a valid descriptor. 

[EINVAL] Fd refers to a socket, not to a file. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026