mirror of https://github.com/mkerrisk/man-pages
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:
parent
bedbb5335d
commit
56fe7791c0
41
man2/sync.2
41
man2/sync.2
|
@ -1,6 +1,7 @@
|
||||||
.\" Hey Emacs! This file is -*- nroff -*- source.
|
.\" Hey Emacs! This file is -*- nroff -*- source.
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
|
.\" 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
|
.\" Permission is granted to make and distribute verbatim copies of this
|
||||||
.\" manual provided the copyright notice and this permission notice are
|
.\" 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.
|
.\" 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 Tue Oct 22 22:27:07 1996 by Eric S. Raymond <esr@thyrsus.com>
|
||||||
.\" Modified 2001-10-10 by aeb, following Michael Kerrisk.
|
.\" 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
|
.SH NAME
|
||||||
sync \- commit buffer cache to disk
|
sync, syncfs \- commit buffer cache to disk
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B #include <unistd.h>
|
.B #include <unistd.h>
|
||||||
.sp
|
.sp
|
||||||
.B void sync(void);
|
.B void sync(void);
|
||||||
.sp
|
.sp
|
||||||
|
.BI "void syncfs(int " fd );
|
||||||
|
.sp
|
||||||
.in -4n
|
.in -4n
|
||||||
Feature Test Macro Requirements for glibc (see
|
Feature Test Macro Requirements for glibc (see
|
||||||
.BR feature_test_macros (7)):
|
.BR feature_test_macros (7)):
|
||||||
|
@ -51,16 +55,49 @@ _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
|
||||||
_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
|
_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
|
||||||
.RE
|
.RE
|
||||||
.ad
|
.ad
|
||||||
|
.sp
|
||||||
|
.BR syncfs ():
|
||||||
|
.ad l
|
||||||
|
.RS 4
|
||||||
|
_GNU_SOURCE
|
||||||
|
.RE
|
||||||
|
.ad
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.BR sync ()
|
.BR sync ()
|
||||||
causes all buffered modifications to file metadata and data to be
|
causes all buffered modifications to file metadata and data to be
|
||||||
written to the underlying file systems.
|
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
|
.SH ERRORS
|
||||||
.BR sync ()
|
.BR sync ()
|
||||||
is always successful.
|
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"
|
.SH "CONFORMING TO"
|
||||||
.BR sync ():
|
.BR sync ():
|
||||||
SVr4, 4.3BSD, POSIX.1-2001.
|
SVr4, 4.3BSD, POSIX.1-2001.
|
||||||
|
|
||||||
|
.BR syncfs ()
|
||||||
|
is Linux-specific.
|
||||||
.SH NOTES
|
.SH NOTES
|
||||||
Since glibc 2.2.2 the Linux prototype for
|
Since glibc 2.2.2 the Linux prototype for
|
||||||
.BR sync ()
|
.BR sync ()
|
||||||
|
|
Loading…
Reference in New Issue