mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 19:58:30 +00:00
Update Musl Libc code
We now have implement all of Musl's localization code, the same way that Musl implements localization. You may need setlocale(LC_ALL, "C.UTF-8"), just in case anything stops working as expected.
This commit is contained in:
parent
d0360bf4bd
commit
bb815eafaf
116 changed files with 6525 additions and 5523 deletions
|
@ -40,7 +40,6 @@ static char *_mktls_finish(struct CosmoTib **out_tib, char *mem,
|
|||
tib->tib_ftrace = old->tib_ftrace;
|
||||
tib->tib_strace = old->tib_strace;
|
||||
tib->tib_sigmask = old->tib_sigmask;
|
||||
tib->tib_locale = (intptr_t)&__c_dot_utf8_locale;
|
||||
atomic_store_explicit(&tib->tib_tid, -1, memory_order_relaxed);
|
||||
if (out_tib) {
|
||||
*out_tib = tib;
|
||||
|
|
|
@ -69,6 +69,8 @@ enum PosixThreadStatus {
|
|||
|
||||
#define POSIXTHREAD_CONTAINER(e) DLL_CONTAINER(struct PosixThread, list, e)
|
||||
|
||||
typedef struct __locale_struct *locale_t;
|
||||
|
||||
struct PosixThread {
|
||||
int pt_flags; // 0x00: see PT_* constants
|
||||
atomic_int pt_canceled; // 0x04: thread has bad beliefs
|
||||
|
@ -86,6 +88,7 @@ struct PosixThread {
|
|||
uint64_t pt_blkmask;
|
||||
int64_t pt_semaphore;
|
||||
intptr_t pt_iohandle;
|
||||
locale_t pt_locale;
|
||||
void *pt_ioverlap;
|
||||
jmp_buf pt_exiter;
|
||||
pthread_attr_t pt_attr;
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/runtime/syslib.internal.h"
|
||||
#include "libc/str/locale.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/auxv.h"
|
||||
#include "libc/sysv/consts/clone.h"
|
||||
|
@ -235,6 +236,7 @@ static errno_t pthread_create_impl(pthread_t *thread,
|
|||
return EAGAIN;
|
||||
}
|
||||
dll_init(&pt->list);
|
||||
pt->pt_locale = &__global_locale;
|
||||
pt->pt_start = start_routine;
|
||||
pt->pt_arg = arg;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ struct CosmoTib {
|
|||
struct CosmoTib *tib_self; /* 0x00 */
|
||||
struct CosmoFtrace tib_ftracer; /* 0x08 */
|
||||
void *tib_garbages; /* 0x18 */
|
||||
intptr_t tib_locale; /* 0x20 */
|
||||
intptr_t __unused; /* 0x20 */
|
||||
intptr_t tib_pthread; /* 0x28 */
|
||||
struct CosmoTib *tib_self2; /* 0x30 */
|
||||
_Atomic(int32_t) tib_tid; /* 0x38 transitions -1 → tid → 0 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue