Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/locale Remove FreeBSD portions that are not relevan...



details:   https://anonhg.NetBSD.org/src/rev/2c2dbfd06983
branches:  trunk
changeset: 959478:2c2dbfd06983
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Feb 15 15:36:53 2021 +0000

description:
Remove FreeBSD portions that are not relevant to our implementation (pointed
out by joerg@)

diffstat:

 lib/libc/locale/duplocale.3  |  26 +++-----------------------
 lib/libc/locale/freelocale.3 |   8 +++-----
 lib/libc/locale/newlocale.3  |  10 +++++-----
 3 files changed, 11 insertions(+), 33 deletions(-)

diffs (120 lines):

diff -r 2c505f48469e -r 2c2dbfd06983 lib/libc/locale/duplocale.3
--- a/lib/libc/locale/duplocale.3       Mon Feb 15 15:07:47 2021 +0000
+++ b/lib/libc/locale/duplocale.3       Mon Feb 15 15:36:53 2021 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: duplocale.3,v 1.1 2021/02/15 14:35:04 christos Exp $
+.\" $NetBSD: duplocale.3,v 1.2 2021/02/15 15:36:53 christos Exp $
 .\" Copyright (c) 2011 The FreeBSD Foundation
 .\" All rights reserved.
 .\"
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD: head/lib/libc/locale/duplocale.3 281925 2015-04-24 10:17:55Z theraven $
 .\"
-.Dd September 17, 2011
+.Dd February 15, 2021
 .Dt DUPLOCALE 3
 .Os
 .Sh NAME
@@ -46,17 +46,6 @@
 returning a new
 .Fa locale_t
 that refers to the same locale values but has an independent internal state.
-Various functions, such as
-.Xr mblen 3
-require a persistent state.
-These functions formerly used static variables and calls to them from multiple
-threads had undefined behavior.
-They now use fields in the
-.Fa locale_t
-associated with the current thread by
-.Xr uselocale 3 .
-These calls are therefore only thread safe on threads with a unique per-thread
-locale.
 The locale returned by this call must be freed with
 .Xr freelocale 3 .
 .Sh SEE ALSO
@@ -64,17 +53,8 @@
 .Xr localeconv 3 ,
 .Xr newlocale 3 ,
 .\" .Xr querylocale 3 ,
-.Xr uselocale 3 ,
+.\" .Xr uselocale 3 ,
 .\" .Xr xlocale 3
 .Sh STANDARDS
 This function conforms to
 .St -p1003.1-2008 .
-.Sh BUGS
-Ideally,
-.Xr uselocale 3
-should make a copy of the
-.Fa locale_t
-implicitly to ensure thread safety,
-and a copy of the global locale should be installed lazily on each thread.
-The FreeBSD implementation does not do this,
-for compatibility with Darwin.
diff -r 2c505f48469e -r 2c2dbfd06983 lib/libc/locale/freelocale.3
--- a/lib/libc/locale/freelocale.3      Mon Feb 15 15:07:47 2021 +0000
+++ b/lib/libc/locale/freelocale.3      Mon Feb 15 15:36:53 2021 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: freelocale.3,v 1.1 2021/02/15 14:35:04 christos Exp $
+.\" $NetBSD: freelocale.3,v 1.2 2021/02/15 15:36:53 christos Exp $
 .\" Copyright (c) 2011 The FreeBSD Foundation
 .\" All rights reserved.
 .\"
@@ -27,7 +27,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD: head/lib/libc/locale/freelocale.3 303495 2016-07-29 17:18:47Z ed $
-.Dd July 26, 2016
+.Dd February 15, 2021
 .Dt FREELOCALE 3
 .Os
 .Sh NAME
@@ -46,14 +46,12 @@
 Frees a
 .Fa locale_t .
 This relinquishes any resources held exclusively by this locale.
-Note that locales share reference-counted components,
-so a call to this function is not guaranteed to free all of the components.
 .Sh SEE ALSO
 .Xr duplocale 3 ,
 .Xr localeconv 3 ,
 .Xr newlocale 3 ,
 .\" .Xr querylocale 3 ,
-.Xr uselocale 3 ,
+.\" .Xr uselocale 3 ,
 .\" .Xr xlocale 3
 .Sh STANDARDS
 This function conforms to
diff -r 2c505f48469e -r 2c2dbfd06983 lib/libc/locale/newlocale.3
--- a/lib/libc/locale/newlocale.3       Mon Feb 15 15:07:47 2021 +0000
+++ b/lib/libc/locale/newlocale.3       Mon Feb 15 15:36:53 2021 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: newlocale.3,v 1.1 2021/02/15 14:35:04 christos Exp $
+.\" $NetBSD: newlocale.3,v 1.2 2021/02/15 15:36:53 christos Exp $
 .\" Copyright (c) 2011 The FreeBSD Foundation
 .\" All rights reserved.
 .\"
@@ -27,7 +27,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD: head/lib/libc/locale/newlocale.3 366375 2020-10-02 18:35:55Z markj $
-.Dd October 2, 2020
+.Dd February 15, 2021
 .Dt NEWLOCALE 3
 .Os
 .Sh NAME
@@ -118,9 +118,9 @@
 .Xr duplocale 3 ,
 .Xr freelocale 3 ,
 .Xr localeconv 3 ,
-\" .Xr querylocale 3 ,
-.Xr uselocale 3 ,
-\" .Xr xlocale 3
+.\" .Xr querylocale 3 ,
+.\" .Xr uselocale 3 ,
+.\" .Xr xlocale 3
 .Sh STANDARDS
 This function conforms to
 .St -p1003.1-2008 .



Home | Main Index | Thread Index | Old Index