1 .\" Copyright (C) 2003 Free Software Foundation, Inc.
4 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
5 .\" This file is distributed according to the GNU General Public License.
8 .TH SET_THREAD_AREA 2 2012-07-13 "Linux" "Linux Programmer's Manual"
10 set_thread_area \- set a thread local storage (TLS) area
12 .B #include <linux/unistd.h>
14 .B #include <asm/ldt.h>
16 .BI "int set_thread_area(struct user_desc *" u_info );
19 There is no glibc wrapper for this system call; see NOTES.
21 .BR set_thread_area ()
22 sets an entry in the current thread's thread-local storage (TLS) array.
23 The TLS array entry set by
24 .BR set_thread_area ()
25 corresponds to the value of
26 .I u_info\->entry_number
27 passed in by the user.
28 If this value is in bounds,
29 .BR set_thread_area ()
30 copies the TLS descriptor pointed to by
32 into the thread's TLS array.
35 .BR set_thread_area ()
38 of \-1, it uses a free TLS entry.
40 .BR set_thread_area ()
41 finds a free TLS entry, the value of
42 .I u_info\->entry_number
43 is set upon return to show which entry was changed.
45 .BR set_thread_area ()
46 returns 0 on success, and \-1 on failure, with
52 \fIu_info\->entry_number\fP is out of bounds.
55 \fIu_info\fP is an invalid pointer.
58 A free TLS entry could not be located.
61 .BR set_thread_area ()
62 first appeared in Linux 2.5.29.
64 .BR set_thread_area ()
65 is Linux-specific and should not be used in programs that are intended
68 Glibc does not provide a wrapper for this system call,
69 since it is generally intended only for use by threading libraries.
70 In the unlikely event that you want to call it directly, use
73 .BR get_thread_area (2)
75 This page is part of release 3.67 of the Linux
78 A description of the project,
79 information about reporting bugs,
80 and the latest version of this page,
82 \%http://www.kernel.org/doc/man\-pages/.