man-pages/man2/set_thread_area.2

65 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.
.\"
.\" Author: Kent Yoder
.\"
2007-05-30 05:36:26 +00:00
.TH SET_THREAD_AREA 2 2003-02-21 "Linux" "Linux Programmer's Manual"
2004-11-03 13:51:07 +00:00
.SH NAME
set_thread_area \- Set a Thread Local Storage (TLS) area
.SH "SYNOPSIS"
.B #include <linux/unistd.h>
.br
.B #include <asm/ldt.h>
.sp
2007-04-03 15:32:52 +00:00
.BI "int set_thread_area(struct user_desc *" u_info );
2004-11-03 13:51:07 +00:00
.SH "DESCRIPTION"
.BR set_thread_area ()
sets an entry in the current thread's Thread Local Storage (TLS) array.
2004-11-03 13:51:07 +00:00
The TLS array entry set by
.BR set_thread_area ()
2004-11-03 13:51:07 +00:00
corresponds to the value of
.I u_info->entry_number
passed in by the user.
If this value is in bounds,
.BR set_thread_area ()
2004-11-03 13:51:07 +00:00
copies the TLS descriptor pointed to by
.I u_info
into the thread's TLS array.
.PP
When
.BR set_thread_area ()
2004-11-03 13:51:07 +00:00
is passed an
.I entry_number
of \-1, it uses a free TLS entry.
If
.BR set_thread_area ()
finds a free TLS entry, the value of
2004-11-03 13:51:07 +00:00
.I u_info->entry_number
is set upon return to show which entry was changed.
.SH "RETURN VALUE"
.BR set_thread_area ()
2004-11-03 13:51:07 +00:00
returns 0 on success, and \-1 on failure, with
.I errno
set appropriately.
.SH "ERRORS"
.TP
.B EINVAL
2007-07-18 20:24:30 +00:00
\fIu_info->entry_number\fP is out of bounds.
2004-11-03 13:51:07 +00:00
.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 ESRCH
A free TLS entry could not be located.
.SH "VERSIONS"
A version of
.BR set_thread_area ()
2004-11-03 13:51:07 +00:00
first appeared in Linux 2.5.29.
.SH "CONFORMING TO"
.BR set_thread_area ()
is Linux specific and should not be used in programs that are intended
to be portable.
2004-11-03 13:51:07 +00:00
.SH "SEE ALSO"
2007-05-22 21:49:38 +00:00
.BR get_thread_area (2)