Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fsync(2) — DG/UX R4.11MU05

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sync(1M)

sync(2)



fsync(2)                       DG/UX R4.11MU05                      fsync(2)


NAME
       fsync - synchronize a file's in-core state with that on disk

SYNOPSIS
       #include <unistd.h>

       int  fsync (fildes)
       int  fildes;

   where:
       fildes    A valid, active file descriptor that refers to an open
                 file.

DESCRIPTION
       The fsync system call causes all modified data and attributes of the
       specified file to be written to disk.  Write operations performed by
       the write or writev system calls are atomic, so it is not possible
       for fsync to record the results of a partial write.  Also, while the
       fsync is being performed, further writes to the file are blocked.
       Thus, fsync ensures that a snapshot of the file is on physical disk.

       Upon successful completion of all writes, the file's time of last
       file attribute change (stctime) is set to the current time.

ACCESS CONTROL
       None.

RETURN VALUE
       0      The synchronization was successful.

       -1     An error occurred.  errno is set to indicate the error.

DIAGNOSTICS
       Errno may be set to one of the following error codes:

       EBADF     Fildes is not a valid descriptor.

       EINVAL    Fildes refers to an object other than a file.

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

       EINTR     An interrupt occurred during the synchronization.  This may
                 happen only with remote (NFS) file systems.

SEE ALSO
       sync(1M), sync(2).


Licensed material--property of copyright holder(s)

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