svn commit: r207685 - stable/7/lib/libc/gen
jilles at FreeBSD.org
Wed May 5 22:19:53 UTC 2010
Date: Wed May 5 22:19:52 2010
New Revision: 207685
MFC r206760: getcwd(3): Clarify that EACCES may or may not be checked.
POSIX permits but does not require checking access on the current and parent
Because various programs do not like it if getcwd(3) fails, it seems best
to avoid checking access as much as possible. There are various reports in
GNATS about this (search for getcwd).
Our getcwd(3) implementation first queries the kernel for the pathname
directly, which does not check any permissions but sometimes fails, and then
falls back to reading all parent directories for the names.
stable/7/lib/libc/ (props changed)
stable/7/lib/libc/stdtime/ (props changed)
--- stable/7/lib/libc/gen/getcwd.3 Wed May 5 22:17:17 2010 (r207684)
+++ stable/7/lib/libc/gen/getcwd.3 Wed May 5 22:19:52 2010 (r207685)
@@ -28,7 +28,7 @@
.\" @(#)getcwd.3 8.2 (Berkeley) 12/11/93
-.Dd November 24, 1997
+.Dd April 17, 2010
.Dt GETCWD 3
@@ -108,8 +108,6 @@ The
will fail if:
.Bl -tag -width Er
-.It Bq Er EACCES
-Read or search permission was denied for a component of the pathname.
.It Bq Er EINVAL
@@ -124,6 +122,16 @@ The
argument is greater than zero but smaller than the length of the pathname
+may fail if:
+.Bl -tag -width Er
+.It Bq Er EACCES
+Read or search permission was denied for a component of the pathname.
+This is only checked in limited cases, depending on implementation details.
.Sh SEE ALSO
.Xr chdir 2 ,
.Xr fchdir 2 ,
More information about the svn-src-stable-7