diff options
author | ru <ru@FreeBSD.org> | 2006-10-12 14:31:17 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2006-10-12 14:31:17 +0000 |
commit | 6cd9b8b5117d6f9fd5b1e7ca40c33eb2e0c7dff4 (patch) | |
tree | 73b7f1bd0b2be683ef55f6c912e5c80193d35fe5 /lib/libc | |
parent | edfb232c7dfdf46a23fed2d194d0c4d03e4f9f68 (diff) | |
download | FreeBSD-src-6cd9b8b5117d6f9fd5b1e7ca40c33eb2e0c7dff4.zip FreeBSD-src-6cd9b8b5117d6f9fd5b1e7ca40c33eb2e0c7dff4.tar.gz |
More accurately document the implementation details of internal storage.
PR: docs/82508
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/basename.3 | 15 | ||||
-rw-r--r-- | lib/libc/gen/dirname.3 | 29 |
2 files changed, 23 insertions, 21 deletions
diff --git a/lib/libc/gen/basename.3 b/lib/libc/gen/basename.3 index 6f03b4a..33a0a71 100644 --- a/lib/libc/gen/basename.3 +++ b/lib/libc/gen/basename.3 @@ -27,7 +27,7 @@ .\" $OpenBSD: basename.3,v 1.12 2000/04/18 03:01:25 aaron Exp $ .\" $FreeBSD$ .\" -.Dd August 17, 1997 +.Dd October 12, 2006 .Dt BASENAME 3 .Os .Sh NAME @@ -58,6 +58,13 @@ If is a null pointer or the empty string, a pointer to the string .Qq \&. 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 On successful completion, .Fn basename @@ -77,12 +84,6 @@ The following error codes may be set in The path component to be returned was larger than .Dv MAXPATHLEN . .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 .Xr basename 1 , .Xr dirname 1 , diff --git a/lib/libc/gen/dirname.3 b/lib/libc/gen/dirname.3 index eac042d..cb821ce 100644 --- a/lib/libc/gen/dirname.3 +++ b/lib/libc/gen/dirname.3 @@ -27,7 +27,7 @@ .\" $OpenBSD: dirname.3,v 1.9 2000/04/18 03:01:25 aaron Exp $ .\" $FreeBSD$ .\" -.Dd August 17, 1997 +.Dd October 12, 2006 .Dt DIRNAME 3 .Os .Sh NAME @@ -58,6 +58,20 @@ characters, returns a pointer to the string .Qq \&. , 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 On successful completion, .Fn dirname @@ -77,19 +91,6 @@ The following error codes may be set in The path component to be returned was larger than .Dv MAXPATHLEN . .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 .Xr basename 1 , .Xr dirname 1 , |