]> git.saurik.com Git - apple/libc.git/blame - gen/sync_volume_np.3
Libc-1353.11.2.tar.gz
[apple/libc.git] / gen / sync_volume_np.3
CommitLineData
ad3c9f2a
A
1.\" Copyright (c) 2011 Apple Computer, Inc. All rights reserved.
2.\"
3.\" @APPLE_LICENSE_HEADER_START@
4.\"
5.\" The contents of this file constitute Original Code as defined in and
6.\" are subject to the Apple Public Source License Version 1.1 (the
7.\" "License"). You may not use this file except in compliance with the
8.\" License. Please obtain a copy of the License at
9.\" http://www.apple.com/publicsource and read it before using this file.
10.\"
11.\" This Original Code and all software distributed under the License are
12.\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
13.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
14.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
15.\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
16.\" License for the specific language governing rights and limitations
17.\" under the License.
18.\"
19.\" @APPLE_LICENSE_HEADER_END@
20.\"
21.Dd October
22.Dt SYNC_VOLUME_NP 3
23.Os
24.Sh NAME
25.Nm sync_volume_np
26.Nd Sync a mounted filesystem
27.Sh LIBRARY
28.Lb libc
29.Sh SYNOPSIS
30.In unistd.h
31.Ft int
32.Fn sync_volume_np "const char *path" "int flags"
33.Ft int
34.Fn fsync_volume_np "int fd" "int flags"
35.Sh DESCRIPTION
36The
37.Fn sync_volume_np
38function causes data and metadata on the filesystem containing
39.Ar path
40to be synced to disk; this may be any file or directory on that filesystem. The
41.Fn fsync_volume_np
42does the same thing, but using an open file descriptor for that
43filesystem.
44Both functions take a flags parameter, with the currently-defined
45options:
46.Bl -tag -width SYNC_VOLUME_FULLSYNC -offset indent
47.It SYNC_VOLUME_FULLSYNC
48Request that the data and metadata be written to the disk hardware;
49if not set, then the hardware may keep it in cache.
50.It SYNC_VOLUME_WAIT
51Wait for the data and metadata to be written; if not set, then
52it will return when the requests have been made.
53.El
54.Sh RETURN VALUES
55Both functions return 0 on success, and a non-zero error code on error.
56.Sh ERRORS
57The
58.Fn fsync_volume_np
59function may return
60.Er EBADF
61if the
62.Ar fd
63parameter is not a valid, open file descriptor.
64The
65.Fn sync_volume_np
66function may return errors if:
67.Bl -tag -width ENAMETOOLONG
68.It Bq Er EACCES
69Search permission is denied for a component of the path prefix.
70.It Bq Er EIO
71An I/O error occurs while reading from or writing to the file system.
72.It Bq Er ELOOP
73Too many symbolic links are encountered in translating the pathname.
74This is taken to be indicative of a looping symbolic link.
75.It Bq Er ENAMETOOLONG
76A component of a pathname exceeds {NAME_MAX} characters, or an entire path name exceeds {PATH_MAX} characters.
77.It Bq Er ENOENT
78The named file does not exist.
79.It Bq Er ENOTDIR
80A component of the path prefix is not a directory.
81.El