mirror of https://git.musl-libc.org/git/musl
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
367 B
16 lines
367 B
#include "locale_impl.h"
|
|
#include "pthread_impl.h"
|
|
#include "libc.h"
|
|
|
|
locale_t __uselocale(locale_t new)
|
|
{
|
|
pthread_t self = __pthread_self();
|
|
locale_t old = self->locale;
|
|
locale_t global = &libc.global_locale;
|
|
|
|
if (new) self->locale = new == LC_GLOBAL_LOCALE ? global : new;
|
|
|
|
return old == global ? LC_GLOBAL_LOCALE : old;
|
|
}
|
|
|
|
weak_alias(__uselocale, uselocale);
|
|
|