2 #include <linux/unistd.h>
4 #include <sys/syscall.h>
7 #include "sysdep/tls.h"
9 /* Checks whether host supports TLS, and sets *tls_min according to the value
11 * i386 host have it == 6; x86_64 host have it == 12, for i386 emulation. */
12 void check_host_supports_tls(int *supports_tls, int *tls_min) {
13 /* Values for x86 and x86_64.*/
14 int val[] = {GDT_ENTRY_TLS_MIN_I386, GDT_ENTRY_TLS_MIN_X86_64};
17 for (i = 0; i < ARRAY_SIZE(val); i++) {
19 info.entry_number = val[i];
21 if (syscall(__NR_get_thread_area, &info) == 0) {
28 else if (errno == ENOSYS)