Provided by: manpages-es-dev_4.21.0-2_all bug

NOMBRE

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

BIBLIOTECA

       Biblioteca Estándar C (libc, -lc)

SINOPSIS

       #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).

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 y x86 son:

       ARCH_SET_CPUID (desde Linux 4.12)
              Enable  (addr  !=  0)   or disable (addr == 0)  the cpuid instruction for the calling thread.  The
              instruction is enabled by default.  If disabled, any execution of a cpuid instruction will instead
              generate a SIGSEGV signal.  This feature can be used to emulate cpuid  results  that  differ  from
              what the underlying hardware would have produced (e.g., in a paravirtualization setting).

              The  ARCH_SET_CPUID  setting  is  preserved across fork(2)  and clone(2)  but reset to the default
              (i.e., cpuid enabled) on execve(2).

       ARCH_GET_CPUID (desde Linux 4.12)
              Return the setting of the flag manipulated by ARCH_SET_CPUID as the result of the system  call  (1
              for enabled, 0 for disabled).  addr is ignored.

       Las subfunciones para la arquitectura x86-64 son:

       ARCH_SET_FS
              Establece la base de 64 bits para el registro FS a addr.

       ARCH_GET_FS
              Devuelve  el  valor  de  base  de  64  bits  para el registro FS del hilo invocante en la variable
              unsigned long apuntada por addr.

       ARCH_SET_GS
              Establece la base de 64 bits para el registro GS a addr.

       ARCH_GET_GS
              Devuelve el valor de base 64 bits para el registro GS del hilo actual en la variable unsigned long
              apuntada por el parámetro 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

       EFAULT addr apunta a una dirección no asignada o que está fuera del espacio de direcciones del proceso.

       EINVAL code no es un subcomando válido.

       ENODEV Se solicitó ARCH_SET_CPUID, pero el hardware subyacente no incluye soporte para error de CPUID.

       EPERM  addr está fuera del espacio de direcciones.

ESTÁNDARES

       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.

       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

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.

Páginas de manual de Linux 6.03                  30 Octubre 2022                                   arch_prctl(2)