1 .\" Copyright (C) 2003 Free Software Foundation, Inc.
2 .\" This file is distributed according to the GNU General Public License.
3 .\" See the file COPYING in the top level source directory for details.
7 .TH SET_THREAD_AREA 2 2012-07-13 "Linux" "Linux Programmer's Manual"
9 set_thread_area \- set a thread local storage (TLS) area
11 .B #include <linux/unistd.h>
13 .B #include <asm/ldt.h>
15 .BI "int set_thread_area(struct user_desc *" u_info );
18 There is no glibc wrapper for this system call; see NOTES.
20 .BR set_thread_area ()
21 sets an entry in the current thread's thread-local storage (TLS) array.
22 The TLS array entry set by
23 .BR set_thread_area ()
24 corresponds to the value of
25 .I u_info\->entry_number
26 passed in by the user.
27 If this value is in bounds,
28 .BR set_thread_area ()
29 copies the TLS descriptor pointed to by
31 into the thread's TLS array.
34 .BR set_thread_area ()
37 of \-1, it uses a free TLS entry.
39 .BR set_thread_area ()
40 finds a free TLS entry, the value of
41 .I u_info\->entry_number
42 is set upon return to show which entry was changed.
44 .BR set_thread_area ()
45 returns 0 on success, and \-1 on failure, with
51 \fIu_info\->entry_number\fP is out of bounds.
54 \fIu_info\fP is an invalid pointer.
57 A free TLS entry could not be located.
60 .BR set_thread_area ()
61 first appeared in Linux 2.5.29.
63 .BR set_thread_area ()
64 is Linux-specific and should not be used in programs that are intended
67 Glibc does not provide a wrapper for this system call,
68 since it is generally intended only for use by threading libraries.
69 In the unlikely event that you want to call it directly, use
72 .BR get_thread_area (2)