fsync(2) — Linux manual page

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS | VERSIONS | STANDARDS | HISTORY | SEE ALSO | COLOPHON

fsync(2)                   System Calls Manual                   fsync(2)

NAME         top

       fsync, fdatasync - synchronize a file's in-core state with storage
       device

LIBRARY         top

       Standard C library (libc, -lc)

SYNOPSIS         top

       #include <unistd.h>

       int fsync(int fd);

       int fdatasync(int fd);

   Feature Test Macro Requirements for glibc (see
   feature_test_macros(7)):

       fsync():
           glibc 2.16 and later:
               No feature test macros need be defined
           glibc up to and including 2.15:
               _BSD_SOURCE || _XOPEN_SOURCE
                   || /* Since glibc 2.8: */ _POSIX_C_SOURCE >= 200112L

       fdatasync():
           _POSIX_C_SOURCE >= 199309L || _XOPEN_SOURCE >= 500

DESCRIPTION