arch_prctl(2) | System Calls Manual | arch_prctl(2) |
arch_prctl - fija el estado de un hilo para una arquitectura específica
Biblioteca Estándar C (libc, -lc)
#include <asm/prctl.h> /* Definition of ARCH_* constants */ #include <sys/syscall.h> /* Definition of SYS_* constants */ #include <unistd.h>
int syscall(SYS_arch_prctl, int code, unsigned long addr); int syscall(SYS_arch_prctl, int code, unsigned long *addr);
Note: glibc provides no wrapper for arch_prctl(), necessitating the use of syscall(2).
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 y x86 son:
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.
arch_prctl() es una extensión de Linux/x86-64 y no debería emplearse en programas que se pretenden que sean portables.
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.
FS may be already used by the threading library. Programs that use ARCH_SET_FS directly are very likely to crash.
mmap(2), modify_ldt(2), prctl(2), set_thread_area(2)
Manual del Programador de AMD X86-64
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.
30 Octubre 2022 | Páginas de manual de Linux 6.03 |