]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/set_thread_area.2
ffix
[thirdparty/man-pages.git] / man2 / set_thread_area.2
CommitLineData
fea681da
MK
1.\" Copyright (C) 2003 Free Software Foundation, Inc.
2.\" This file is distributed according to the GNU General Public License.
3.\" See the file COPYING in the top level source directory for details.
4.\"
5.\" Author: Kent Yoder
6.\"
d9343c5c 7.TH SET_THREAD_AREA 2 2003-02-21 "Linux" "Linux Programmer's Manual"
fea681da
MK
8.SH NAME
9set_thread_area \- Set a Thread Local Storage (TLS) area
10.SH "SYNOPSIS"
11.B #include <linux/unistd.h>
12.br
13.B #include <asm/ldt.h>
14.sp
b9f02710 15.BI "int set_thread_area(struct user_desc *" u_info );
fea681da 16.SH "DESCRIPTION"
e511ffb6 17.BR set_thread_area ()
c13182ef 18sets an entry in the current thread's Thread Local Storage (TLS) array.
fea681da 19The TLS array entry set by
e511ffb6 20.BR set_thread_area ()
fea681da
MK
21corresponds to the value of
22.I u_info->entry_number
c13182ef
MK
23passed in by the user.
24If this value is in bounds,
e511ffb6 25.BR set_thread_area ()
fea681da
MK
26copies the TLS descriptor pointed to by
27.I u_info
28into the thread's TLS array.
29.PP
30When
e511ffb6 31.BR set_thread_area ()
fea681da
MK
32is passed an
33.I entry_number
c13182ef
MK
34of \-1, it uses a free TLS entry.
35If
e511ffb6 36.BR set_thread_area ()
c13182ef 37finds a free TLS entry, the value of
fea681da
MK
38.I u_info->entry_number
39is set upon return to show which entry was changed.
fea681da 40.SH "RETURN VALUE"
e511ffb6 41.BR set_thread_area ()
fea681da
MK
42returns 0 on success, and \-1 on failure, with
43.I errno
44set appropriately.
fea681da
MK
45.SH "ERRORS"
46.TP
47.B EINVAL
a8d55537 48\fIu_info->entry_number\fP is out of bounds.
fea681da
MK
49.TP
50.B EFAULT
a8d55537 51\fIu_info\fP is an invalid pointer.
fea681da
MK
52.TP
53.B ESRCH
54A free TLS entry could not be located.
fea681da
MK
55.SH "VERSIONS"
56A version of
e511ffb6 57.BR set_thread_area ()
fea681da 58first appeared in Linux 2.5.29.
a1d5f77c
MK
59.SH "CONFORMING TO"
60.BR set_thread_area ()
61is Linux specific and should not be used in programs that are intended
62to be portable.
fea681da 63.SH "SEE ALSO"
ccd2b351 64.BR get_thread_area (2)