1 .\" Copyright (C) 2014 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .TH uselocale 3 (date) "Linux man-pages (unreleased)"
7 uselocale \- set/get the locale for the calling thread
10 .RI ( libc ", " \-lc )
13 .B #include <locale.h>
15 .BI "locale_t uselocale(locale_t " newloc );
19 Feature Test Macro Requirements for glibc (see
20 .BR feature_test_macros (7)):
33 function sets the current locale for the calling thread,
34 and returns the thread's previously current locale.
35 After a successful call to
37 any calls by this thread to functions that depend on the locale
38 will operate as though the locale has been set to
43 argument can have one of the following values:
45 A handle returned by a call to \fBnewlocale\fP(3) or \fBduplocale\fP(3)
46 The calling thread's current locale is set to the specified locale.
48 The special locale object handle \fBLC_GLOBAL_LOCALE\fP
49 The calling thread's current locale is set to the global locale determined by
53 The calling thread's current locale is left unchanged
54 (and the current locale is returned as the function result).
58 returns the locale handle that was set by the previous call to
62 if there was no such previous call.
67 to indicate the error.
72 does not refer to a valid locale object.
82 does not allow selective replacement of individual locale categories.
83 To employ a locale that differs in only a few categories from the current
88 to obtain a locale object equivalent to the current locale and
89 modify the desired categories in that object.