2004-11-03 13:51:07 +00:00
|
|
|
.\" 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
|
|
|
|
.\"
|
get_robust_list.2, get_thread_area.2, getcpu.2, getdents.2, gettid.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioprio_set.2, kexec_load.2, llseek.2, modify_ldt.2, mq_getsetattr.2, pivot_root.2, readdir.2, rt_sigqueueinfo.2, set_thread_area.2, sgetmask.2, spu_create.2, spu_run.2, subpage_prot.2, sysctl.2, tkill.2: Add note to SYNOPSIS that there is no glibc wrapper for system call
Reduce the chance that the reader may be misled into thinking
that there is a wrapper function for this system call by noting
explicitly in the SYNOPSIS that there is no glibc wrapper and
pointing the reader to NOTES for further details.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-07-13 06:48:20 +00:00
|
|
|
.TH SET_THREAD_AREA 2 2012-07-13 "Linux" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
intro.1, add_key.2, get_mempolicy.2, get_thread_area.2, intro.2, keyctl.2, mbind.2, request_key.2, set_thread_area.2, clock.3, cmsg.3, getcwd.3, getpw.3, intro.3, malloc.3, posix_memalign.3, shm_open.3, sleep.3, sysconf.3, intro.4, sd.4, intro.5, locale.5, slabinfo.5, intro.6, boot.7, bootparam.7, futex.7, glob.7, hier.7, intro.7, libc.7, locale.7, mq_overview.7, netlink.7, sem_overview.7, shm_overview.7, unix.7, intro.8: Global fix: Use consistent capitalization in NAME section
The line(s) in the NAME section should only use capitals
where English usage dictates that. Otherwise, use
lowercase throughout.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-10-21 06:29:13 +00:00
|
|
|
set_thread_area \- set a thread local storage (TLS) area
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "SYNOPSIS"
|
|
|
|
.B #include <linux/unistd.h>
|
|
|
|
.br
|
|
|
|
.B #include <asm/ldt.h>
|
|
|
|
.sp
|
2007-04-03 15:32:52 +00:00
|
|
|
.BI "int set_thread_area(struct user_desc *" u_info );
|
get_robust_list.2, get_thread_area.2, getcpu.2, getdents.2, gettid.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioprio_set.2, kexec_load.2, llseek.2, modify_ldt.2, mq_getsetattr.2, pivot_root.2, readdir.2, rt_sigqueueinfo.2, set_thread_area.2, sgetmask.2, spu_create.2, spu_run.2, subpage_prot.2, sysctl.2, tkill.2: Add note to SYNOPSIS that there is no glibc wrapper for system call
Reduce the chance that the reader may be misled into thinking
that there is a wrapper function for this system call by noting
explicitly in the SYNOPSIS that there is no glibc wrapper and
pointing the reader to NOTES for further details.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-07-13 06:48:20 +00:00
|
|
|
|
|
|
|
.IR Note :
|
|
|
|
There is no glibc wrapper for this system call; see NOTES.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "DESCRIPTION"
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR set_thread_area ()
|
2012-10-21 06:38:50 +00:00
|
|
|
sets an entry in the current thread's thread-local storage (TLS) array.
|
2004-11-03 13:51:07 +00:00
|
|
|
The TLS array entry set by
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR set_thread_area ()
|
2004-11-03 13:51:07 +00:00
|
|
|
corresponds to the value of
|
2007-12-22 16:40:46 +00:00
|
|
|
.I u_info\->entry_number
|
2007-04-12 22:42:49 +00:00
|
|
|
passed in by the user.
|
|
|
|
If this value is in bounds,
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR set_thread_area ()
|
2004-11-03 13:51:07 +00:00
|
|
|
copies the TLS descriptor pointed to by
|
|
|
|
.I u_info
|
|
|
|
into the thread's TLS array.
|
|
|
|
.PP
|
|
|
|
When
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR set_thread_area ()
|
2004-11-03 13:51:07 +00:00
|
|
|
is passed an
|
|
|
|
.I entry_number
|
2007-04-12 22:42:49 +00:00
|
|
|
of \-1, it uses a free TLS entry.
|
|
|
|
If
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR set_thread_area ()
|
2007-04-12 22:42:49 +00:00
|
|
|
finds a free TLS entry, the value of
|
2007-12-22 16:40:46 +00:00
|
|
|
.I u_info\->entry_number
|
2004-11-03 13:51:07 +00:00
|
|
|
is set upon return to show which entry was changed.
|
|
|
|
.SH "RETURN VALUE"
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR set_thread_area ()
|
2004-11-03 13:51:07 +00:00
|
|
|
returns 0 on success, and \-1 on failure, with
|
|
|
|
.I errno
|
|
|
|
set appropriately.
|
|
|
|
.SH "ERRORS"
|
|
|
|
.TP
|
|
|
|
.B EINVAL
|
2007-12-22 16:40:46 +00:00
|
|
|
\fIu_info\->entry_number\fP is out of bounds.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
.B EFAULT
|
2007-07-18 20:24:30 +00:00
|
|
|
\fIu_info\fP is an invalid pointer.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
.B ESRCH
|
|
|
|
A free TLS entry could not be located.
|
|
|
|
.SH "VERSIONS"
|
|
|
|
A version of
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR set_thread_area ()
|
2004-11-03 13:51:07 +00:00
|
|
|
first appeared in Linux 2.5.29.
|
2007-05-18 16:06:42 +00:00
|
|
|
.SH "CONFORMING TO"
|
|
|
|
.BR set_thread_area ()
|
2007-12-25 21:28:09 +00:00
|
|
|
is Linux-specific and should not be used in programs that are intended
|
2007-05-18 16:06:42 +00:00
|
|
|
to be portable.
|
2008-11-28 16:40:28 +00:00
|
|
|
.SH NOTES
|
get_robust_list.2, get_thread_area.2, getcpu.2, getdents.2, gettid.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioprio_set.2, kexec_load.2, llseek.2, modify_ldt.2, mq_getsetattr.2, pivot_root.2, readdir.2, rt_sigqueueinfo.2, set_thread_area.2, sgetmask.2, spu_create.2, spu_run.2, subpage_prot.2, sysctl.2, tkill.2: Add note to SYNOPSIS that there is no glibc wrapper for system call
Reduce the chance that the reader may be misled into thinking
that there is a wrapper function for this system call by noting
explicitly in the SYNOPSIS that there is no glibc wrapper and
pointing the reader to NOTES for further details.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-07-13 06:48:20 +00:00
|
|
|
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
|
2008-11-28 16:40:28 +00:00
|
|
|
.BR syscall (2).
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "SEE ALSO"
|
2007-05-22 21:49:38 +00:00
|
|
|
.BR get_thread_area (2)
|