mirror of https://github.com/mkerrisk/man-pages
set_thread_area.2: Minor tweaks to Eugene's changes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
f7c3bc5ce6
commit
e7871dadf9
|
@ -48,12 +48,12 @@ allows storing an arbitrary pointer (provided in the
|
||||||
.B tp
|
.B tp
|
||||||
argument on m68k and in the
|
argument on m68k and in the
|
||||||
.B addr
|
.B addr
|
||||||
argument on MIPS) in kernel's structure associated with the caller thread
|
argument on MIPS)
|
||||||
and then retrieving it via the
|
in the kernel data structure associated with the calling thread;
|
||||||
|
this pointer can later be retrieved using
|
||||||
.BR get_thread_area ()
|
.BR get_thread_area ()
|
||||||
syscall (see also
|
(see also NOTES
|
||||||
.I NOTES
|
for information regarding obtaining the thread pointer on MIPS).
|
||||||
for the information regarding obtaining thread pointer on MIPS).
|
|
||||||
.PP
|
.PP
|
||||||
On x86, Linux dedicates three global descriptor table (GDT) entries for
|
On x86, Linux dedicates three global descriptor table (GDT) entries for
|
||||||
thread-local storage.
|
thread-local storage.
|
||||||
|
@ -130,19 +130,19 @@ Since Linux 3.19,
|
||||||
cannot be used to write non-present segments, 16-bit segments, or code
|
cannot be used to write non-present segments, 16-bit segments, or code
|
||||||
segments, although clearing a segment is still acceptable.
|
segments, although clearing a segment is still acceptable.
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
On x86, these syscalls
|
On x86, these system calls
|
||||||
return 0 on success, and \-1 on failure, with
|
return 0 on success, and \-1 on failure, with
|
||||||
.I errno
|
.I errno
|
||||||
set appropriately.
|
set appropriately.
|
||||||
.PP
|
.PP
|
||||||
On MIPS and m68k,
|
On MIPS and m68k,
|
||||||
.BR set_thread_area ()
|
.BR set_thread_area ()
|
||||||
syscall always returns 0.
|
always returns 0.
|
||||||
On m68k,
|
On m68k,
|
||||||
.BR get_thread_area ()
|
.BR get_thread_area ()
|
||||||
syscall returns (previously set via
|
returns the thread area pointer value
|
||||||
.BR set_thread_area ())
|
(previously set via
|
||||||
thread area pointer value.
|
.BR set_thread_area ()).
|
||||||
.SH ERRORS
|
.SH ERRORS
|
||||||
.TP
|
.TP
|
||||||
.B EFAULT
|
.B EFAULT
|
||||||
|
@ -186,8 +186,16 @@ This is not normally a problem, as
|
||||||
.BR arch_prctl (2)
|
.BR arch_prctl (2)
|
||||||
is normally used only by 64-bit programs.
|
is normally used only by 64-bit programs.
|
||||||
.PP
|
.PP
|
||||||
On MIPS, in order to obtain thread area pointer, "rdhwr dest, $29" instruction
|
On MIPS, the current value of the thread area pointer can be obtained
|
||||||
can be used; it traps and is handled by kernel.
|
using the instruction:
|
||||||
|
.PP
|
||||||
|
.in +4n
|
||||||
|
.EX
|
||||||
|
rdhwr dest, $29
|
||||||
|
.EE
|
||||||
|
.in
|
||||||
|
.PP
|
||||||
|
This instruction traps and is handled by kernel.
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
On 64-bit kernels before Linux 3.19,
|
On 64-bit kernels before Linux 3.19,
|
||||||
.\" commit e30ab185c490e9a9381385529e0fd32f0a399495
|
.\" commit e30ab185c490e9a9381385529e0fd32f0a399495
|
||||||
|
|
Loading…
Reference in New Issue