.\" 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 2012-07-13 "Linux" "Linux Programmer's Manual" .SH NAME set_thread_area \- set a thread local storage (TLS) area .SH "SYNOPSIS" .B #include .br .B #include .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) .SH COLOPHON This page is part of release 3.44 of the Linux .I man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.