1SET_THREAD_AREA(2)         Linux Programmer's Manual        SET_THREAD_AREA(2)
2
3
4

NAME

6       set_thread_area - set a thread local storage (TLS) area
7

SYNOPSIS

9       #include <linux/unistd.h>
10       #include <asm/ldt.h>
11
12       int set_thread_area(struct user_desc *u_info);
13
14       Note: There is no glibc wrapper for this system call; see NOTES.
15

DESCRIPTION

17       set_thread_area()  sets  an  entry in the current thread's thread-local
18       storage (TLS) array.  The TLS array entry set by set_thread_area() cor‐
19       responds  to  the  value of u_info->entry_number passed in by the user.
20       If this value is in bounds, set_thread_area() copies the TLS descriptor
21       pointed to by u_info into the thread's TLS array.
22
23       When  set_thread_area() is passed an entry_number of -1, it uses a free
24       TLS entry.  If set_thread_area() finds a free TLS entry, the  value  of
25       u_info->entry_number  is  set  upon  return  to  show  which  entry was
26       changed.
27

RETURN VALUE

29       set_thread_area() returns 0 on success, and -1 on failure,  with  errno
30       set appropriately.
31

ERRORS

33       EINVAL u_info->entry_number is out of bounds.
34
35       EFAULT u_info is an invalid pointer.
36
37       ESRCH  A free TLS entry could not be located.
38

VERSIONS

40       A version of set_thread_area() first appeared in Linux 2.5.29.
41

CONFORMING TO

43       set_thread_area()  is Linux-specific and should not be used in programs
44       that are intended to be portable.
45

NOTES

47       Glibc does not provide a wrapper for this system call, since it is gen‐
48       erally  intended  only for use by threading libraries.  In the unlikely
49       event that you want to call it directly, use syscall(2).
50

SEE ALSO

52       get_thread_area(2)
53

COLOPHON

55       This page is part of release 3.53 of the Linux  man-pages  project.   A
56       description  of  the project, and information about reporting bugs, can
57       be found at http://www.kernel.org/doc/man-pages/.
58
59
60
61Linux                             2012-07-13                SET_THREAD_AREA(2)
Impressum