mirror of https://github.com/mkerrisk/man-pages
Clarify interpretation of 'addr'; plus a few other minor edits and updates.
This commit is contained in:
parent
781b97e6a4
commit
498c6aa666
|
@ -21,24 +21,33 @@
|
|||
.\"
|
||||
.\" Formatted or processed versions of this manual, if unaccompanied by
|
||||
.\" the source, must acknowledge the copyright and authors of this work.
|
||||
.TH ARCH_PRCTL 2 2003-02-02 "Linux" "Linux Programmer's Manual"
|
||||
.TH ARCH_PRCTL 2 2007-12-26 "Linux" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
arch_prctl \- set architecture specific thread state
|
||||
arch_prctl \- set architecture-specific thread state
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <asm/prctl.h>
|
||||
.br
|
||||
.B #include <sys/prctl.h>
|
||||
.sp
|
||||
.BI "int arch_prctl(int " code ", unsigned long " addr );
|
||||
.BI "int arch_prctl(int " code ", unsigned long *" addr );
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.BR arch_prctl ()
|
||||
function sets architecture specific process or thread state.
|
||||
function sets architecture-specific process or thread state.
|
||||
.I code
|
||||
selects a subfunction
|
||||
and passes argument
|
||||
.I addr
|
||||
to it.
|
||||
to it;
|
||||
.I addr
|
||||
is interpreted as either an
|
||||
.I "unsigned long"
|
||||
for the "set" operations, or as an
|
||||
.IR "unsigned long *" ,
|
||||
for the "get" operations.
|
||||
.LP
|
||||
Sub functions for x86-64 are:
|
||||
.TP
|
||||
|
@ -53,9 +62,8 @@ Return the 64-bit base value for the
|
|||
.I FS
|
||||
register of the current thread in the
|
||||
.I unsigned long
|
||||
pointed to by the
|
||||
.I address
|
||||
parameter.
|
||||
pointed to
|
||||
.IR addr .
|
||||
.TP
|
||||
.B ARCH_SET_GS
|
||||
Set the 64-bit base for the
|
||||
|
@ -68,11 +76,10 @@ Return the 64-bit base value for the
|
|||
.I GS
|
||||
register of the current thread in the
|
||||
.I unsigned long
|
||||
pointed to by the
|
||||
.I address
|
||||
parameter.
|
||||
pointed to
|
||||
.IR addr .
|
||||
.SH RETURN VALUE
|
||||
On sucess,
|
||||
On success,
|
||||
.BR arch_prctl ()
|
||||
returns 0; on error, \-1 is returned, and
|
||||
.I errno
|
||||
|
@ -111,7 +118,7 @@ segment selector by setting up an LDT with
|
|||
.BR modify_ldt (2)
|
||||
or using the
|
||||
.BR set_thread_area (2)
|
||||
system call in a 2.5 kernel.
|
||||
system call in kernel 2.5 or later.
|
||||
.BR arch_prctl ()
|
||||
is only needed when you want to set bases that are larger than 4GB.
|
||||
Memory in the first 2GB of address space can be allocated by using
|
||||
|
@ -120,7 +127,7 @@ with the
|
|||
.B MAP_32BIT
|
||||
flag.
|
||||
|
||||
As of version 2.3.5, glibc provides no prototype for
|
||||
As of version 2.7, glibc provides no prototype for
|
||||
.BR arch_prctl ().
|
||||
You have to declare it yourself for now.
|
||||
This may be fixed in future glibc versions.
|
||||
|
|
Loading…
Reference in New Issue