1 .\" Copyright (C) 2014 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH USELOCALE 3 2021-03-22 "Linux" "Linux Programmer's Manual"
27 uselocale \- set/get the locale for the calling thread
30 .B #include <locale.h>
32 .BI "locale_t uselocale(locale_t " newloc );
36 Feature Test Macro Requirements for glibc (see
37 .BR feature_test_macros (7)):
50 function sets the current locale for the calling thread,
51 and returns the thread's previously current locale.
52 After a successful call to
54 any calls by this thread to functions that depend on the locale
55 will operate as though the locale has been set to
60 argument can have one of the following values:
62 A handle returned by a call to \fBnewlocale\fP(3) or \fBduplocale\fP(3)
63 The calling thread's current locale is set to the specified locale.
65 The special locale object handle \fBLC_GLOBAL_LOCALE\fP
66 The calling thread's current locale is set to the global locale determined by
70 The calling thread's current locale is left unchanged
71 (and the current locale is returned as the function result).
75 returns the locale handle that was set by the previous call to
79 if there was no such previous call.
84 to indicate the error.
89 does not refer to a valid locale object.
93 function first appeared in version 2.3 of the GNU C library.
100 does not allow selective replacement of individual locale categories.
101 To employ a locale that differs in only a few categories from the current
106 to obtain a locale object equivalent to the current locale and
107 modify the desired categories in that object.