]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/get_thread_area.2
get_thread_area.2: tfix
[thirdparty/man-pages.git] / 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 2012-07-13 "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
16 .IR Note :
17 There is no glibc wrapper for this system call; see NOTES.
18 .SH "DESCRIPTION"
19 .BR get_thread_area ()
20 returns an entry in the current thread's thread-local storage (TLS) array.
21 The index of the entry corresponds to the value
22 of \fIu_info\->entry_number\fP, passed in by the user.
23 If the value is in bounds,
24 .BR get_thread_area ()
25 copies the corresponding
26 TLS entry into the area pointed to by \fIu_info\fP.
27 .SH "RETURN VALUE"
28 .BR get_thread_area ()
29 returns 0 on success.
30 Otherwise, it returns \-1 and sets
31 .I errno
32 appropriately.
33 .SH ERRORS
34 .TP
35 .B EFAULT
36 \fIu_info\fP is an invalid pointer.
37 .TP
38 .B EINVAL
39 \fIu_info\->entry_number\fP is out of bounds.
40 .SH VERSIONS
41 A version of
42 .BR get_thread_area ()
43 first appeared in Linux 2.5.32.
44 .SH "CONFORMING TO"
45 .BR get_thread_area ()
46 is Linux-specific and should not be used in programs
47 that are intended to be portable.
48 .SH NOTES
49 Glibc does not provide a wrapper for this system call,
50 since it is generally intended only for use by threading libraries.
51 In the unlikely event that you want to call it directly, use
52 .BR syscall (2).
53 .SH "SEE ALSO"
54 .BR modify_ldt (2),
55 .BR set_thread_area (2)