mirror of https://github.com/mkerrisk/man-pages
68 lines
1.6 KiB
Groff
68 lines
1.6 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.
|
|
.\"
|
|
.\" Author: Kent Yoder
|
|
.\"
|
|
.TH "SET_THREAD_AREA" 2 "2003-02-21" "Linux 2.5.29" "Linux Programmer's Manual"
|
|
.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
|
|
.BI "int set_thread_area (struct user_desc *" u_info );
|
|
.SH "DESCRIPTION"
|
|
.BR set_thread_area ()
|
|
sets an entry in the current thread's Thread Local Storage (TLS) array.
|
|
The TLS array entry set by
|
|
.BR set_thread_area ()
|
|
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 ()
|
|
copies the TLS descriptor pointed to by
|
|
.I u_info
|
|
into the thread's TLS array.
|
|
.PP
|
|
When
|
|
.BR set_thread_area ()
|
|
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
|
|
.I u_info->entry_number
|
|
is set upon return to show which entry was changed.
|
|
|
|
.SH "RETURN VALUE"
|
|
.BR set_thread_area ()
|
|
returns 0 on success, and \-1 on failure, with
|
|
.I errno
|
|
set appropriately.
|
|
|
|
.SH "ERRORS"
|
|
.TP
|
|
.B EINVAL
|
|
\fIu_info->\fR\fIentry_number\fR is out of bounds.
|
|
.TP
|
|
.B EFAULT
|
|
\fIu_info\fR is an invalid pointer.
|
|
.TP
|
|
.B ESRCH
|
|
A free TLS entry could not be located.
|
|
|
|
.SH "CONFORMING TO"
|
|
.BR set_thread_area ()
|
|
is Linux specific and should not be used in programs that are intended
|
|
to be portable.
|
|
|
|
.SH "VERSIONS"
|
|
A version of
|
|
.BR set_thread_area ()
|
|
first appeared in Linux 2.5.29.
|
|
|
|
.SH "SEE ALSO"
|
|
.BR get_thread_area (2).
|