.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 .\" and Copyright (c) 2011 Michael Kerrisk .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" Modified by Michael Haardt .\" Modified Sat Jul 24 12:02:47 1993 by Rik Faith .\" Modified 15 Apr 1995 by Michael Chastain : .\" Added reference to `bdflush(2)'. .\" Modified 960414 by Andries Brouwer : .\" Added the fact that since 1.3.20 sync actually waits. .\" Modified Tue Oct 22 22:27:07 1996 by Eric S. Raymond .\" Modified 2001-10-10 by aeb, following Michael Kerrisk. .\" 2011-09-07, mtk, Added syncfs() documentation, .\" .\" Tradotto da Goffredo Baroncelli kreijack@usa.net .\" Aggiornamento a man-pages-2.11 di Giulio Daprelà .\" novembre 2005 .\" Aggiornamento a man-pages-2.38 di Giulio Daprelà - agosto 2006 .\" Aggiornamento a man-pages-2.64 di Elisabetta Galli - agosto 2007 .\" Aggiornamento a man-pages-3.53 di Marco Curreli .\" agosto 2013 .\" Aggiornamento a man-pages-3.64 di M. Curreli - aprile 2013 .\" Aggiornamento a man-pages 3.72 di M. Curreli - settembre 2014 .\" .TH SYNC 2 2014-08-19 "Linux" "Linux Programmer's Manual" .SH NOME sync \- svuota i buffer della cache del disco .SH SINTASSI .B #include .sp .B void sync(void); .sp .BI "int syncfs(int " fd ); .sp .in -4n Macro per test di funzionalità per glibc (vedere .BR feature_test_macros (7)): .in .sp .BR sync (): .ad l .RS 4 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .RE .ad .sp .BR syncfs (): .ad l .RS 4 _GNU_SOURCE .RE .ad .SH DESCRIZIONE .BR sync () provoca la scrittura nei filesystem sottostanti di tutte le modifiche ai metadati e ai dati del file che si trovano nel buffer. .BR syncfs () è come .BR sync (), ma sincronizza solo il filesystem contenente il file a cui si riferisce il descrittore di file aperto .IR fd . .SH VALORE RESTITUITO .BR syncfs () ritorna 0 in caso di successo; in caso di errore, ritorna \-1 e imposta .I errno in modo che indichi l'errore. .SH ERRORI .BR sync () termina sempre con successo. .BR syncfs () può fallire per almeno il motivo seguente: .TP .B EBADF .I fd non è un descrittore di file valido. .SH VERSIONI .BR syncfs () è apparso per la prima volta in Linux 2.6.39; il supporto alla libreria è stato aggiunto a glibc nella versione version 2.14. .SH CONFORME A .BR sync (): SVr4, 4.3BSD, POSIX.1-2001. .BR syncfs () è specifico di Linux. .SH NOTE A partire da glibc 2.2.2 il prototipo Linux per .BR sync () è come elencato sopra, seguendo i vari standard. In libc4, libc5, e glibc 2.2.1 e precedenti era "int sync(void)", e .BR sync () restituiva sempre 0. .SH BUG Secondo le specifiche degli standard (per esempio, POSIX.1-2001), .BR sync () pianifica le scritture, ma potrebbe ritornare prima che la scrittura sia stata realmente effettuata. 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). .SH VEDERE ANCHE .BR bdflush (2), .BR fdatasync (2), .BR fsync (2), .BR sync (8) .SH COLOPHON Questa pagina fa parte del rilascio 3.73 del progetto Linux .IR man-pages . Una descrizione del progetto, le istruzioni per la segnalazione degli errori, e l'ultima versione di questa pagina si trova su \%http://www.kernel.org/doc/man\-pages/. La versione italiana fa parte del pacchetto .I man-pages-it v. 3.73, a cura di: ILDP "Italian Linux Documentation Project" \%http://www.pluto.it/ildp .br Per la traduzione in italiano si pu\(`o fare riferimento a http://www.pluto.it/ildp/collaborare/ .br Segnalare eventuali errori di traduzione a .IR ildp@pluto.it