OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / man2 / get_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 .\" Written by Kent Yoder.
6 .TH GET_THREAD_AREA 2 2008-11-27 "Linux" "Linux Programmer's Manual"
7 .SH NAME
8 get_thread_area \- Get a Thread Local Storage (TLS) area
9 .SH "SYNOPSIS"
10 .B #include <linux/unistd.h>
11 .br
12 .B #include <asm/ldt.h>
13 .sp
14 .BI "int get_thread_area(struct user_desc *" u_info );
15 .SH "DESCRIPTION"
16 .BR get_thread_area ()
17 returns an entry in the current thread's Thread Local Storage (TLS) array.
18 The index of the entry corresponds to the value
19 of \fIu_info\->entry_number\fP, passed in by the user.
20 If the value is in bounds,
21 .BR get_thread_area ()
22 copies the corresponding
23 TLS entry into the area pointed to by \fIu_info\fP.
24 .SH "RETURN VALUE"
25 .BR get_thread_area ()
26 returns 0 on success.
27 Otherwise, it returns \-1 and sets
28 .I errno
29 appropriately.
30 .SH ERRORS
31 .TP
32 .B EFAULT
33 \fIu_info\fP is an invalid pointer.
34 .TP
35 .B EINVAL
36 \fIu_info\->entry_number\fP is out of bounds.
37 .SH VERSIONS
38 A version of
39 .BR get_thread_area ()
40 first appeared in Linux 2.5.32.
41 .SH "CONFORMING TO"
42 .BR get_thread_area ()
43 is Linux-specific and should not be used in programs
44 that are intended to be portable.
45 .SH NOTES
46 Glibc does not provide a wrapper for this system call;
47 call it using
48 .BR syscall (2).
49 .SH "SEE ALSO"
50 .BR modify_ldt (2),
51 .BR set_thread_area (2)