Print this page
Garrett's man page edits.

*** 9,122 **** .\" source. A copy of the CDDL is also available via the Internet at .\" http://www.illumos.org/license/CDDL. .\" .\" .\" Copyright (c) 2014 Joyent, Inc. All rights reserved. .\" ! .TH USELOCALE 3C "Jun 11, 2014" .SH NAME - uselocale \- get and set the locale for an individual thread - .SH SYNOPSIS - .LP .nf #include <locale.h> ! .BI "locale_t uselocale(locale_t " loc ); ! .SH DESCRIPTION .LP - The .B uselocale() function is used to obtain and set the current locale for a thread. When a thread is created, it uses the global locale as specified by calls to .BR setlocale() . - A call to - .B uselocale() - causes all operations in the thread to use the locale specified in - .IR loc . - The thread ignores all subsequent changes to the global locale that - occur through calls to - .BR setlocale() . - When the special locale, - .BR LC_GLOBAL_LOCALE , - is passed in to - .BR uselocale() , - the thread returns to using the global locale, and subsequent calls to - .B setlocale() - cause changes for the thread. - .LP ! In addition, ! .B uselocale() ! can be used to obtain the current locale in use by thread, this is done ! by passing in the special locale ! .BR (locale_t) 0. ! If the thread has never set a locale through ! .BR uselocale() , ! then the current global locale as determined through calls to ! .B setlocale() ! will be returned. ! .LP ! Locale objects to pass in to .B uselocale() ! can be created and destroyed with the functions ! .BR duplocale (3C), ! .BR newlocale (3C), and ! .BR freelocale (3C). ! .SH RETURN VALUES - Upon successful completion, the .B uselocale() function always returns the previous locale that was set. If no locale was previously set, the global locale, .BR LC_GLOBAL_LOCALE , ! is returned. If the locale object ! .I loc ! is the special locale ! .BR (lcoale_t) 0, ! then the current locale of the thread is not updated. On failure, the .B uselocale() function returns ! .B (locale_t) 0, and sets .B errno to indicate the error. - .SH ERRORS ! ! .sp ! .ne 2 ! .na .B EINVAL - .ad - .RS 10n An invalid locale was encountered or an internal error occurred that caused the system to be unable to update the locale. - .RE - .SH ATTRIBUTES - .sp .TS box; c | c l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Standard _ ! MT-Level Safe .TE .SH SEE ALSO .BR locale (1), .BR duplocale (3C), .BR newlocale (3C), .BR setlocale (3C), - .BR environ (5), .BR locale (5) --- 9,95 ---- .\" source. A copy of the CDDL is also available via the Internet at .\" http://www.illumos.org/license/CDDL. .\" .\" .\" Copyright (c) 2014 Joyent, Inc. All rights reserved. + .\" Copyright 2014 Garrett D'Amore <garrett@damore.org> .\" ! .TH USELOCALE 3C "Jun 24, 2014" .SH NAME uselocale \- get and set the locale for an individual thread .SH SYNOPSIS .LP .nf #include <locale.h> ! \fBlocale_t\fR \fBuselocale\fR(\fBlocale_t\fR \fIloc\fR); ! .fi .SH DESCRIPTION .LP The .B uselocale() function is used to obtain and set the current locale for a thread. When a thread is created, it uses the global locale as specified by calls to .BR setlocale() . .LP ! If ! .BR (locale_t) 0 ! is supplied for ! .IR loc , ! then no change is made to the thread's locale setting. This can be used ! to query the thread's locale without making any change. .LP ! If ! .B LC_GLOBAL_LOCALE ! is supplied for ! .IR loc , ! then the thread will use the global locale, undoing the effect of any ! prior call to establish a thread-specific locale. ! .LP ! Otherwise the thread will use the supplied ! .I loc ! locale object as a thread-specific locale. Changes to the global ! locale, or to the locale of any other thread, will not affect this thread. ! .LP ! Locale objects for use with .B uselocale() ! can be created with the functions ! .BR duplocale (3C) and ! .BR newlocale (3C). .SH RETURN VALUES Upon successful completion, the .B uselocale() function always returns the previous locale that was set. If no locale was previously set, the global locale, .BR LC_GLOBAL_LOCALE , ! is returned. On failure, the .B uselocale() function returns ! .BR (locale_t) 0, ! and sets .B errno to indicate the error. .SH ERRORS ! .TP .B EINVAL An invalid locale was encountered or an internal error occurred that caused the system to be unable to update the locale. .SH ATTRIBUTES .TS box; c | c l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Standard _ ! MT-Level MT-Safe .TE .SH SEE ALSO .BR locale (1), .BR duplocale (3C), .BR newlocale (3C), .BR setlocale (3C), .BR locale (5)