7139 Sync mDNS with mDNSResponder-625.41.2
[unleashed.git] / usr / src / man / man3c / fdatasync.3c
blob8b6d2fbfca9d41bd83cce0e73523f6c492d2a3d5
1 '\" te
2 .\" Copyright (c) 1997, The Open Group. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" Portions Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\"  This notice shall appear on any product containing this material.
9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
12 .TH FDATASYNC 3C "Feb 5, 2008"
13 .SH NAME
14 fdatasync \- synchronize a file's data
15 .SH SYNOPSIS
16 .LP
17 .nf
18 #include <unistd.h>
20 \fBint\fR \fBfdatasync\fR(\fBint\fR \fIfildes\fR);
21 .fi
23 .SH DESCRIPTION
24 .sp
25 .LP
26 The \fBfdatasync()\fR function forces all currently queued I/O operations
27 associated with the file indicated by file descriptor \fIfildes\fR to the
28 synchronized I/O completion state.
29 .sp
30 .LP
31 The functionality is as described for \fBfsync\fR(3C) (with the symbol
32 \fB_XOPEN_REALTIME\fR defined), with the exception that all I/O operations are
33 completed as defined for synchronised I/O data integrity completion.
34 .SH RETURN VALUES
35 .sp
36 .LP
37 If successful, the \fBfdatasync()\fR function returns \fB0\fR. Otherwise, the
38 function returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error. If the
39 \fBfdatasync()\fR function fails, outstanding I/O operations are not guaranteed
40 to have been completed.
41 .SH ERRORS
42 .sp
43 .LP
44 The  \fBfdatasync()\fR function will fail if:
45 .sp
46 .ne 2
47 .na
48 \fB\fBEBADF\fR\fR
49 .ad
50 .RS 10n
51 The \fIfildes\fR argument is not a valid file descriptor open for writing.
52 .RE
54 .sp
55 .ne 2
56 .na
57 \fB\fBEINVAL\fR\fR
58 .ad
59 .RS 10n
60 The system does not support synchronized I/O for this file.
61 .RE
63 .sp
64 .ne 2
65 .na
66 \fB\fBENOSYS\fR\fR
67 .ad
68 .RS 10n
69 The function \fBfdatasync()\fR is not supported by the system.
70 .RE
72 .sp
73 .LP
74 In the event that any of the queued I/O operations fail, \fBfdatasync()\fR
75 returns the error conditions defined for \fBread\fR(2) and \fBwrite\fR(2).
76 .SH ATTRIBUTES
77 .sp
78 .LP
79 See \fBattributes\fR(5) for descriptions of the following attributes:
80 .sp
82 .sp
83 .TS
84 box;
85 c | c
86 l | l .
87 ATTRIBUTE TYPE  ATTRIBUTE VALUE
89 Interface Stability     Committed
91 MT-Level        Async-Signal-Safe
93 Standard        See \fBstandards\fR(5).
94 .TE
96 .SH SEE ALSO
97 .sp
98 .LP
99 \fBfcntl\fR(2), \fBopen\fR(2), \fBread\fR(2), \fBwrite\fR(2), \fBfsync\fR(3C),
100 \fBaio_fsync\fR(3C), \fBfcntl.h\fR(3HEAD), \fBattributes\fR(5),
101 \fBstandards\fR(5)