man-pages/man2/get_thread_area.2

46 lines
1.3 KiB
Groff

.\" 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 "2003-02-21" "Linux 2.5.32" "Linux Programmer's Manual"
.SH NAME
get_thread_area \- Get a Thread Local Storage (TLS) area
.SH "SYNOPSIS"
.B #include <linux/unistd.h>
.br
.B #include <asm/ldt.h>
.sp
.BI "int get_thread_area(struct user_desc *" u_info );
.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->\fR\fIentry_number\fR, passed in by the user.
If the value is in bounds, \fBget_thread_info\fR copies the corresponding
TLS entry into the area pointed to by \fIu_info\fR.
.SH "RETURN VALUE"
.BR get_thread_area ()
returns 0 on success.
Otherwise, it returns \-1 and sets
.I errno
appropriately.
.SH ERRORS
.TP
.B EFAULT
\fIu_info\fR is an invalid pointer.
.TP
.B EINVAL
\fIu_info->\fR\fIentry_number\fR is out of bounds.
.SH "CONFORMING TO"
.BR get_thread_area ()
is Linux specific and should not be used in programs
that are intended to be portable.
.SH AVAILABILITY
A version of
.BR get_thread_area ()
first appeared in Linux 2.5.32.
.SH "SEE ALSO"
.BR modify_ldt (2),
.BR set_thread_area (2)