]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/set_thread_area.2
Reordered sections to be more consistent, in some cases renaming
[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 2003-02-21 "Linux 2.5.29" "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 .SH "DESCRIPTION"
17 .BR set_thread_area ()
18 sets an entry in the current thread's Thread Local Storage (TLS) array.
19 The TLS array entry set by
20 .BR set_thread_area ()
21 corresponds to the value of
22 .I u_info->entry_number
23 passed in by the user.
24 If this value is in bounds,
25 .BR set_thread_area ()
26 copies the TLS descriptor pointed to by
27 .I u_info
28 into the thread's TLS array.
29 .PP
30 When
31 .BR set_thread_area ()
32 is passed an
33 .I entry_number
34 of \-1, it uses a free TLS entry.
35 If
36 .BR set_thread_area ()
37 finds a free TLS entry, the value of
38 .I u_info->entry_number
39 is set upon return to show which entry was changed.
40 .SH "RETURN VALUE"
41 .BR set_thread_area ()
42 returns 0 on success, and \-1 on failure, with
43 .I errno
44 set appropriately.
45 .SH "ERRORS"
46 .TP
47 .B EINVAL
48 \fIu_info->\fR\fIentry_number\fR is out of bounds.
49 .TP
50 .B EFAULT
51 \fIu_info\fR is an invalid pointer.
52 .TP
53 .B ESRCH
54 A free TLS entry could not be located.
55 .SH "VERSIONS"
56 A version of
57 .BR set_thread_area ()
58 first appeared in Linux 2.5.29.
59 .SH "CONFORMING TO"
60 .BR set_thread_area ()
61 is Linux specific and should not be used in programs that are intended
62 to be portable.
63 .SH "SEE ALSO"
64 .BR get_thread_area (2).