.\" -*- coding: UTF-8 -*- .\" Copyright (C) 2003 Andi Kleen .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH arch_prctl 2 "30 Octubre 2022" "Páginas de manual de Linux 6.03" .SH NOMBRE arch_prctl \- fija el estado de un hilo para una arquitectura específica .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP /* Definition of \fBARCH_*\fP constants */ \fB#include \fP /* Definition of \fBSYS_*\fP constants */ \fB#include \fP .PP \fBint syscall(SYS_arch_prctl, int \fP\fIcode\fP\fB, unsigned long \fP\fIaddr\fP\fB);\fP \fBint syscall(SYS_arch_prctl, int \fP\fIcode\fP\fB, unsigned long *\fP\fIaddr\fP\fB);\fP .fi .PP \fINote\fP: glibc provides no wrapper for \fBarch_prctl\fP(), necessitating the use of \fBsyscall\fP(2). .SH DESCRIPCIÓN \fBarch_prctl\fP() sets architecture\-specific process or thread state. \fIcode\fP selects a subfunction and passes argument \fIaddr\fP to it; \fIaddr\fP is interpreted as either an \fIunsigned long\fP for the "set" operations, or as an \fIunsigned long\ *\fP, for the "get" operations. .PP Las subfunciones para la arquitectura x86\-64 y x86 son: .TP \fBARCH_SET_CPUID\fP (desde Linux 4.12) .\" commit e9ea1e7f53b852147cbd568b0568c7ad97ec21a3 Enable (\fIaddr != 0\fP) or disable (\fIaddr == 0\fP) the \fIcpuid\fP instruction for the calling thread. The instruction is enabled by default. If disabled, any execution of a \fIcpuid\fP instruction will instead generate a \fBSIGSEGV\fP signal. This feature can be used to emulate \fIcpuid\fP results that differ from what the underlying hardware would have produced (e.g., in a paravirtualization setting). .IP The \fBARCH_SET_CPUID\fP setting is preserved across \fBfork\fP(2) and \fBclone\fP(2) but reset to the default (i.e., \fIcpuid\fP enabled) on \fBexecve\fP(2). .TP \fBARCH_GET_CPUID\fP (desde Linux 4.12) Return the setting of the flag manipulated by \fBARCH_SET_CPUID\fP as the result of the system call (1 for enabled, 0 for disabled). \fIaddr\fP is ignored. .TP Las subfunciones para la arquitectura x86\-64 son: .TP \fBARCH_SET_FS\fP Establece la base de 64 bits para el registro \fIFS\fP a \fIaddr\fP. .TP \fBARCH_GET_FS\fP Devuelve el valor de base de 64 bits para el registro \fIFS\fP del hilo invocante en la variable \fIunsigned long\fP apuntada por \fIaddr\fP. .TP \fBARCH_SET_GS\fP Establece la base de 64 bits para el registro \fIGS\fP a \fIaddr\fP. .TP \fBARCH_GET_GS\fP Devuelve el valor de base 64 bits para el registro \fIGS\fP del hilo actual en la variable \fIunsigned long\fP apuntada por el parámetro \fIaddr\fP. .SH "VALOR DEVUELTO" En caso de éxito \fBarch_prctl\fP() devuelve cero. En caso de error se devuelve \-1, y \fIerrno\fP se define para indicar el tipo de error. .SH ERRORES .TP \fBEFAULT\fP \fIaddr\fP apunta a una dirección no asignada o que está fuera del espacio de direcciones del proceso. .TP \fBEINVAL\fP \fIcode\fP no es un subcomando válido. .TP \fBENODEV\fP Se solicitó \fBARCH_SET_CPUID\fP, pero el hardware subyacente no incluye soporte para error de CPUID. .TP \fBEPERM\fP .\" .SH AUTHOR .\" Man page written by Andi Kleen. \fIaddr\fP está fuera del espacio de direcciones. .SH ESTÁNDARES \fBarch_prctl\fP() es una extensión de Linux/x86\-64 y no debería emplearse en programas que se pretenden que sean portables. .SH NOTAS En la actualidad \fBarch_prctl\fP() es soportada solamente por la plataforma Linux/x86\-64 para programas de 64 bits. .PP La base de 64 bits cambia cuando se carga un nuevo selector de segmento de 32 bits. .PP \fBARCH_SET_GS\fP está deshabilitado en algunos núcleos. .PP Context switches for 64\-bit segment bases are rather expensive. As an optimization, if a 32\-bit TLS base address is used, \fBarch_prctl\fP() may use a real TLS entry as if \fBset_thread_area\fP(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 \fBmmap\fP(2) with the \fBMAP_32BIT\fP flag. .PP Because of the aforementioned optimization, using \fBarch_prctl\fP() and \fBset_thread_area\fP(2) in the same thread is dangerous, as they may overwrite each other's TLS entries. .PP \fIFS\fP may be already used by the threading library. Programs that use \fBARCH_SET_FS\fP directly are very likely to crash. .SH "VÉASE TAMBIÉN" \fBmmap\fP(2), \fBmodify_ldt\fP(2), \fBprctl\fP(2), \fBset_thread_area\fP(2) .PP Manual del Programador de AMD X86\-64 .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars y Marcos Fouces . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .