OSDN Git Service

ace2efa5e5a5afaa3839d4074e604759e1c5358c
[linuxjm/LDP_man-pages.git] / original / man2 / set_thread_area.2
1 .\" Copyright (C) 2003 Free Software Foundation, Inc.
2 .\" Author: Kent Yoder
3 .\"
4 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
5 .\" This file is distributed according to the GNU General Public License.
6 .\" %%%LICENSE_END
7 .\"
8 .TH SET_THREAD_AREA 2 2012-07-13 "Linux" "Linux Programmer's Manual"
9 .SH NAME
10 set_thread_area \- set a thread local storage (TLS) area
11 .SH SYNOPSIS
12 .B #include <linux/unistd.h>
13 .br
14 .B #include <asm/ldt.h>
15 .sp
16 .BI "int set_thread_area(struct user_desc *" u_info );
17
18 .IR Note :
19 There is no glibc wrapper for this system call; see NOTES.
20 .SH DESCRIPTION
21 .BR set_thread_area ()
22 sets an entry in the current thread's thread-local storage (TLS) array.
23 The TLS array entry set by
24 .BR set_thread_area ()
25 corresponds to the value of
26 .I u_info\->entry_number
27 passed in by the user.
28 If this value is in bounds,
29 .BR set_thread_area ()
30 copies the TLS descriptor pointed to by
31 .I u_info
32 into the thread's TLS array.
33 .PP
34 When
35 .BR set_thread_area ()
36 is passed an
37 .I entry_number
38 of \-1, it uses a free TLS entry.
39 If
40 .BR set_thread_area ()
41 finds a free TLS entry, the value of
42 .I u_info\->entry_number
43 is set upon return to show which entry was changed.
44 .SH RETURN VALUE
45 .BR set_thread_area ()
46 returns 0 on success, and \-1 on failure, with
47 .I errno
48 set appropriately.
49 .SH ERRORS
50 .TP
51 .B EINVAL
52 \fIu_info\->entry_number\fP is out of bounds.
53 .TP
54 .B EFAULT
55 \fIu_info\fP is an invalid pointer.
56 .TP
57 .B ESRCH
58 A free TLS entry could not be located.
59 .SH VERSIONS
60 A version of
61 .BR set_thread_area ()
62 first appeared in Linux 2.5.29.
63 .SH CONFORMING TO
64 .BR set_thread_area ()
65 is Linux-specific and should not be used in programs that are intended
66 to be portable.
67 .SH NOTES
68 Glibc does not provide a wrapper for this system call,
69 since it is generally intended only for use by threading libraries.
70 In the unlikely event that you want to call it directly, use
71 .BR syscall (2).
72 .SH SEE ALSO
73 .BR get_thread_area (2)
74 .SH COLOPHON
75 This page is part of release 3.67 of the Linux
76 .I man-pages
77 project.
78 A description of the project,
79 information about reporting bugs,
80 and the latest version of this page,
81 can be found at
82 \%http://www.kernel.org/doc/man\-pages/.