sync, syncfs - commit filesystem caches to disk


   #include <unistd.h>

   void sync(void);

   int syncfs(int fd);

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

       _XOPEN_SOURCE >= 500
           || /* Since glibc 2.19: */ _DEFAULT_SOURCE
           || /* Glibc versions <= 2.19: */ _BSD_SOURCE



   sync()  causes  all  pending  modifications  to filesystem metadata and
   cached file data to be written to the underlying filesystems.

   syncfs()  is  like  sync(),  but  synchronizes  just   the   filesystem
   containing file referred to by the open file descriptor fd.


   syncfs()  returns  0 on success; on error, it returns -1 and sets errno
   to indicate the error.


   sync() is always successful.

   syncfs() can fail for at least the following reason:

   EBADF  fd is not a valid file descriptor.


   syncfs() first appeared in Linux 2.6.39; library support was  added  to
   glibc in version 2.14.


   sync(): POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.

   syncfs() is Linux-specific.


   Since  glibc  2.2.2, the Linux prototype for sync() is as listed above,
   following the various standards.  In glibc 2.2.1 and  earlier,  it  was
   "int sync(void)", and sync() always returned 0.

   According  to  the  standard specification (e.g., POSIX.1-2001), sync()
   schedules the writes, but may return before the actual writing is done.
   However  Linux  waits  for I/O completions, and thus sync() or syncfs()
   provide the same guarantees as fsync called on every file in the system
   or filesystem respectively.


   Before  version  1.3.20  Linux  did not wait for I/O to complete before


   sync(1), fdatasync(2), fsync(2)


   This page is part of release 4.09 of the Linux  man-pages  project.   A
   description  of  the project, information about reporting bugs, and the
   latest    version    of    this    page,    can     be     found     at

More Linux Commands

git-gc(1) - Cleanup unnecessary files and optimize the local
Runs a number of housekeeping tasks within the current repository, such as compressing file revisions (to reduce disk space and increase performance) and removi

inet_addr(3) - Internet address manipulation routines.......
inet_aton() converts the Internet host address cp from the IPv4 numbers-and-dots notation into binary form (in network byte order) and stores it in the structur

attr_off(3ncurses) - curses character and window attribute c
These routines manipulate the current attributes of the named window. The current attributes of a window apply to all characters that are written into the windo

Module::Build::Bundling(3pm) - How to bundle Module::Build w
WARNING -- THIS IS AN EXPERIMENTAL FEATURE In order to install a distribution using Module::Build, users must have Module::Build available on their systems. The

strfile(1) create a random access file for storing strings b
strfile reads a file containing groups of lines separated by a line containing a single percent % sign (or other specified delimiter character) and creates a da

gnutls_x509_crt_deinit(3) - API function - Linux man page...
This function will deinitialize a certificate structure. REPORTING BUGS Report bugs to &lt;;. GnuTLS home page:

pthread_attr_setguardsize(3) - set/get guard size attribute
The pthread_attr_setguardsize() function sets the guard size attribute of the thread attributes object referred to by attr to the value specified in guardsize.

getgroups32(2) - get/set list of supplementary group IDs....
getgroups() returns the supplementary group IDs of the calling process in list. The argument size should be set to the maximum number of items that can be store

reboot(8) - Halt, power-off or reboot the machine (ManPage)
halt, poweroff, reboot may be used to halt, power-off or reboot the machine. OPTIONS The following options are understood: --help Print a short help text and ex

sha1(1ssl) message digests (Commands - Linux manual page)...
The digest functions output the message digest of a supplied file or files in hexadecimal. The digest functions also generate and verify digital signatures usin

Tcl_GetChannelName(3) - procedures for creating and manipula
Tcl uses a two-layered channel architecture. It provides a generic upper layer to enable C and Tcl programs to perform input and output using the same APIs for

sigaddset(3) - POSIX signal set operations. - Linux man page
These functions allow the manipulation of POSIX signal sets. sigemptyset() initializes the signal set given by set to empty, with all signals excluded from the

We can't live, work or learn in freedom unless the software we use is free.