Unit Instance
Units API.
See the Weblate's Web API documentation for detailed description of the API.
GET /api/units/99680/?format=api
https://translate-dev.freebsd.org/api/translations/freebsd-doc/articles_linux-emulation/en/?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": [ "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." ], "id_hash": -5039255757245215466, "content_hash": -5039255757245215466, "location": "article.translate.xml:1918", "context": "", "note": "(itstool) path: sect4/para", "flags": "", "labels": [], "state": 100, "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": 99680, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/articles_linux-emulation/en/?checksum=3a10f796810e8d16", "url": "https://translate-dev.freebsd.org/api/units/99680/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-10-20T12:10:41.218970Z" }{ "translation": "