Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jul 2016 16:25:09 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303486 - head/lib/libc/gen
Message-ID:  <201607291625.u6TGP9MS064446@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Fri Jul 29 16:25:09 2016
New Revision: 303486
URL: https://svnweb.freebsd.org/changeset/base/303486

Log:
  Mention that basename(3) and dirname(3) will change in the future.
  
  Update the existing manual pages for basename(3) and dirname(3) to
  mention that in future versions of FreeBSD, these functions will no
  longer use internal buffers for storing the results.
  
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D7356

Modified:
  head/lib/libc/gen/basename.3
  head/lib/libc/gen/dirname.3

Modified: head/lib/libc/gen/basename.3
==============================================================================
--- head/lib/libc/gen/basename.3	Fri Jul 29 16:23:00 2016	(r303485)
+++ head/lib/libc/gen/basename.3	Fri Jul 29 16:25:09 2016	(r303486)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 28, 2016
+.Dd July 29, 2016
 .Dt BASENAME 3
 .Os
 .Sh NAME
@@ -61,8 +61,16 @@ 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 basename
+may store their result in the input buffer,
+making it safe to use in multithreaded applications.
+Future versions of
+.Fx
+will follow this approach as well.
 .Fn basename_r
-is therefore preferred for threaded applications.
+will then become obsolete.
 .Sh RETURN VALUES
 On successful completion,
 .Fn basename

Modified: head/lib/libc/gen/dirname.3
==============================================================================
--- head/lib/libc/gen/dirname.3	Fri Jul 29 16:23:00 2016	(r303485)
+++ head/lib/libc/gen/dirname.3	Fri Jul 29 16:25:09 2016	(r303486)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 28, 2016
+.Dd July 29, 2016
 .Dt DIRNAME 3
 .Os
 .Sh NAME
@@ -56,10 +56,11 @@ 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.
+may store their result in the input buffer,
+making it safe to use in multithreaded applications.
+Future versions of
+.Fx
+will follow this approach as well.
 .Sh RETURN VALUES
 On successful completion,
 .Fn dirname



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607291625.u6TGP9MS064446>