]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/sys/fhreadlink.2
libc: Fix most issues reported by mandoc
[FreeBSD/FreeBSD.git] / lib / libc / sys / fhreadlink.2
1 .\" SPDX-License-Identifier: BSD-2-Clause
2 .\"
3 .\" Copyright (c) 2018 Gandi
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
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 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD$
27 .\"
28 .Dd March 30, 2020
29 .Dt FHREADLINK 2
30 .Os
31 .Sh NAME
32 .Nm fhreadlink
33 .Nd read value of a symbolic link
34 .Sh LIBRARY
35 .Lb libc
36 .Sh SYNOPSIS
37 .In sys/param.h
38 .In sys/mount.h
39 .Ft int
40 .Fn fhreadlink "fhandle_t *fhp" "char *buf" "size_t bufsize"
41 .Fc
42 .Sh DESCRIPTION
43 The
44 .Fn fhreadlink
45 system call
46 places the contents of the symbolic link
47 .Fa fhp
48 in the buffer
49 .Fa buf ,
50 which has size
51 .Fa bufsiz .
52 The
53 .Fn fhreadlink
54 system call does not append a
55 .Dv NUL
56 character to
57 .Fa buf .
58 .Pp
59 .Sh RETURN VALUES
60 The call returns the count of characters placed in the buffer
61 if it succeeds, or a \-1 if an error occurs, placing the error
62 code in the global variable
63 .Va errno .
64 .Sh ERRORS
65 The
66 .Fn readlink
67 system call
68 will fail if:
69 .Bl -tag -width Er
70 .It Bq Er ENOENT
71 The named file does not exist.
72 .It Bq Er ELOOP
73 Too many symbolic links were encountered in translating the file handle
74 .Fa fhp .
75 .It Bq Er EINVAL
76 The named file is not a symbolic link.
77 .It Bq Er EIO
78 An I/O error occurred while reading from the file system.
79 .It Bq Er EINTEGRITY
80 Corrupted data was detected while reading from the file system.
81 .It Bq Er EFAULT
82 The
83 .Fa buf
84 argument
85 extends outside the process's allocated address space.
86 .It Bq Er ESTALE
87 The file handle
88 .Fa fhp
89 is no longer valid
90 .El
91 .El
92 .Sh SEE ALSO
93 .Xr fhstat 2 ,
94 .Xr fhlink 2 ,