]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/set_thread_area.2
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex...
[thirdparty/man-pages.git] / man2 / set_thread_area.2
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.
4 .\"
5 .\" Author: Kent Yoder
6 .\"
7 .TH SET_THREAD_AREA 2 2012-07-13 "Linux" "Linux Programmer's Manual"
8 .SH NAME
9 set_thread_area \- set a thread local storage (TLS) area
10 .SH SYNOPSIS
11 .B #include <linux/unistd.h>
12 .br
13 .B #include <asm/ldt.h>
14 .sp
15 .BI "int set_thread_area(struct user_desc *" u_info );
16
17 .IR Note :
18 There is no glibc wrapper for this system call; see NOTES.
19 .SH DESCRIPTION
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
30 .I u_info
31 into the thread's TLS array.
32 .PP
33 When
34 .BR set_thread_area ()
35 is passed an
36 .I entry_number
37 of \-1, it uses a free TLS entry.
38 If
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.
43 .SH RETURN VALUE
44 .BR set_thread_area ()
45 returns 0 on success, and \-1 on failure, with
46 .I errno
47 set appropriately.
48 .SH ERRORS
49 .TP
50 .B EINVAL
51 \fIu_info\->entry_number\fP is out of bounds.
52 .TP
53 .B EFAULT
54 \fIu_info\fP is an invalid pointer.
55 .TP
56 .B ESRCH
57 A free TLS entry could not be located.
58 .SH VERSIONS
59 A version of
60 .BR set_thread_area ()
61 first appeared in Linux 2.5.29.
62 .SH CONFORMING TO
63 .BR set_thread_area ()
64 is Linux-specific and should not be used in programs that are intended
65 to be portable.
66 .SH NOTES
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
70 .BR syscall (2).
71 .SH SEE ALSO
72 .BR get_thread_area (2)