Skip site navigation (1)Skip section navigation (2)

FreeBSD Man Pages

Man Page or Keyword Search:
Man Architecture
Apropos Keyword Search (all sections) Output format
home | help
DUPLOCALE(3)           FreeBSD Library Functions Manual           DUPLOCALE(3)

NAME
     duplocale - duplicate an locale

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <xlocale.h>

     locale_t
     duplocale(locale_t locale);

DESCRIPTION
     Duplicates an existing locale_t returning a new locale_t that refers to
     the same locale values but has independent internal state.  Various
     functions, such as mblen(3) require presistent state.  These functions
     formerly used static variables and calls to them from multiple threads
     had undefined behavior.  They now use fields in the locale_t associated
     with the current thread by 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 freelocale(3).

BUGS
     Ideally, uselocale(3) should make a copy of the 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.

SEE ALSO
     freelocale(3), localeconv(3), newlocale(3), querylocale(3), uselocale(3),
     xlocale(3)

STANDARDS
     This function, conforms to IEEE Std 1003.1-2008 (``POSIX.1'')

FreeBSD 11.0-PRERELEASE        September 17 2011       FreeBSD 11.0-PRERELEASE

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | BUGS | SEE ALSO | STANDARDS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=duplocale&sektion=3&manpath=FreeBSD+9.1-RELEASE>

home | help