summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorderaadt <>2019-06-15 15:40:44 +0000
committerderaadt <>2019-06-15 15:40:44 +0000
commit0a8dcb0d63046d89260fdd2640c7308450262f87 (patch)
tree87d1ffd23684b05f28a8d3154620ee178ac4a3b1
parentcbde3d1c3b16fc186eb19ea5b8633af03b65a8b3 (diff)
downloadopenbsd-0a8dcb0d63046d89260fdd2640c7308450262f87.tar.gz
openbsd-0a8dcb0d63046d89260fdd2640c7308450262f87.tar.bz2
openbsd-0a8dcb0d63046d89260fdd2640c7308450262f87.zip
realpath(3) doesn't use lstat(2), readlink(2), or getcwd(3) anymore,
it is a thin wrapper over the syscall __readlink(2). Improve the list of possible errors. ok millert beck jmc
-rw-r--r--src/lib/libc/stdlib/realpath.360
1 files changed, 39 insertions, 21 deletions
diff --git a/src/lib/libc/stdlib/realpath.3 b/src/lib/libc/stdlib/realpath.3
index 5966b38058..6e253c87a3 100644
--- a/src/lib/libc/stdlib/realpath.3
+++ b/src/lib/libc/stdlib/realpath.3
@@ -28,9 +28,9 @@
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE. 29.\" SUCH DAMAGE.
30.\" 30.\"
31.\" $OpenBSD: realpath.3,v 1.19 2014/01/20 22:40:06 schwarze Exp $ 31.\" $OpenBSD: realpath.3,v 1.20 2019/06/15 15:40:44 deraadt Exp $
32.\" 32.\"
33.Dd $Mdocdate: January 20 2014 $ 33.Dd $Mdocdate: June 15 2019 $
34.Dt REALPATH 3 34.Dt REALPATH 3
35.Os 35.Os
36.Sh NAME 36.Sh NAME
@@ -96,13 +96,43 @@ are undefined.
96.Sh ERRORS 96.Sh ERRORS
97The function 97The function
98.Fn realpath 98.Fn realpath
99may fail and set the external variable 99will fail if:
100.Va errno 100.Bl -tag -width Er
101for any of the errors specified for the library functions 101.It Bq Er EACCES
102.Xr lstat 2 , 102Read or search permission was denied for a component of
103.Xr readlink 2 , 103.Ar pathname .
104and 104.It Bq Er EINVAL
105.Xr getcwd 3 . 105The
106.Ar pathname
107argument is a null pointer.
108.It Bq Er EIO
109An error occurred while reading from the file system.
110.It Bq Er ELOOP
111Too many symbolic links were encountered in translating
112.Ar pathname .
113.It Bq Er ENAMETOOLONG
114A component of
115.Ar pathname
116exceeded
117.Dv NAME_MAX
118characters, or the entire
119.Ar pathname
120(including the terminating NUL) exceeded
121.Dv PATH_MAX .
122.It Bq Er ENAMETOOLONG
123Pathname resolution of a symbolic link produced an intermediate
124result whose length exceeds
125.Dv PATH_MAX .
126.It Bq Er ENOENT
127A component of
128.Ar pathname
129does not name an existing file or
130.Ar pathname
131points to an empty string.
132.It Bq Er ENOTDIR
133A component of the path prefix is not a directory.
134.It Bq Er ENOMEM
135Sufficient storage space is unavailable for allocation.
106.Sh SEE ALSO 136.Sh SEE ALSO
107.Xr readlink 1 , 137.Xr readlink 1 ,
108.Xr getcwd 3 138.Xr getcwd 3
@@ -116,15 +146,3 @@ The
116.Fn realpath 146.Fn realpath
117function call first appeared in 147function call first appeared in
118.Bx 4.4 . 148.Bx 4.4 .
119.Sh CAVEATS
120This implementation of
121.Fn realpath
122differs slightly from the Solaris implementation.
123The
124.Bx 4.4
125version always returns absolute pathnames,
126whereas the Solaris implementation will,
127under certain circumstances, return a relative
128.Fa resolved
129when given a relative
130.Fa pathname .