logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

uselocale.3p (3716B)


  1. '\" et
  2. .TH USELOCALE "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. uselocale
  12. \(em use locale in current thread
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <locale.h>
  17. .P
  18. locale_t uselocale(locale_t \fInewloc\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIuselocale\fR()
  23. function shall set or query the current locale for the calling thread.
  24. .P
  25. The value for the
  26. .IR newloc
  27. argument shall be one of the following:
  28. .IP " 1." 4
  29. A value returned by the
  30. \fInewlocale\fR()
  31. or
  32. \fIduplocale\fR()
  33. functions
  34. .IP " 2." 4
  35. The special locale object descriptor LC_GLOBAL_LOCALE
  36. .IP " 3." 4
  37. (\c
  38. .BR locale_t )0
  39. .P
  40. If the
  41. .IR newloc
  42. argument is (\c
  43. .BR locale_t )0,
  44. the current locale shall not be changed; this value can be used to
  45. query the current locale setting. If the
  46. .IR newloc
  47. argument is LC_GLOBAL_LOCALE, any thread-local locale for the calling
  48. thread shall be uninstalled; the thread shall again use the global
  49. locale as the current locale, and changes to the global locale shall
  50. affect the thread. Otherwise, the locale represented by
  51. .IR newloc
  52. shall be installed as a thread-local locale to be used as the current
  53. locale for the calling thread.
  54. .P
  55. Once the
  56. \fIuselocale\fR()
  57. function has been called to install a thread-local locale, the
  58. behavior of every interface using data from the current locale shall
  59. be affected for the calling thread. The current locale for other
  60. threads shall remain unchanged.
  61. .SH "RETURN VALUE"
  62. Upon successful completion, the
  63. \fIuselocale\fR()
  64. function shall return a handle for the thread-local locale that was in
  65. use as the current locale for the calling thread on entry to the function,
  66. or LC_GLOBAL_LOCALE if no thread-local locale was in use. Otherwise,
  67. \fIuselocale\fR()
  68. shall return (\c
  69. .BR locale_t )0
  70. and set
  71. .IR errno
  72. to indicate the error.
  73. .SH ERRORS
  74. The
  75. \fIuselocale\fR()
  76. function may fail if:
  77. .TP
  78. .BR EINVAL
  79. .IR newloc
  80. is not a valid locale object and is not (\c
  81. .BR locale_t )0.
  82. .LP
  83. .IR "The following sections are informative."
  84. .SH EXAMPLES
  85. None.
  86. .SH "APPLICATION USAGE"
  87. Unlike the
  88. \fIsetlocale\fR()
  89. function, the
  90. \fIuselocale\fR()
  91. function does not allow replacing some locale categories
  92. only. Applications that need to install a locale which differs only in
  93. a few categories must use
  94. \fInewlocale\fR()
  95. to change a locale object equivalent to the currently used locale and
  96. install it.
  97. .SH RATIONALE
  98. None.
  99. .SH "FUTURE DIRECTIONS"
  100. None.
  101. .SH "SEE ALSO"
  102. .IR "\fIduplocale\fR\^(\|)",
  103. .IR "\fIfreelocale\fR\^(\|)",
  104. .IR "\fInewlocale\fR\^(\|)",
  105. .IR "\fIsetlocale\fR\^(\|)"
  106. .P
  107. The Base Definitions volume of POSIX.1\(hy2017,
  108. .IR "\fB<locale.h>\fP"
  109. .\"
  110. .SH COPYRIGHT
  111. Portions of this text are reprinted and reproduced in electronic form
  112. from IEEE Std 1003.1-2017, Standard for Information Technology
  113. -- Portable Operating System Interface (POSIX), The Open Group Base
  114. Specifications Issue 7, 2018 Edition,
  115. Copyright (C) 2018 by the Institute of
  116. Electrical and Electronics Engineers, Inc and The Open Group.
  117. In the event of any discrepancy between this version and the original IEEE and
  118. The Open Group Standard, the original IEEE and The Open Group Standard
  119. is the referee document. The original Standard can be obtained online at
  120. http://www.opengroup.org/unix/online.html .
  121. .PP
  122. Any typographical or formatting errors that appear
  123. in this page are most likely
  124. to have been introduced during the conversion of the source files to
  125. man page format. To report such errors, see
  126. https://www.kernel.org/doc/man-pages/reporting_bugs.html .