sync.2: Added new syncfs() system call

syncfs() was added in Linux 2.6.39.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2011-09-08 02:19:00 +02:00
parent bedbb5335d
commit 56fe7791c0
1 changed files with 39 additions and 2 deletions

View File

@ -1,6 +1,7 @@
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
.\" and Copyright (c) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@ -30,15 +31,18 @@
.\" Added the fact that since 1.3.20 sync actually waits.
.\" Modified Tue Oct 22 22:27:07 1996 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified 2001-10-10 by aeb, following Michael Kerrisk.
.\" 2011-09-07, mtk, Added syncfs() documentation,
.\"
.TH SYNC 2 2010-09-20 "Linux" "Linux Programmer's Manual"
.TH SYNC 2 2011-09-07 "Linux" "Linux Programmer's Manual"
.SH NAME
sync \- commit buffer cache to disk
sync, syncfs \- commit buffer cache to disk
.SH SYNOPSIS
.B #include <unistd.h>
.sp
.B void sync(void);
.sp
.BI "void syncfs(int " fd );
.sp
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
@ -51,16 +55,49 @@ _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
.RE
.ad
.sp
.BR syncfs ():
.ad l
.RS 4
_GNU_SOURCE
.RE
.ad
.SH DESCRIPTION
.BR sync ()
causes all buffered modifications to file metadata and data to be
written to the underlying file systems.
.BR syncfs ()
is like
.BR sync (),
but synchronizes just the file system containing file
referred to by the open file descriptor
.IR fd .
.SH RETURN VALUE
.BR syncfs ()
returns 0 on success;
on error, it returns \-1 and sets
.I errno
to indicate the error.
.SH ERRORS
.BR sync ()
is always successful.
.BR syncfs ()
can fail for at least the following reason:
.TP
.B EBADF
.I fd
is not a valid file descriptor.
.SH VERSIONS
.BR syncfs ()
first appeared in Linux 2.6.39.
.SH "CONFORMING TO"
.BR sync ():
SVr4, 4.3BSD, POSIX.1-2001.
.BR syncfs ()
is Linux-specific.
.SH NOTES
Since glibc 2.2.2 the Linux prototype for
.BR sync ()