FAT | RFS | XFS

sync()

PROTOTYPE

#include <posix.h>

void sync(void);

DESCRIPTION

sync() flushes any buffered file system changes (metadata and user data) of every mounted volume to the respective underlying storage media. Like Linux, Blunk’s implementation of sync() blocks until all changes are saved, though this is not required by the POSIX standard.

errno is set if an error occurs.

EXAMPLE

  /*-----------------------------------------------------------------*/
  /* Flush file data to the flash media.                             */
  /*-----------------------------------------------------------------*/
  sync();