1 .\" Copyright (c) 1989, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
3 .\" Copyright (c) 2018 Gandi
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. Neither the name of the University nor the names of its contributors
14 .\" may be used to endorse or promote products derived from this software
15 .\" without specific prior written permission.
17 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" @(#)getfh.2 8.1 (Berkeley) 6/9/93
46 .Fn getfh "const char *path" "fhandle_t *fhp"
48 .Fn lgetfh "const char *path" "fhandle_t *fhp"
50 .Fn getfhat "int fd" "const char *path" "fhandle_t *fhp" "int flag"
55 returns a file handle for the specified file or directory
56 in the file handle pointed to by
63 except in the case where the named file is a symbolic link,
66 returns information about the link,
69 returns information about the file the link references.
73 system call is equivalent to
79 specifies a relative path, or the
86 the status is retrieved from a file relative to
87 the directory associated with the file descriptor
89 instead of the current working directory.
94 the status is retrieved from a file specified by the
96 but additional permission checks are performed, see below.
100 are constructed by a bitwise-inclusive OR of flags from this list,
103 .Bl -tag -width indent
104 .It Dv AT_SYMLINK_NOFOLLOW
107 names a symbolic link, the status of the symbolic link is returned.
109 Only stat files and directories below the topping directory.
110 See the description of the
119 is passed the special value
123 parameter, the current working directory is used and the behavior is
124 identical to a call to
128 respectively, depending on whether or not the
129 .Dv AT_SYMLINK_NOFOLLOW
135 is called with an absolute
144 is specified with an absolute
146 a directory passed by the
148 argument is used as the topping point for the resolution.
149 These system calls are restricted to the superuser.
158 fail if one or more of the following are true:
161 A component of the path prefix of
164 .It Bq Er ENAMETOOLONG
165 The length of a component of
167 exceeds 255 characters,
170 exceeds 1023 characters.
172 The file referred to by
176 Search permission is denied for a component of the path prefix of
179 Too many symbolic links were encountered in translating
185 points to an invalid address.
190 points to an invalid address.
194 error occurred while reading from or writing to the file system.
196 Corrupted data was detected while reading from the file system.
203 In addition to the errors returned by
209 system call may fail if:
214 argument does not specify an absolute path and the
218 nor a valid file descriptor open for searching.
222 argument is not valid.
226 argument is not an absolute path and
230 nor a file descriptor associated with a directory.
238 system call first appeared in