Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/getfh.2
Show All 23 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)getfh.2 8.1 (Berkeley) 6/9/93 | .\" @(#)getfh.2 8.1 (Berkeley) 6/9/93 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd September 23, 2020 | .Dd February 23, 2021 | ||||
.Dt GETFH 2 | .Dt GETFH 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm getfh , | .Nm getfh , | ||||
.Nm lgetfh , | .Nm lgetfh , | ||||
.Nm getfhat | .Nm getfhat | ||||
.Nd get file handle | .Nd get file handle | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
Show All 30 Lines | |||||
The | The | ||||
.Fn getfhat | .Fn getfhat | ||||
system call is equivalent to | system call is equivalent to | ||||
.Fn getfh | .Fn getfh | ||||
and | and | ||||
.Fn lgetfh | .Fn lgetfh | ||||
except when the | except when the | ||||
.Fa path | .Fa path | ||||
specifies a relative path, or the | specifies a relative path. | ||||
.Dv AT_BENEATH | |||||
flag is provided. | |||||
For | For | ||||
.Fn getfhat | .Fn getfhat | ||||
and relative | and relative | ||||
.Fa path , | .Fa path , | ||||
the status is retrieved from a file relative to | the status is retrieved from a file relative to | ||||
the directory associated with the file descriptor | the directory associated with the file descriptor | ||||
.Fa fd | .Fa fd | ||||
instead of the current working directory. | instead of the current working directory. | ||||
For | |||||
.Dv AT_BENEATH | |||||
and absolute | |||||
.Fa path , | |||||
the status is retrieved from a file specified by the | |||||
.Fa path , | |||||
but additional permission checks are performed, see below. | |||||
.Pp | .Pp | ||||
The values for the | The values for the | ||||
.Fa flag | .Fa flag | ||||
are constructed by a bitwise-inclusive OR of flags from this list, | are constructed by a bitwise-inclusive OR of flags from this list, | ||||
defined in | defined in | ||||
.In fcntl.h : | .In fcntl.h : | ||||
.Bl -tag -width indent | .Bl -tag -width indent | ||||
.It Dv AT_SYMLINK_NOFOLLOW | .It Dv AT_SYMLINK_NOFOLLOW | ||||
If | If | ||||
.Fa path | .Fa path | ||||
names a symbolic link, the status of the symbolic link is returned. | names a symbolic link, the status of the symbolic link is returned. | ||||
.It Dv AT_BENEATH | |||||
Only stat files and directories below the topping directory. | |||||
See the description of the | |||||
.Dv O_BENEATH | |||||
flag in the | |||||
.Xr open 2 | |||||
manual page. | |||||
.It Dv AT_RESOLVE_BENEATH | .It Dv AT_RESOLVE_BENEATH | ||||
Only walks paths below the topping directory. | Only walk paths below the directory specified by the | ||||
.Ar fd | |||||
descriptor. | |||||
See the description of the | See the description of the | ||||
.Dv O_RESOLVE_BENEATH | .Dv O_RESOLVE_BENEATH | ||||
flag in the | flag in the | ||||
.Xr open 2 | .Xr open 2 | ||||
manual page. | manual page. | ||||
.El | .El | ||||
.Pp | .Pp | ||||
If | If | ||||
Show All 10 Lines | |||||
respectively, depending on whether or not the | respectively, depending on whether or not the | ||||
.Dv AT_SYMLINK_NOFOLLOW | .Dv AT_SYMLINK_NOFOLLOW | ||||
bit is set in | bit is set in | ||||
.Fa flag . | .Fa flag . | ||||
.Pp | .Pp | ||||
When | When | ||||
.Fn getfhat | .Fn getfhat | ||||
is called with an absolute | is called with an absolute | ||||
.Fa path | |||||
without the | |||||
.Dv AT_BENEATH | |||||
flag, it ignores the | |||||
.Fa fd | |||||
argument. | |||||
When | |||||
.Dv AT_BENEATH | |||||
is specified with an absolute | |||||
.Fa path , | .Fa path , | ||||
a directory passed by the | it ignores the | ||||
.Fa fd | .Fa fd | ||||
argument is used as the topping point for the resolution. | argument. | ||||
These system calls are restricted to the superuser. | These system calls are restricted to the superuser. | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
.Rv -std | .Rv -std | ||||
.Sh ERRORS | .Sh ERRORS | ||||
The | The | ||||
.Fn getfh | .Fn getfh | ||||
and | and | ||||
.Fn lgetfh | .Fn lgetfh | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |