]> git.saurik.com Git - apple/xnu.git/blame - bsd/man/man2/fsctl.2
xnu-1699.22.73.tar.gz
[apple/xnu.git] / bsd / man / man2 / fsctl.2
CommitLineData
55e303ae
A
1.\"
2.\" Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3.\"
6601e61a 4.\" @APPLE_LICENSE_HEADER_START@
55e303ae 5.\"
8f6c56a5
A
6.\" The contents of this file constitute Original Code as defined in and
7.\" are subject to the Apple Public Source License Version 1.1 (the
8.\" "License"). You may not use this file except in compliance with the
9.\" License. Please obtain a copy of the License at
10.\" http://www.apple.com/publicsource and read it before using this file.
11.\"
12.\" This Original Code and all software distributed under the License are
13.\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16.\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17.\" License for the specific language governing rights and limitations
18.\" under the License.
19.\"
6601e61a 20.\" @APPLE_LICENSE_HEADER_END@
55e303ae
A
21.\"
22.Dd January 14, 2003
23.Dt FSCTL 2
24.Os "Mac OS X"
25.Sh NAME
26.Nm fsctl
27.Nd control filesystems
28.Sh SYNOPSIS
29.Fd #include <sys/attr.h>
30.Fd #include <sys/ioctl.h>
31.Ft int
32.Fn fsctl "const char *path" "unsigned long request" "void *data" "unsigned long options"
33.Sh DESCRIPTION
34The
35.Fn fsctl
36function manipulates the filesystem controlling mounted volumes.
37In particular, many filesystem-specific operating
38characteristics of mounted filesystems may be controlled
39with
40.Fn fsctl
41requests.
42.Fn fsctl
43requests can also be used to extract filesystem-specific
44information for a mounted volumes.
45.Pp
46.Fa path
47is the path name of any file within the mounted filesystem.
48An fsctl
49.Fa request
50has encoded in it whether the argument is an
51.Dq in
52parameter
53or
54.Dq out
55parameter, and the size of the argument
56.Fa data
57in bytes.
58Values for
59.Fa request
60are entirely filesystem-specific except for the following, defined in
61.Ao Pa sys/fsctl.h Ac :
62.Bd -literal -offset indent
63FSGETMOUNTINFOSIZE /* Return size of mount info data */
64.Ed
65.Pp
66Macros and defines used in specifying an fsctl
67.Fa request
68are the same as for
69.Fn ioctl
70requests and are located in the file
71.Ao Pa sys/ioccom.h Ac .
72.Fa options
73may specify special flags for the processing of the
74.Fn fsctl
75call. The options are specified by
76.Em or Ns 'ing
77the option values. The only option currently defined is
78.Bd -literal -offset indent
79#define FSOPT_NOFOLLOW 0x00000001 /* Don't follow symlinks */
80.Ed
81.Pp
82which is interpreted by the
83.Fn fsctl
84call to prevent following of symlinks. The
85.Fa options
86argument is passed to the filesystem, which may define and handle
87additional
88.Fa options
89bit values.
90.Sh RETURN VALUES
91.Pp
92If an error has occurred, a value of -1 is returned and
93.Va errno
94is set to indicate the error.
95.Sh ERRORS
96.Fn fsctl
97will fail if:
98.Bl -tag -width Er
99.It Bq Er ENOTDIR
100A component of the path prefix is not a directory.
101.It Bq Er ENAMETOOLONG
102A component of a pathname exceeded
103.Dv {NAME_MAX}
104characters, or an entire path name exceeded
105.Dv {PATH_MAX}
106characters.
107.It Bq Er ENOENT
108The named file does not exist.
109.It Bq Er EACCES
110Search permission is denied for a component of the path prefix.
111.It Bq Er ELOOP
112Too many symbolic links were encountered in translating the pathname.
113.It Bq Er EFAULT
114.Fa path
115or
116.Em data
117points to an invalid address.
118.It Bq Er EIO
119An
120.Tn I/O
121error occurred while reading from or writing to the file system.
122.It Bq Er EINVAL
123.Fa request
124or
125.Fa data
126is not valid.
127.El
128.Sh SEE ALSO
55e303ae 129.Xr getattrlist 2 ,
2d21ac55 130.Xr ioctl 2 ,
55e303ae
A
131.Xr setattrlist 2
132.Sh HISTORY
133The
134.Fn fsctl
135function call appeared in Mac OS X version 10.0.