1 .\" Copyright (c) 2011 Apple Computer, Inc. All rights reserved.
3 .\" @APPLE_LICENSE_HEADER_START@
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.
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.
19 .\" @APPLE_LICENSE_HEADER_END@
26 .Nd Sync a mounted filesystem
32 .Fn sync_volume_np "const char *path" "int flags"
34 .Fn fsync_volume_np "int fd" "int flags"
38 function causes data and metadata on the filesystem containing
40 to be synced to disk; this may be any file or directory on that filesystem. The
42 does the same thing, but using an open file descriptor for that
44 Both functions take a flags parameter, with the currently-defined
46 .Bl -tag -width SYNC_VOLUME_FULLSYNC -offset indent
47 .It SYNC_VOLUME_FULLSYNC
48 Request that the data and metadata be written to the disk hardware;
49 if not set, then the hardware may keep it in cache.
51 Wait for the data and metadata to be written; if not set, then
52 it will return when the requests have been made.
55 Both functions return 0 on success, and a non-zero error code on error.
63 parameter is not a valid, open file descriptor.
66 function may return errors if:
67 .Bl -tag -width ENAMETOOLONG
69 Search permission is denied for a component of the path prefix.
71 An I/O error occurs while reading from or writing to the file system.
73 Too many symbolic links are encountered in translating the pathname.
74 This is taken to be indicative of a looping symbolic link.
75 .It Bq Er ENAMETOOLONG
76 A component of a pathname exceeds {NAME_MAX} characters, or an entire path name exceeds {PATH_MAX} characters.
78 The named file does not exist.
80 A component of the path prefix is not a directory.