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