]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/set_thread_area.2
Import of man-pages 1.70
[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 .B 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 .B set_thread_area
21 corresponds to the value of
22 .I u_info->entry_number
23 passed in by the user. If this value is in bounds,
24 .B set_thread_area
25 copies the TLS descriptor pointed to by
26 .I u_info
27 into the thread's TLS array.
28 .PP
29 When
30 .B set_thread_area
31 is passed an
32 .I entry_number
33 of \-1, it uses a free TLS entry. If
34 .B set_thread_area
35 finds a free TLS entry, the value of
36 .I u_info->entry_number
37 is set upon return to show which entry was changed.
38
39 .SH "RETURN VALUE"
40 .B set_thread_area
41 returns 0 on success, and \-1 on failure, with
42 .I errno
43 set appropriately.
44
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
56 .SH "CONFORMING TO"
57 .B set_thread_area
58 is Linux specific and should not be used in programs that are intended
59 to be portable.
60
61 .SH "VERSIONS"
62 A version of
63 .B set_thread_area
64 first appeared in Linux 2.5.29.
65
66 .SH "SEE ALSO"
67 .BR get_thread_area (2).