about summary refs log tree commit diff
path: root/src/locale/uselocale.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/locale/uselocale.c')
-rw-r--r--src/locale/uselocale.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/locale/uselocale.c b/src/locale/uselocale.c
new file mode 100644
index 00000000..9c799578
--- /dev/null
+++ b/src/locale/uselocale.c
@@ -0,0 +1,10 @@
+#include "locale_impl.h"
+#include "pthread_impl.h"
+
+locale_t uselocale(locale_t l)
+{
+	pthread_t self = pthread_self();
+	locale_t old = self->locale;
+	if (l) self->locale = l;
+	return old;
+}