Unit Instance
Units API.
See the Weblate's Web API documentation for detailed description of the API.
GET /api/units/26548/?format=api
{ "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/articles_linux-emulation/es/?format=api", "source": [ "Loading of TLS for the current thread happens by calling <function>set_thread_area</function> while loading TLS for a second process in <function>clone</function> is done in the separate block in <function>clone</function>. Those two functions are very similar. The only difference being the actual loading of the GDT segment, which happens on the next context switch for the newly created process while <function>set_thread_area</function> must load this directly. The code basically does this. It copies the <trademark class=\"registered\">Linux</trademark> form segment descriptor from the userland. The code checks for the number of the descriptor but because this differs between FreeBSD and <trademark class=\"registered\">Linux</trademark> we fake it a little. We only support indexes of 6, 3 and -1. The 6 is genuine <trademark class=\"registered\">Linux</trademark> number, 3 is genuine FreeBSD one and -1 means autoselection. Then we set the descriptor number to constant 3 and copy out this to the userspace. We rely on the userspace process using the number from the descriptor but this works most of the time (have never seen a case where this did not work) as the userspace process typically passes in 1. Then we convert the descriptor from the <trademark class=\"registered\">Linux</trademark> form to a machine dependant form (i.e. operating system independent form) and copy this to the FreeBSD defined segment descriptor. Finally we can load it. We assign the descriptor to threads PCB (process control block) and load the <varname>%gs</varname> segment using <function>load_gs</function>. This loading must be done in a critical section so that nothing can interrupt us. The <literal>CLONE_SETTLS</literal> case works exactly like this just the loading using <function>load_gs</function> is not performed. The segment used for this (segment number 3) is shared for this use between FreeBSD processes and <trademark class=\"registered\">Linux</trademark> processes so the <trademark class=\"registered\">Linux</trademark> emulation layer does not add any overhead over plain FreeBSD." ], "previous_source": "", "target": [ "La carga de TLS para el hilo actual se realiza llamando <function>set_thread_area</function>mientras carga TLS para un segundo proceso en <function>clone</function>se hace en el bloque separado en <function>clone</function>. Esas dos funciones son muy similares. La única diferencia es la carga real del segmento GDT, que ocurre en el siguiente cambio de contexto para el proceso recién creado mientras <function>set_thread_area</function>debe cargar esto directamente. El código básicamente hace esto. Copia el <trademark class=\"registered\">Linux</trademark> descriptor de segmento de formulario del área de usuario. El código busca el número del descriptor, pero debido a que este difiere entre FreeBSD y <trademark class=\"registered\">Linux</trademark> lo fingimos un poco. Solo admitimos índices de 6, 3 y -1. El 6 es genuino <trademark class=\"registered\">Linux</trademark> número, 3 es uno genuino de FreeBSD y -1 significa autoselección. Luego establecemos el número de descriptor en constante 3 y lo copiamos en el espacio de usuario. Confiamos en el proceso del espacio de usuario utilizando el número del descriptor, pero esto funciona la mayor parte del tiempo (nunca he visto un caso en el que esto no haya funcionado) ya que el proceso del espacio de usuario normalmente pasa en 1. Luego, convertimos el descriptor del <trademark class=\"registered\">Linux</trademark>formulario a un formulario dependiente de la máquina (es decir, formulario independiente del sistema operativo) y cópielo en el descriptor de segmento definido de FreeBSD. Finalmente podemos cargarlo. Asignamos el descriptor a los subprocesos PCB (bloque de control de proceso) y cargamos el <varname>%gs</varname> segmento usando<function>load_gs</function>. Esta carga debe hacerse en un tramo crítico para que nada nos interrumpa. los <literal>CLONE_SETTLS</literal> El caso funciona exactamente así, solo la carga usando <function>load_gs</function> no se realiza. El segmento utilizado para esto (segmento número 3) se comparte para este uso entre los procesos FreeBSD y <trademark class=\"registered\">Linux</trademark> procesos para que el <trademark class=\"registered\">Linux</trademark> La capa de emulación no agrega ninguna sobrecarga sobre FreeBSD simple." ], "id_hash": -5039255757245215466, "content_hash": -5039255757245215466, "location": "article.translate.xml:1918", "context": "", "note": "(itstool) path: sect4/para", "flags": "", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 283, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 295, "source_unit": "https://translate-dev.freebsd.org/api/units/99680/?format=api", "priority": 100, "id": 26548, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/articles_linux-emulation/es/?checksum=3a10f796810e8d16", "url": "https://translate-dev.freebsd.org/api/units/26548/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:10:41.218970Z" }