man-pages/man2/get_thread_area.2

56 lines
1.6 KiB
Groff
Raw Normal View History

2004-11-03 13:51:07 +00:00
.\" Copyright (C) 2003 Free Software Foundation, Inc.
.\" This file is distributed according to the GNU General Public License.
.\" See the file COPYING in the top level source directory for details.
.\"
.\" Written by Kent Yoder.
.TH GET_THREAD_AREA 2 2012-07-13 "Linux" "Linux Programmer's Manual"
2004-11-03 13:51:07 +00:00
.SH NAME
get_thread_area \- get a thread local storage (TLS) area
2004-11-03 13:51:07 +00:00
.SH "SYNOPSIS"
.B #include <linux/unistd.h>
.br
.B #include <asm/ldt.h>
.sp
.BI "int get_thread_area(struct user_desc *" u_info );
.IR Note :
There is no glibc wrapper for this system call; see NOTES.
2004-11-03 13:51:07 +00:00
.SH "DESCRIPTION"
.BR get_thread_area ()
returns an entry in the current thread's Thread Local Storage (TLS) array.
The index of the entry corresponds to the value
of \fIu_info\->entry_number\fP, passed in by the user.
2007-05-12 13:17:39 +00:00
If the value is in bounds,
.BR get_thread_area ()
copies the corresponding
2007-07-18 20:24:30 +00:00
TLS entry into the area pointed to by \fIu_info\fP.
2004-11-03 13:51:07 +00:00
.SH "RETURN VALUE"
.BR get_thread_area ()
returns 0 on success.
2004-11-03 13:51:07 +00:00
Otherwise, it returns \-1 and sets
.I errno
appropriately.
.SH ERRORS
.TP
.B EFAULT
2007-07-18 20:24:30 +00:00
\fIu_info\fP is an invalid pointer.
2004-11-03 13:51:07 +00:00
.TP
.B EINVAL
\fIu_info\->entry_number\fP is out of bounds.
.SH VERSIONS
2004-11-03 13:51:07 +00:00
A version of
.BR get_thread_area ()
2004-11-03 13:51:07 +00:00
first appeared in Linux 2.5.32.
.SH "CONFORMING TO"
.BR get_thread_area ()
2007-12-25 21:28:09 +00:00
is Linux-specific and should not be used in programs
that are intended to be portable.
.SH NOTES
Glibc does not provide a wrapper for this system call,
since it is generally intended only for use by threading libraries.
In the unlikely event that you want to call it directly, use
.BR syscall (2).
2004-11-03 13:51:07 +00:00
.SH "SEE ALSO"
.BR modify_ldt (2),
.BR set_thread_area (2)