sys/stat.h: fix typo in statx member name stx_dio_offset_align
[musl.git] / src / env / __reset_tls.c
blob15685bc666988e62524b5e3106e3919aa803238c
1 #include <string.h>
2 #include "pthread_impl.h"
3 #include "libc.h"
5 void __reset_tls()
7 pthread_t self = __pthread_self();
8 struct tls_module *p;
9 size_t i, n = self->dtv[0];
10 if (n) for (p=libc.tls_head, i=1; i<=n; i++, p=p->next) {
11 char *mem = (char *)(self->dtv[i] - DTP_OFFSET);
12 memcpy(mem, p->image, p->len);
13 memset(mem+p->len, 0, p->size - p->len);