]>
Commit | Line | Data |
---|---|---|
fea681da MK |
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 | .\" | |
d9343c5c | 7 | .TH SET_THREAD_AREA 2 2003-02-21 "Linux" "Linux Programmer's Manual" |
fea681da MK |
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 | |
b9f02710 | 15 | .BI "int set_thread_area(struct user_desc *" u_info ); |
fea681da | 16 | .SH "DESCRIPTION" |
e511ffb6 | 17 | .BR set_thread_area () |
c13182ef | 18 | sets an entry in the current thread's Thread Local Storage (TLS) array. |
fea681da | 19 | The TLS array entry set by |
e511ffb6 | 20 | .BR set_thread_area () |
fea681da MK |
21 | corresponds to the value of |
22 | .I u_info->entry_number | |
c13182ef MK |
23 | passed in by the user. |
24 | If this value is in bounds, | |
e511ffb6 | 25 | .BR set_thread_area () |
fea681da MK |
26 | copies the TLS descriptor pointed to by |
27 | .I u_info | |
28 | into the thread's TLS array. | |
29 | .PP | |
30 | When | |
e511ffb6 | 31 | .BR set_thread_area () |
fea681da MK |
32 | is passed an |
33 | .I entry_number | |
c13182ef MK |
34 | of \-1, it uses a free TLS entry. |
35 | If | |
e511ffb6 | 36 | .BR set_thread_area () |
c13182ef | 37 | finds a free TLS entry, the value of |
fea681da MK |
38 | .I u_info->entry_number |
39 | is set upon return to show which entry was changed. | |
fea681da | 40 | .SH "RETURN VALUE" |
e511ffb6 | 41 | .BR set_thread_area () |
fea681da MK |
42 | returns 0 on success, and \-1 on failure, with |
43 | .I errno | |
44 | set appropriately. | |
fea681da MK |
45 | .SH "ERRORS" |
46 | .TP | |
47 | .B EINVAL | |
a8d55537 | 48 | \fIu_info->entry_number\fP is out of bounds. |
fea681da MK |
49 | .TP |
50 | .B EFAULT | |
a8d55537 | 51 | \fIu_info\fP is an invalid pointer. |
fea681da MK |
52 | .TP |
53 | .B ESRCH | |
54 | A free TLS entry could not be located. | |
fea681da MK |
55 | .SH "VERSIONS" |
56 | A version of | |
e511ffb6 | 57 | .BR set_thread_area () |
fea681da | 58 | first appeared in Linux 2.5.29. |
a1d5f77c MK |
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. | |
fea681da | 63 | .SH "SEE ALSO" |
ccd2b351 | 64 | .BR get_thread_area (2) |