- main_thread.tlsdesc[0] = -1;
- main_thread.tlsdesc[1] = (long)&main_thread;
- main_thread.tlsdesc[2] = SIZE_MAX/PAGE_SIZE;
- main_thread.tlsdesc[3] = 0x51;
- main_thread.self = &main_thread;
+ __syscall(SYS_rt_sigprocmask, SIG_UNBLOCK, SIGPT_SET, 0, 8);
+ if (__set_thread_area(&main_thread) < 0) return -1;
+ main_thread.canceldisable = libc.canceldisable;
+ main_thread.tsd = (void **)__pthread_tsd_main;