1USELOCALE(3P)              POSIX Programmer's Manual             USELOCALE(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       uselocale — use locale in current thread
14

SYNOPSIS

16       #include <locale.h>
17
18       locale_t uselocale(locale_t newloc);
19

DESCRIPTION

21       The uselocale() function shall set the current locale for  the  current
22       thread to the locale represented by newloc.
23
24       The value for the newloc argument shall be one of the following:
25
26        1. A value returned by the newlocale() or duplocale() functions
27
28        2. The special locale object descriptor LC_GLOBAL_LOCALE
29
30        3. (locale_t)0
31
32       Once the uselocale() function has been called to install a thread-local
33       locale, the behavior of every interface using  data  from  the  current
34       locale shall be affected for the calling thread. The current locale for
35       other threads shall remain unchanged.
36
37       If the newloc argument is (locale_t)0, the object returned is the  cur‐
38       rent  locale  or LC_GLOBAL_LOCALE if there has been no previous call to
39       uselocale() for the current thread.
40
41       If the newloc argument is LC_GLOBAL_LOCALE, the thread  shall  use  the
42       global locale determined by the setlocale() function.
43

RETURN VALUE

45       Upon  successful  completion, the uselocale() function shall return the
46       locale handle from  the  previous  call  for  the  current  thread,  or
47       LC_GLOBAL_LOCALE if there was no such previous call.  Otherwise, uselo‐
48       cale() shall return (locale_t)0 and set errno to indicate the error.
49

ERRORS

51       The uselocale() function may fail if:
52
53       EINVAL locale is not a valid locale object.
54
55       The following sections are informative.
56

EXAMPLES

58       None.
59

APPLICATION USAGE

61       Unlike the setlocale() function,  the  uselocale()  function  does  not
62       allow  replacing some locale categories only. Applications that need to
63       install a locale which differs only in a few categories must use newlo‐
64       cale()  to  change  a  locale  object  equivalent to the currently used
65       locale and install it.
66

RATIONALE

68       None.
69

FUTURE DIRECTIONS

71       None.
72

SEE ALSO

74       duplocale(), freelocale(), newlocale(), setlocale()
75
76       The Base Definitions volume of POSIX.1‐2008, <locale.h>
77
79       Portions of this text are reprinted and reproduced in  electronic  form
80       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
81       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
82       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
83       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
84       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
85       event of any discrepancy between this version and the original IEEE and
86       The  Open Group Standard, the original IEEE and The Open Group Standard
87       is the referee document. The original Standard can be  obtained  online
88       at http://www.unix.org/online.html .
89
90       Any  typographical  or  formatting  errors that appear in this page are
91       most likely to have been introduced during the conversion of the source
92       files  to  man page format. To report such errors, see https://www.ker
93       nel.org/doc/man-pages/reporting_bugs.html .
94
95
96
97IEEE/The Open Group                  2013                        USELOCALE(3P)
Impressum