Available in

(1) (2) (3) (8) (1)/cs (1)/de (2)/de (2)/es (8)/es (1)/fr (2)/fr (8)/fr (1)/hu (8)/hu (2)/it (1)/ja (2)/ja (8)/ja (2)/ko (8)/ko (2)/nl (1)/pl (2)/pl (2)/pt (8)/pt (2)/ru (8)/ru (1)/tr (1)/zh_cn (8)/zh_cn (1)/zh_tw (8)/zh_tw

Contents

NOME

sync − svuota i buffer della cache del disco

SINTASSI

#include <unistd.h>

void sync(void);

Test delle funzioni e requisiti delle macro per glibc (vedere feature_test_macros(7)):

sync(): _BSD_SOURCE || _XOPEN_SOURCE >= 500

DESCRIZIONE

sync() prima riversa gli inode nei buffer, poi i buffer sul disco.

ERRORI

Questa funzione termina sempre con successo.

CONFORME A

SVr4, 4.3BSD, POSIX.1-2001.

NOTE

A partire da glibc 2.2.2 il prototipo Linux è come elencato sopra, seguendo i vari standard. In libc4, libc5, e glibc fino a 2.2.1 era "int sync(void)", e sync() restituiva sempre 0.

BACHI

Secondo le specifiche degli standard (per esempio, POSIX.1-2001), sync() programma le scritture, ma potrebbe tornare prima che la scrittura sia eseguita. Tuttavia, a partire dalla versione 1.3.20 di Linux, essa aspetta. (Questo ancora non garantisce l’integrità dei dati: i dischi moderni hanno grandi cache).

VEDERE ANCHE

bdflush(2), fdatasync(2), fsync(2), sync(8), update(8)

COMMENTS

blog comments powered by Disqus