]>
Commit | Line | Data |
---|---|---|
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 | |
36 | The | |
37 | .Fn sync_volume_np | |
38 | function causes data and metadata on the filesystem containing | |
39 | .Ar path | |
40 | to be synced to disk; this may be any file or directory on that filesystem. The | |
41 | .Fn fsync_volume_np | |
42 | does the same thing, but using an open file descriptor for that | |
43 | filesystem. | |
44 | Both functions take a flags parameter, with the currently-defined | |
45 | options: | |
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. | |
50 | .It SYNC_VOLUME_WAIT | |
51 | Wait for the data and metadata to be written; if not set, then | |
52 | it will return when the requests have been made. | |
53 | .El | |
54 | .Sh RETURN VALUES | |
55 | Both functions return 0 on success, and a non-zero error code on error. | |
56 | .Sh ERRORS | |
57 | The | |
58 | .Fn fsync_volume_np | |
59 | function may return | |
60 | .Er EBADF | |
61 | if the | |
62 | .Ar fd | |
63 | parameter is not a valid, open file descriptor. | |
64 | The | |
65 | .Fn sync_volume_np | |
66 | function may return errors if: | |
67 | .Bl -tag -width ENAMETOOLONG | |
68 | .It Bq Er EACCES | |
69 | Search permission is denied for a component of the path prefix. | |
70 | .It Bq Er EIO | |
71 | An I/O error occurs while reading from or writing to the file system. | |
72 | .It Bq Er ELOOP | |
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. | |
77 | .It Bq Er ENOENT | |
78 | The named file does not exist. | |
79 | .It Bq Er ENOTDIR | |
80 | A component of the path prefix is not a directory. | |
81 | .El |