More accurately document the implementation details of internal storage.

PR:		docs/82508
This commit is contained in:
Ruslan Ermilov 2006-10-12 14:31:17 +00:00
parent 17cba6de53
commit e965ede2b5
2 changed files with 23 additions and 21 deletions

View File

@ -27,7 +27,7 @@
.\" $OpenBSD: basename.3,v 1.12 2000/04/18 03:01:25 aaron Exp $ .\" $OpenBSD: basename.3,v 1.12 2000/04/18 03:01:25 aaron Exp $
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd August 17, 1997 .Dd October 12, 2006
.Dt BASENAME 3 .Dt BASENAME 3
.Os .Os
.Sh NAME .Sh NAME
@ -58,6 +58,13 @@ If
is a null pointer or the empty string, a pointer to the string is a null pointer or the empty string, a pointer to the string
.Qq \&. .Qq \&.
is returned. is returned.
.Sh IMPLEMENTATION NOTES
The
.Fn basename
function
returns a pointer to internal storage space allocated on the first call
that will be overwritten
by subsequent calls.
.Sh RETURN VALUES .Sh RETURN VALUES
On successful completion, On successful completion,
.Fn basename .Fn basename
@ -77,12 +84,6 @@ The following error codes may be set in
The path component to be returned was larger than The path component to be returned was larger than
.Dv MAXPATHLEN . .Dv MAXPATHLEN .
.El .El
.Sh WARNINGS
The
.Fn basename
function
returns a pointer to internal static storage space that will be overwritten
by subsequent calls.
.Sh SEE ALSO .Sh SEE ALSO
.Xr basename 1 , .Xr basename 1 ,
.Xr dirname 1 , .Xr dirname 1 ,

View File

@ -27,7 +27,7 @@
.\" $OpenBSD: dirname.3,v 1.9 2000/04/18 03:01:25 aaron Exp $ .\" $OpenBSD: dirname.3,v 1.9 2000/04/18 03:01:25 aaron Exp $
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd August 17, 1997 .Dd October 12, 2006
.Dt DIRNAME 3 .Dt DIRNAME 3
.Os .Os
.Sh NAME .Sh NAME
@ -58,6 +58,20 @@ characters,
returns a pointer to the string returns a pointer to the string
.Qq \&. , .Qq \&. ,
signifying the current directory. signifying the current directory.
.Sh IMPLEMENTATION NOTES
The
.Fn dirname
function
returns a pointer to internal storage space allocated on the first call
that will be overwritten
by subsequent calls.
.Pp
Other vendor implementations of
.Fn dirname
may modify the contents of the string passed to
.Fn dirname ;
this should be taken into account when writing code which calls this function
if portability is desired.
.Sh RETURN VALUES .Sh RETURN VALUES
On successful completion, On successful completion,
.Fn dirname .Fn dirname
@ -77,19 +91,6 @@ The following error codes may be set in
The path component to be returned was larger than The path component to be returned was larger than
.Dv MAXPATHLEN . .Dv MAXPATHLEN .
.El .El
.Sh WARNINGS
The
.Fn dirname
function
returns a pointer to internal static storage space that will be overwritten
by subsequent calls (each function has its own separate storage).
.Pp
Other vendor implementations of
.Fn dirname
may modify the contents of the string passed to
.Fn dirname ;
this should be taken into account when writing code which calls this function
if portability is desired.
.Sh SEE ALSO .Sh SEE ALSO
.Xr basename 1 , .Xr basename 1 ,
.Xr dirname 1 , .Xr dirname 1 ,