[IPV4]: Correct rp_filter help text.
[linux-2.6/verdex.git] / arch / um / os-Linux / tls.c
blob16215b9908040a6f36e4462c1f117683e81e3805
1 #include <errno.h>
2 #include <unistd.h>
3 #include <sys/ptrace.h>
4 #include <sys/syscall.h>
5 #include <asm/ldt.h>
6 #include "sysdep/tls.h"
7 #include "uml-config.h"
9 /* TLS support - we basically rely on the host's one.*/
11 /* In TT mode, this should be called only by the tracing thread, and makes sense
12 * only for PTRACE_SET_THREAD_AREA. In SKAS mode, it's used normally.
16 #ifndef PTRACE_GET_THREAD_AREA
17 #define PTRACE_GET_THREAD_AREA 25
18 #endif
20 #ifndef PTRACE_SET_THREAD_AREA
21 #define PTRACE_SET_THREAD_AREA 26
22 #endif
24 int os_set_thread_area(user_desc_t *info, int pid)
26 int ret;
28 ret = ptrace(PTRACE_SET_THREAD_AREA, pid, info->entry_number,
29 (unsigned long) info);
30 if (ret < 0)
31 ret = -errno;
32 return ret;
35 #ifdef UML_CONFIG_MODE_SKAS
37 int os_get_thread_area(user_desc_t *info, int pid)
39 int ret;
41 ret = ptrace(PTRACE_GET_THREAD_AREA, pid, info->entry_number,
42 (unsigned long) info);
43 if (ret < 0)
44 ret = -errno;
45 return ret;
48 #endif
50 #ifdef UML_CONFIG_MODE_TT
51 #include "linux/unistd.h"
53 int do_set_thread_area_tt(user_desc_t *info)
55 int ret;
57 ret = syscall(__NR_set_thread_area,info);
58 if (ret < 0) {
59 ret = -errno;
61 return ret;
64 int do_get_thread_area_tt(user_desc_t *info)
66 int ret;
68 ret = syscall(__NR_get_thread_area,info);
69 if (ret < 0) {
70 ret = -errno;
72 return ret;
75 #endif /* UML_CONFIG_MODE_TT */