Browse Source

implement uselocale function (minimal)

rs-1.0
Rich Felker 15 years ago
parent
commit
11c531e21d
  1. 2
      src/internal/pthread_impl.h
  2. 10
      src/locale/uselocale.c

2
src/internal/pthread_impl.h

@ -12,6 +12,7 @@
#include <setjmp.h>
#include <string.h>
#include <time.h>
#include <locale.h>
#include "libc.h"
#include "syscall.h"
#include "atomic.h"
@ -44,6 +45,7 @@ struct pthread {
} robust_list;
int unblock_cancel;
int delete_timer;
locale_t locale;
};
struct __timer {

10
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;
}
Loading…
Cancel
Save