6 #include <sys/syscall.h>
8 #ifndef SYS_set_thread_area
9 #define SYS_set_thread_area 243
14 unsigned long tp, old_tp;
17 asm volatile ("move $pid,%0" : "=r" (old_tp));
20 ret = syscall (SYS_set_thread_area, 0xf0);
21 if (ret != -1 || errno != EINVAL) {
22 syscall (SYS_set_thread_area, old_tp);
23 perror ("Invalid thread area accepted:");
27 ret = syscall (SYS_set_thread_area, 0xeddeed00);
29 perror ("Valid thread area not accepted: ");
33 asm volatile ("move $pid,%0" : "=r" (tp));
35 syscall (SYS_set_thread_area, old_tp);
37 if (tp != 0xeddeed00) {
38 * (volatile int *) 0 = 0;