mirror of https://github.com/mkerrisk/man-pages
74 lines
1.9 KiB
Groff
74 lines
1.9 KiB
Groff
.\" Copyright (C) 2003 Free Software Foundation, Inc.
|
|
.\" Author: Kent Yoder
|
|
.\"
|
|
.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
|
|
.\" This file is distributed according to the GNU General Public License.
|
|
.\" %%%LICENSE_END
|
|
.\"
|
|
.TH SET_THREAD_AREA 2 2012-07-13 "Linux" "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 );
|
|
|
|
.IR Note :
|
|
There is no glibc wrapper for this system call; see NOTES.
|
|
.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\->entry_number\fP is out of bounds.
|
|
.TP
|
|
.B EFAULT
|
|
\fIu_info\fP is an invalid pointer.
|
|
.TP
|
|
.B ESRCH
|
|
A free TLS entry could not be located.
|
|
.SH VERSIONS
|
|
A version of
|
|
.BR set_thread_area ()
|
|
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.
|
|
.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).
|
|
.SH SEE ALSO
|
|
.BR get_thread_area (2)
|