From 8f826cd8f2589a6bcf5221fef7e8ca77d37dcd6f Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sat, 5 May 2012 10:51:16 +1200 Subject: [PATCH] realpath.3: Remove note about Solaris possible returning an relative path As reported by Casper Dik: For some reason, many of the realpath() manual pages (BSD, Linux) have words to the following effect: Solaris may return a relative pathname when the path argument is relative. I have looked through the Solaris source files and have found no such bug reported or fixed; the implementation from at least 1997 and beyond certainly doesn't have this problem and even the older versions prepend getcwd() or chdir() to dirname and run getcwd() in that directory. Solaris does have a system call which may return relative pathnames: resolvepath(). I believe that that function may have confused earlier writers of realpath() manual pages and this was later copied without verifying that fact. realpath() existed in Solaris 2.0 as it came from SVr4.0 and even at that time it returned the full, non-relative path. Reported-by: Casper.Dik@oracle.com Signed-off-by: Michael Kerrisk --- man3/realpath.3 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/man3/realpath.3 b/man3/realpath.3 index 339ccdf39..1b90a34e2 100644 --- a/man3/realpath.3 +++ b/man3/realpath.3 @@ -23,7 +23,7 @@ .\" Rewritten old page, 990824, aeb@cwi.nl .\" 2004-12-14, mtk, added discussion of resolved_path == NULL .\" -.TH REALPATH 3 2011-09-10 "" "Linux Programmer's Manual" +.TH REALPATH 3 2012-05-05 "" "Linux Programmer's Manual" .SH NAME realpath \- return the canonicalized absolute pathname .SH SYNOPSIS @@ -166,11 +166,15 @@ A typical source fragment would be .LP (But see the BUGS section.) .LP -The 4.4BSD, Linux and SUSv2 versions always return an absolute -pathname. -Solaris may return a relative pathname when the -.I path -argument is relative. +.\" 2012-05-05, According to Casper Dik, the statement about +.\" Solaris was not true at least as far back as 1997, and +.\" may never have been true. +.\" +.\" The 4.4BSD, Linux and SUSv2 versions always return an absolute +.\" pathname. +.\" Solaris may return a relative pathname when the +.\" .I path +.\" argument is relative. The prototype of .BR realpath () is given in \fI\fP in libc4 and libc5,