2 .\" Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH RESOLVEPATH 2 "May 12, 1997"
8 resolvepath \- resolve all symbolic links of a path name
14 \fBint\fR \fBresolvepath\fR(\fBconst char *\fR\fIpath\fR, \fBchar *\fR\fIbuf\fR, \fBsize_t\fR \fIbufsiz\fR);
20 The \fBresolvepath()\fR function fully resolves all symbolic links in the path
21 name \fIpath\fR into a resulting path name free of symbolic links and places
22 the resulting path name in the buffer \fIbuf\fR which has size \fIbufsiz\fR.
23 The resulting path name names the same file or directory as the original path
24 name. All ``\fB\&.\fR'' components are eliminated and every non-leading
25 ``\fB\&..\fR'' component is eliminated together with its preceding directory
26 component. If leading ``\fB\&..\fR'' components reach to the root directory,
27 they are replaced by ``\fB/\fR''. If the number of bytes in the resulting path
28 name is less than \fIbufsiz\fR, the contents of the remainder of \fIbuf\fR are
33 Upon successful completion, \fBresolvepath()\fR returns the count of bytes
34 placed in the buffer. Otherwise, it returns \fB\(mi1\fR, leaves the buffer
35 unchanged, and sets \fBerrno\fR to indicate the error.
39 The \fBresolvepath()\fR function will fail if:
46 Search permission is denied for a component of the path prefix of \fIpath\fR or
47 for a path prefix component resulting from the resolution of a symbolic link.
56 The \fIpath\fR or \fIbuf\fR argument points to an illegal address.
65 An I/O error occurred while reading from the file system.
74 The \fIpath\fR argument is an empty string or a component of \fIpath\fR or a
75 path name component produced by resolving a symbolic link does not name an
85 Too many symbolic links were encountered in resolving \fIpath\fR.
91 \fB\fBENAMETOOLONG\fR\fR
94 The length of \fIpath\fR exceeds \fIPATH_MAX\fR, or a path name component is
95 longer than \fINAME_MAX\fR. Path name resolution of a symbolic link produced an
96 intermediate result whose length exceeds \fIPATH_MAX\fR or a component whose
97 length exceeds \fINAME_MAX\fR.
106 A component of the path prefix of \fIpath\fR or of a path prefix component
107 resulting from the resolution of a symbolic link is not a directory.
113 No more than \fIPATH_MAX\fR bytes will be placed in the buffer. Applications
114 should not assume that the returned contents of the buffer are null-terminated.
118 \fBreadlink\fR(2), \fBrealpath\fR(3C)