OSDN Git Service

88ae727bc5c822b245be4ac375bf22ced5c391c3
[linuxjm/LDP_man-pages.git] / original / man2 / get_thread_area.2
1 .\" Copyright (C) 2003 Free Software Foundation, Inc.
2 .\" Written by 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 GET_THREAD_AREA 2 2012-07-13 "Linux" "Linux Programmer's Manual"
9 .SH NAME
10 get_thread_area \- get 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 get_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 get_thread_area ()
22 returns an entry in the current thread's thread-local storage (TLS) array.
23 The index of the entry corresponds to the value
24 of \fIu_info\->entry_number\fP, passed in by the user.
25 If the value is in bounds,
26 .BR get_thread_area ()
27 copies the corresponding
28 TLS entry into the area pointed to by \fIu_info\fP.
29 .SH RETURN VALUE
30 .BR get_thread_area ()
31 returns 0 on success.
32 Otherwise, it returns \-1 and sets
33 .I errno
34 appropriately.
35 .SH ERRORS
36 .TP
37 .B EFAULT
38 \fIu_info\fP is an invalid pointer.
39 .TP
40 .B EINVAL
41 \fIu_info\->entry_number\fP is out of bounds.
42 .SH VERSIONS
43 A version of
44 .BR get_thread_area ()
45 first appeared in Linux 2.5.32.
46 .SH CONFORMING TO
47 .BR get_thread_area ()
48 is Linux-specific and should not be used in programs
49 that are intended to be portable.
50 .SH NOTES
51 Glibc does not provide a wrapper for this system call,
52 since it is generally intended for use only by threading libraries.
53 In the unlikely event that you want to call it directly, use
54 .BR syscall (2).
55 .SH SEE ALSO
56 .BR modify_ldt (2),
57 .BR set_thread_area (2)
58 .SH COLOPHON
59 This page is part of release 3.67 of the Linux
60 .I man-pages
61 project.
62 A description of the project,
63 information about reporting bugs,
64 and the latest version of this page,
65 can be found at
66 \%http://www.kernel.org/doc/man\-pages/.