Scroll to navigation

ARCH_PRCTL(2) Manual del Programador de Linux ARCH_PRCTL(2)

NOMBRE

arch_prctl - fija el estado de un hilo para una arquitectura específica

SINOPSIS

#include <asm/prctl.h>
#include <sys/prctl.h>
int arch_prctl(int code, unsigned long addr);
int arch_prctl(int code, unsigned long *addr);

DESCRIPCIÓN

arch_prctl() sets architecture-specific process or thread state. code selects a subfunction and passes argument addr to it; addr is interpreted as either an unsigned long for the "set" operations, or as an unsigned long *, for the "get" operations.

Las subfunciones para la arquitectura x86-64 son:

Establece la base de 64 bits para el registro FS a addr.
Return the 64-bit base value for the FS register of the current thread in the unsigned long pointed to by addr.
Establece la base de 64 bits para el registro GS a addr.
Return the 64-bit base value for the GS register of the current thread in the unsigned long pointed to by addr.

VALOR DEVUELTO

En caso de éxito arch_prctl() devuelve cero. En caso de error se devuelve -1, y errno se define para indicar el tipo de error.

ERRORES

addr apunta a una dirección no asignada o que está fuera del espacio de direcciones del proceso.
code no es un subcomando válido.
addr está fuera del espacio de direcciones.

CONFORME A

arch_prctl() es una extensión de Linux/x86-64 y no debería emplearse en programas que se pretenden que sean portables.

NOTAS

En la actualidad arch_prctl() es soportada solamente por la plataforma Linux/x86-64 para programas de 64 bits.

La base de 64 bits cambia cuando se carga un nuevo selector de segmento de 32 bits.

ARCH_SET_GS está deshabilitado en algunos núcleos.

Context switches for 64-bit segment bases are rather expensive. As an optimization, if a 32-bit TLS base address is used, arch_prctl() may use a real TLS entry as if set_thread_area(2) had been called, instead of manipulating the segment base register directly. Memory in the first 2 GB of address space can be allocated by using mmap(2) with the MAP_32BIT flag.

Because of the aforementioned optimization, using arch_prctl() and set_thread_area(2) in the same thread is dangerous, as they may overwrite each other's TLS entries.

As of version 2.7, glibc provides no prototype for arch_prctl(). You have to declare it yourself for now. This may be fixed in future glibc versions.

FS may be already used by the threading library. Programs that use ARCH_SET_FS directly are very likely to crash.

VÉASE TAMBIÉN

mmap(2), modify_ldt(2), prctl(2), set_thread_area(2)

Manual del Programador de AMD X86-64

COLOFÓN

Esta página es parte de la versión 4.16 del proyecto Linux man-pages. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en https://www.kernel.org/doc/man-pages/.

TRADUCCIÓN

La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars <mpi79470@alu.um.es> y Marcos Fouces <marcos@debian.org>

Esta traducción es documentación libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD.

Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a debian-l10n-spanish@lists.debian.org.

15 Septiembre 2017 Linux