diff options
Diffstat (limited to 'man2/set_thread_area.2')
-rw-r--r-- | man2/set_thread_area.2 | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/man2/set_thread_area.2 b/man2/set_thread_area.2 new file mode 100644 index 000000000..8e551c6b0 --- /dev/null +++ b/man2/set_thread_area.2 @@ -0,0 +1,67 @@ +.\" 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" +.B set_thread_area +sets an entry in the current thread's Thread Local Storage (TLS) array. +The TLS array entry set by +.B set_thread_area +corresponds to the value of +.I u_info->entry_number +passed in by the user. If this value is in bounds, +.B set_thread_area +copies the TLS descriptor pointed to by +.I u_info +into the thread's TLS array. +.PP +When +.B set_thread_area +is passed an +.I entry_number +of \-1, it uses a free TLS entry. If +.B 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" +.B 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" +.B set_thread_area +is Linux specific and should not be used in programs that are intended +to be portable. + +.SH "VERSIONS" +A version of +.B set_thread_area +first appeared in Linux 2.5.29. + +.SH "SEE ALSO" +.BR get_thread_area (2). |