Merge branch 'for-linus/samsung-2635' of git://git.fluff.org/bjdooks/linux
[deliverable/linux.git] / arch / um / os-Linux / tls.c
CommitLineData
aa6758d4
PBG
1#include <errno.h>
2#include <sys/ptrace.h>
dd77aec0 3#include "sysdep/tls.h"
aa6758d4
PBG
4
5/* TLS support - we basically rely on the host's one.*/
6
aa6758d4
PBG
7#ifndef PTRACE_GET_THREAD_AREA
8#define PTRACE_GET_THREAD_AREA 25
9#endif
10
11#ifndef PTRACE_SET_THREAD_AREA
12#define PTRACE_SET_THREAD_AREA 26
13#endif
14
dd77aec0 15int os_set_thread_area(user_desc_t *info, int pid)
aa6758d4 16{
aa6758d4
PBG
17 int ret;
18
19 ret = ptrace(PTRACE_SET_THREAD_AREA, pid, info->entry_number,
20 (unsigned long) info);
21 if (ret < 0)
22 ret = -errno;
23 return ret;
24}
25
dd77aec0 26int os_get_thread_area(user_desc_t *info, int pid)
aa6758d4 27{
aa6758d4
PBG
28 int ret;
29
30 ret = ptrace(PTRACE_GET_THREAD_AREA, pid, info->entry_number,
31 (unsigned long) info);
32 if (ret < 0)
33 ret = -errno;
34 return ret;
35}
This page took 0.433312 seconds and 5 git commands to generate.