Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

open(2)

sync(2)

write(2)

fsync(2)  —  System Calls

NAME

fsync −  Writes changes in a file to permanent storage

SYNOPSIS

int fsync (
int filedes );

PARAMETERS

filedesSpecifies a valid open file descriptor. 

DESCRIPTION

The fsync() function saves all modified data in the file open on the filedes parameter to permanent storage. On return from the fsync() function, all updates have been saved on permanent storage. 

NOTES

The file identified by the filedes parameter must be open for writing when the fsync() function is issued or the call fails. This restriction was not enforced in BSD systems. 

AES Support Level:
Trial use

RETURN VALUES

Upon successful completion, the fsync() function returns a value of 0 (zero). If fsync() fails, a value of -1 is returned and errno is set to indicate the error. 

ERRORS

If the fsync() function fails, errno may be set to one of the following values:

[EIO]An I/O error occurred while reading from or writing to the file system. 

[EBADF]The filedes parameter is not a valid file descriptor open for writing. 

[EINVAL]The filedes parameter does not refer to a file on which this operation is possible. 

[EINTR]The fsync() function was interrupted by a signal which was caught. 

RELATED INFORMATION

Functions: open(2), sync(2), write(2)

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