summaryrefslogtreecommitdiff
path: root/usr/src/man/man2/resolvepath.2
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2011-03-14 14:05:30 -0400
committerRichard Lowe <richlowe@richlowe.net>2011-03-14 14:05:30 -0400
commitc10c16dec587a0662068f6e2991c29ed3a9db943 (patch)
treef414286f4bba41d75683ed4fbbaa6bfa4bf7fabd /usr/src/man/man2/resolvepath.2
parent68caef18a23a498d9e3017b983562c0f4fd8ab23 (diff)
downloadillumos-joyent-c10c16dec587a0662068f6e2991c29ed3a9db943.tar.gz
243 system manual pages should live with the software
Reviewed by: garrett@nexenta.com Reviewed by: gwr@nexenta.com Reviewed by: trisk@opensolaris.org Approved by: gwr@nexenta.com --HG-- extra : rebase_source : 0c599d0bec0dc8865fbba67721a7a6cd6b1feefb
Diffstat (limited to 'usr/src/man/man2/resolvepath.2')
-rw-r--r--usr/src/man/man2/resolvepath.2132
1 files changed, 132 insertions, 0 deletions
diff --git a/usr/src/man/man2/resolvepath.2 b/usr/src/man/man2/resolvepath.2
new file mode 100644
index 0000000000..aedc4a86a6
--- /dev/null
+++ b/usr/src/man/man2/resolvepath.2
@@ -0,0 +1,132 @@
+'\" te
+.\" Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH resolvepath 2 "12 May 1997" "SunOS 5.11" "System Calls"
+.SH NAME
+resolvepath \- resolve all symbolic links of a path name
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBresolvepath\fR(\fBconst char *\fR\fIpath\fR, \fBchar *\fR\fIbuf\fR, \fBsize_t\fR \fIbufsiz\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBresolvepath()\fR function fully resolves all symbolic links in the path
+name \fIpath\fR into a resulting path name free of symbolic links and places
+the resulting path name in the buffer \fIbuf\fR which has size \fIbufsiz\fR.
+The resulting path name names the same file or directory as the original path
+name. All ``\fB\&.\fR'' components are eliminated and every non-leading
+``\fB\&..\fR'' component is eliminated together with its preceding directory
+component. If leading ``\fB\&..\fR'' components reach to the root directory,
+they are replaced by ``\fB/\fR''. If the number of bytes in the resulting path
+name is less than \fIbufsiz\fR, the contents of the remainder of \fIbuf\fR are
+unspecified.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBresolvepath()\fR returns the count of bytes
+placed in the buffer. Otherwise, it returns \fB\(mi1\fR, leaves the buffer
+unchanged, and sets \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBresolvepath()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied for a component of the path prefix of \fIpath\fR or
+for a path prefix component resulting from the resolution of a symbolic link.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR or \fIbuf\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error occurred while reading from the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument is an empty string or a component of \fIpath\fR or a
+path name component produced by resolving a symbolic link does not name an
+existing file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in resolving \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of \fIpath\fR exceeds \fIPATH_MAX\fR, or a path name component is
+longer than \fINAME_MAX\fR. Path name resolution of a symbolic link produced an
+intermediate result whose length exceeds \fIPATH_MAX\fR or a component whose
+length exceeds \fINAME_MAX\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix of \fIpath\fR or of a path prefix component
+resulting from the resolution of a symbolic link is not a directory.
+.RE
+
+.SH USAGE
+.sp
+.LP
+No more than \fIPATH_MAX\fR bytes will be placed in the buffer. Applications
+should not assume that the returned contents of the buffer are null-terminated.
+.SH SEE ALSO
+.sp
+.LP
+\fBreadlink\fR(2), \fBrealpath\fR(3C)