Debian Codegraph @

po/es/man2/sched_setaffinity.2.po

raw
1 # Spanish translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Miguel Pérez Ibars <[email protected]>, 2004.
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: manpages-l10n\n"
8 "POT-Creation-Date: 2026-06-05 06:42+0200\n"
9 "PO-Revision-Date: 2004-07-05 19:53+0200\n"
10 "Last-Translator: Miguel Pérez Ibars <[email protected]>\n"
11 "Language-Team: Spanish <[email protected]>\n"
12 "Language: es\n"
13 "MIME-Version: 1.0\n"
14 "Content-Type: text/plain; charset=UTF-8\n"
15 "Content-Transfer-Encoding: 8bit\n"
16 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17 "X-Generator: Lokalize 20.04.1\n"
18
19 #. type: TH
20 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
21 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
22 #, no-wrap
23 msgid "sched_setaffinity"
24 msgstr ""
25
26 #. type: TH
27 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
28 #: opensuse-tumbleweed
29 #, no-wrap
30 msgid "2026-02-08"
31 msgstr "8 Febrero 2026"
32
33 #. type: TH
34 #: archlinux debian-unstable
35 #, fuzzy, no-wrap
36 #| msgid "Linux man-pages 6.17"
37 msgid "Linux man-pages 6.18"
38 msgstr "Páginas de Manual de Linux 6.17"
39
40 #. type: SH
41 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
42 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
43 #, no-wrap
44 msgid "NAME"
45 msgstr "NOMBRE"
46
47 #. type: Plain text
48 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
49 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
50 #, fuzzy
51 #| msgid ""
52 #| "sched_setaffinity, sched_getaffinity - set and get a process's CPU "
53 #| "affinity mask"
54 msgid ""
55 "sched_setaffinity, sched_getaffinity - set and get a thread's CPU affinity "
56 "mask"
57 msgstr ""
58 "sched_setaffinity, sched_getaffinity - establece y obtiene la máscara de "
59 "afinidad de CPU de un proceso"
60
61 #. type: SH
62 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
63 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
64 #, no-wrap
65 msgid "LIBRARY"
66 msgstr "BIBLIOTECA"
67
68 #. type: Plain text
69 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
70 #: opensuse-leap-16-1 opensuse-tumbleweed
71 msgid "Standard C library (I<libc>,\\ I<-lc>)"
72 msgstr "Biblioteca Estándar C (I<libc>,\\ I<-lc>)"
73
74 #. type: SH
75 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
76 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
77 #, no-wrap
78 msgid "SYNOPSIS"
79 msgstr "SINOPSIS"
80
81 #. type: Plain text
82 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
83 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
84 #, no-wrap
85 msgid ""
86 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
87 "B<#include E<lt>sched.hE<gt>>\n"
88 msgstr ""
89 "B<#define _GNU_SOURCE> /* Vea feature_test_macros(7) */\n"
90 "B<#include E<lt>sched.hE<gt>>\n"
91
92 #. type: Plain text
93 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
94 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
95 #, fuzzy, no-wrap
96 #| msgid ""
97 #| "B<int sched_setaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
98 #| "B< const cpu_set_t *>I<mask>B<);>\n"
99 msgid ""
100 "B<int sched_setaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
101 "B< const cpu_set_t *>I<mask>B<);>\n"
102 "B<int sched_getaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
103 "B< cpu_set_t *>I<mask>B<);>\n"
104 msgstr ""
105 "B<int sched_setaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
106 "B< const cpu_set_t *>I<mask>B<);>\n"
107
108 #. type: SH
109 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
110 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
111 #, no-wrap
112 msgid "DESCRIPTION"
113 msgstr "DESCRIPCIÓN"
114
115 #. type: Plain text
116 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
117 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
118 msgid ""
119 "A thread's CPU affinity mask determines the set of CPUs on which it is "
120 "eligible to run. On a multiprocessor system, setting the CPU affinity mask "
121 "can be used to obtain performance benefits. For example, by dedicating one "
122 "CPU to a particular thread (i.e., setting the affinity mask of that thread "
123 "to specify a single CPU, and setting the affinity mask of all other threads "
124 "to exclude that CPU), it is possible to ensure maximum execution speed for "
125 "that thread. Restricting a thread to run on a single CPU also avoids the "
126 "performance cost caused by the cache invalidation that occurs when a thread "
127 "ceases to execute on one CPU and then recommences execution on a different "
128 "CPU."
129 msgstr ""
130
131 #. type: Plain text
132 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
133 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
134 msgid ""
135 "A CPU affinity mask is represented by the I<cpu_set_t> structure, a \"CPU "
136 "set\", pointed to by I<mask>. A set of macros for manipulating CPU sets is "
137 "described in B<CPU_SET>(3)."
138 msgstr ""
139
140 #. type: Plain text
141 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
142 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
143 msgid ""
144 "B<sched_setaffinity>() sets the CPU affinity mask of the thread whose ID is "
145 "I<pid> to the value specified by I<mask>. If I<pid> is zero, then the "
146 "calling thread is used. The argument I<cpusetsize> is the length (in bytes) "
147 "of the data pointed to by I<mask>. Normally this argument would be "
148 "specified as I<sizeof(cpu_set_t)>."
149 msgstr ""
150
151 #. type: Plain text
152 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
153 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
154 msgid ""
155 "If the thread specified by I<pid> is not currently running on one of the "
156 "CPUs specified in I<mask>, then that thread is migrated to one of the CPUs "
157 "specified in I<mask>."
158 msgstr ""
159
160 #. type: Plain text
161 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
162 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
163 #, fuzzy
164 #| msgid ""
165 #| "The function B<sched_getaffinity> writes into the pointer supplied by "
166 #| "I<mask> that is size I<len> the affinity mask of process I<pid>. If "
167 #| "I<pid> is zero, then the mask of the current process is returned."
168 msgid ""
169 "B<sched_getaffinity>() writes the affinity mask of the thread whose ID is "
170 "I<pid> into the I<cpu_set_t> structure pointed to by I<mask>. The "
171 "I<cpusetsize> argument specifies the size (in bytes) of I<mask>. If I<pid> "
172 "is zero, then the mask of the calling thread is returned."
173 msgstr ""
174 "La función B<sched_getaffinity> escribe en el puntero proporcionado en "
175 "I<mask>, cuyo tamaño es I<len>, la máscara de afinidad del proceso I<pid>. "
176 "Si I<pid> es cero, se devuelve la máscara del proceso en curso."
177
178 #. type: SH
179 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
180 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
181 #, no-wrap
182 msgid "RETURN VALUE"
183 msgstr "VALOR DEVUELTO"
184
185 #. type: Plain text
186 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
187 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
188 #, fuzzy
189 #| msgid ""
190 #| "On success, B<sched_setaffinity> and B<sched_getaffinity> both return 0. "
191 #| "On error, -1 is returned, and I<errno> is set appropriately."
192 msgid ""
193 "On success, B<sched_setaffinity>() and B<sched_getaffinity>() return 0 "
194 "(but see \"C library/kernel differences\" below, which notes that the "
195 "underlying B<sched_getaffinity>() differs in its return value). On "
196 "failure, -1 is returned, and I<errno> is set to indicate the error."
197 msgstr ""
198 "En caso de éxito,, B<sched_setaffinity> y B<sched_getaffinity> devuelven 0. "
199 "En caso de error, se devuelve -1, y se modifica I<errno> con el valor "
200 "apropiado."
201
202 #. type: SH
203 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
204 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
205 #, no-wrap
206 msgid "ERRORS"
207 msgstr "ERRORES"
208
209 #. type: TP
210 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
211 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
212 #, no-wrap
213 msgid "B<EFAULT>"
214 msgstr "B<EFAULT>"
215
216 #. type: Plain text
217 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
218 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
219 msgid "A supplied memory address was invalid."
220 msgstr "La dirección de memoria proporcionada no es válida."
221
222 #. type: TP
223 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
224 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
225 #, no-wrap
226 msgid "B<EINVAL>"
227 msgstr "B<EINVAL>"
228
229 #. type: Plain text
230 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
231 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
232 #, fuzzy
233 #| msgid ""
234 #| "The affinity bitmask I<mask> contains no processors that are physically "
235 #| "on the system or the length I<len> is smaller than the size of the "
236 #| "affinity mask used by the kernel."
237 msgid ""
238 "The affinity bit mask I<mask> contains no processors that are currently "
239 "physically on the system and permitted to the thread according to any "
240 "restrictions that may be imposed by I<cpuset> cgroups or the \"cpuset\" "
241 "mechanism described in B<cpuset>(7)."
242 msgstr ""
243 "La máscara de afinidad I<mask> no contiene procesadores que estén "
244 "físicamente en el sistema o la longitud I<len> es más pequeña que el tamaño "
245 "de la máscara de afinidad usada por el núcleo."
246
247 #. type: Plain text
248 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
249 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
250 #, fuzzy
251 #| msgid ""
252 #| "The affinity bitmask I<mask> contains no processors that are physically "
253 #| "on the system or the length I<len> is smaller than the size of the "
254 #| "affinity mask used by the kernel."
255 msgid ""
256 "(B<sched_getaffinity>() and, before Linux 2.6.9, B<sched_setaffinity>()) "
257 "I<cpusetsize> is smaller than the size of the affinity mask used by the "
258 "kernel."
259 msgstr ""
260 "La máscara de afinidad I<mask> no contiene procesadores que estén "
261 "físicamente en el sistema o la longitud I<len> es más pequeña que el tamaño "
262 "de la máscara de afinidad usada por el núcleo."
263
264 #. type: TP
265 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
266 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
267 #, no-wrap
268 msgid "B<EPERM>"
269 msgstr "B<EPERM>"
270
271 #. type: Plain text
272 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
273 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
274 #, fuzzy
275 #| msgid ""
276 #| "The calling process does not have appropriate privileges. The process "
277 #| "calling B<sched_setaffinity> needs an effective uid equal to the euid or "
278 #| "uid of the process identified by I<pid>, or it posses the I<CAP_SYS_NICE> "
279 #| "capability."
280 msgid ""
281 "(B<sched_setaffinity>()) The calling thread does not have appropriate "
282 "privileges. The caller needs an effective user ID equal to the real user ID "
283 "or effective user ID of the thread identified by I<pid>, or it must possess "
284 "the B<CAP_SYS_NICE> capability in the user namespace of the thread I<pid>."
285 msgstr ""
286 "El proceso invocador no tiene los privilegios apropiados. El proceso que "
287 "llama a B<sched_setaffinity> necesita que el identificador de usuario "
288 "efectivo sea igual al identificador de usuario real o efectivo del proceso "
289 "identificado por I<pid>, o poseer la capacidad I<CAP_SYS_NICE.>"
290
291 #. type: TP
292 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
293 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
294 #, no-wrap
295 msgid "B<ESRCH>"
296 msgstr "B<ESRCH>"
297
298 #. type: Plain text
299 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
300 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
301 #, fuzzy
302 #| msgid "The process whose ID is I<pid> could not be found."
303 msgid "The thread whose ID is I<pid> could not be found."
304 msgstr "No se puede encontrar un proceso con identificador I<pid>."
305
306 #. type: SH
307 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
308 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
309 #, no-wrap
310 msgid "STANDARDS"
311 msgstr "ESTÁNDARES"
312
313 #. type: Plain text
314 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
315 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
316 msgid "Linux."
317 msgstr "Linux."
318
319 #. type: SH
320 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
321 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
322 #, no-wrap
323 msgid "HISTORY"
324 msgstr "HISTORIAL"
325
326 #. type: Plain text
327 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
328 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
329 msgid "Linux 2.5.8, glibc 2.3."
330 msgstr ""
331
332 #. type: Plain text
333 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
334 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
335 msgid ""
336 "Initially, the glibc interfaces included a I<cpusetsize> argument, typed as "
337 "I<unsigned int>. In glibc 2.3.3, the I<cpusetsize> argument was removed, "
338 "but was then restored in glibc 2.3.4, with type I<size_t>."
339 msgstr ""
340
341 #. type: SH
342 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
343 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
344 #, no-wrap
345 msgid "NOTES"
346 msgstr "NOTAS"
347
348 #. type: Plain text
349 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
350 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
351 msgid ""
352 "After a call to B<sched_setaffinity>(), the set of CPUs on which the thread "
353 "will actually run is the intersection of the set specified in the I<mask> "
354 "argument and the set of CPUs actually present on the system. The system may "
355 "further restrict the set of CPUs on which the thread runs if the \"cpuset\" "
356 "mechanism described in B<cpuset>(7) is being used. These restrictions on "
357 "the actual set of CPUs on which the thread will run are silently imposed by "
358 "the kernel."
359 msgstr ""
360
361 #. type: Plain text
362 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
363 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
364 msgid ""
365 "There are various ways of determining the number of CPUs available on the "
366 "system, including: inspecting the contents of I</proc/cpuinfo>; using "
367 "B<sysconf>(3) to obtain the values of the B<_SC_NPROCESSORS_CONF> and "
368 "B<_SC_NPROCESSORS_ONLN> parameters; and inspecting the list of CPU "
369 "directories under I</sys/devices/system/cpu/>."
370 msgstr ""
371
372 #. type: Plain text
373 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
374 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
375 msgid "B<sched>(7) has a description of the Linux scheduling scheme."
376 msgstr ""
377 "B<sched>(7) contiene una descripción del esquema de planificación de Linux."
378
379 #. type: Plain text
380 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
381 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
382 msgid ""
383 "The affinity mask is a per-thread attribute that can be adjusted "
384 "independently for each of the threads in a thread group. The value returned "
385 "from a call to B<gettid>(2) can be passed in the argument I<pid>. "
386 "Specifying I<pid> as 0 will set the attribute for the calling thread, and "
387 "passing the value returned from a call to B<getpid>(2) will set the "
388 "attribute for the main thread of the thread group. (If you are using the "
389 "POSIX threads API, then use B<pthread_setaffinity_np>(3) instead of "
390 "B<sched_setaffinity>().)"
391 msgstr ""
392
393 #. type: Plain text
394 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
395 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
396 msgid ""
397 "The I<isolcpus> boot option can be used to isolate one or more CPUs at boot "
398 "time, so that no processes are scheduled onto those CPUs. Following the use "
399 "of this boot option, the only way to schedule processes onto the isolated "
400 "CPUs is via B<sched_setaffinity>() or the B<cpuset>(7) mechanism. For "
401 "further information, see the kernel source file I<Documentation/admin-guide/"
402 "kernel-parameters.txt>. As noted in that file, I<isolcpus> is the preferred "
403 "mechanism of isolating CPUs (versus the alternative of manually setting the "
404 "CPU affinity of all processes on the system)."
405 msgstr ""
406
407 #. type: Plain text
408 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
409 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
410 msgid ""
411 "A child created via B<fork>(2) inherits its parent's CPU affinity mask. "
412 "The affinity mask is preserved across an B<execve>(2)."
413 msgstr ""
414
415 #. type: SS
416 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
417 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
418 #, no-wrap
419 msgid "C library/kernel differences"
420 msgstr "Diferencias núcleo / biblioteca C"
421
422 #. type: Plain text
423 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
424 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
425 msgid ""
426 "This manual page describes the glibc interface for the CPU affinity calls. "
427 "The actual system call interface is slightly different, with the I<mask> "
428 "being typed as I<unsigned long\\ *>, reflecting the fact that the underlying "
429 "implementation of CPU sets is a simple bit mask."
430 msgstr ""
431
432 #. type: Plain text
433 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
434 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
435 msgid ""
436 "On success, the raw B<sched_getaffinity>() system call returns the number "
437 "of bytes placed copied into the I<mask> buffer; this will be the minimum of "
438 "I<cpusetsize> and the size (in bytes) of the I<cpumask_t> data type that is "
439 "used internally by the kernel to represent the CPU set bit mask."
440 msgstr ""
441
442 #. type: SS
443 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
444 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
445 #, no-wrap
446 msgid "Handling systems with large CPU affinity masks"
447 msgstr ""
448
449 #. FIXME . See https://sourceware.org/bugzilla/show_bug.cgi?id=15630
450 #. and https://sourceware.org/ml/libc-alpha/2013-07/msg00288.html
451 #. type: Plain text
452 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
453 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
454 msgid ""
455 "The underlying system calls (which represent CPU masks as bit masks of type "
456 "I<unsigned long\\ *>) impose no restriction on the size of the CPU mask. "
457 "However, the I<cpu_set_t> data type used by glibc has a fixed size of 128 "
458 "bytes, meaning that the maximum CPU number that can be represented is 1023. "
459 "If the kernel CPU affinity mask is larger than 1024, then calls of the form:"
460 msgstr ""
461
462 #. type: Plain text
463 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
464 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
465 #, fuzzy, no-wrap
466 #| msgid " sched_getaffinity(pid, sizeof(cpu_set_t), &mask);\n"
467 msgid "sched_getaffinity(pid, sizeof(cpu_set_t), &mask);\n"
468 msgstr " sched_getaffinity(pid, sizeof(cpu_set_t), &mask);\n"
469
470 #. type: Plain text
471 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
472 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
473 msgid ""
474 "fail with the error B<EINVAL>, the error produced by the underlying system "
475 "call for the case where the I<mask> size specified in I<cpusetsize> is "
476 "smaller than the size of the affinity mask used by the kernel. (Depending "
477 "on the system CPU topology, the kernel affinity mask can be substantially "
478 "larger than the number of active CPUs in the system.)"
479 msgstr ""
480
481 #. type: Plain text
482 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
483 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
484 msgid ""
485 "When working on systems with large kernel CPU affinity masks, one must "
486 "dynamically allocate the I<mask> argument (see B<CPU_ALLOC>(3)). Currently, "
487 "the only way to do this is by probing for the size of the required mask "
488 "using B<sched_getaffinity>() calls with increasing mask sizes (until the "
489 "call does not fail with the error B<EINVAL>)."
490 msgstr ""
491
492 #. type: Plain text
493 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
494 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
495 msgid ""
496 "Be aware that B<CPU_ALLOC>(3) may allocate a slightly larger CPU set than "
497 "requested (because CPU sets are implemented as bit masks allocated in units "
498 "of I<sizeof(long)>). Consequently, B<sched_getaffinity>() can set bits "
499 "beyond the requested allocation size, because the kernel sees a few "
500 "additional bits. Therefore, the caller should iterate over the bits in the "
501 "returned set, counting those which are set, and stop upon reaching the value "
502 "returned by B<CPU_COUNT>(3) (rather than iterating over the number of bits "
503 "requested to be allocated)."
504 msgstr ""
505
506 #. type: SH
507 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
508 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
509 #, no-wrap
510 msgid "EXAMPLES"
511 msgstr "EJEMPLOS"
512
513 #. type: Plain text
514 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
515 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
516 msgid ""
517 "The program below creates a child process. The parent and child then each "
518 "assign themselves to a specified CPU and execute identical loops that "
519 "consume some CPU time. Before terminating, the parent waits for the child "
520 "to complete. The program takes three command-line arguments: the CPU number "
521 "for the parent, the CPU number for the child, and the number of loop "
522 "iterations that both processes should perform."
523 msgstr ""
524
525 #. type: Plain text
526 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
527 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
528 msgid ""
529 "As the sample runs below demonstrate, the amount of real and CPU time "
530 "consumed when running the program will depend on intra-core caching effects "
531 "and whether the processes are using the same CPU."
532 msgstr ""
533
534 #. type: Plain text
535 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
536 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
537 msgid ""
538 "We first employ B<lscpu>(1) to determine that this (x86) system has two "
539 "cores, each with two CPUs:"
540 msgstr ""
541
542 #. type: Plain text
543 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
544 #: opensuse-tumbleweed
545 #, no-wrap
546 msgid ""
547 "$B< lscpu | egrep -i \\[aq]core.*:|socket\\[aq]>;\n"
548 "Thread(s) per core: 2\n"
549 "Core(s) per socket: 2\n"
550 "Socket(s): 1\n"
551 msgstr ""
552
553 #. type: Plain text
554 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
555 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
556 msgid ""
557 "We then time the operation of the example program for three cases: both "
558 "processes running on the same CPU; both processes running on different CPUs "
559 "on the same core; and both processes running on different CPUs on different "
560 "cores."
561 msgstr ""
562
563 #. type: Plain text
564 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
565 #: opensuse-tumbleweed
566 #, no-wrap
567 msgid ""
568 "$B< time -p ./a.out 0 0 100000000>;\n"
569 "real 14.75\n"
570 "user 3.02\n"
571 "sys 11.73\n"
572 "$B< time -p ./a.out 0 1 100000000>;\n"
573 "real 11.52\n"
574 "user 3.98\n"
575 "sys 19.06\n"
576 "$B< time -p ./a.out 0 3 100000000>;\n"
577 "real 7.89\n"
578 "user 3.29\n"
579 "sys 12.07\n"
580 msgstr ""
581
582 #. type: SS
583 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
584 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
585 #, no-wrap
586 msgid "Program source"
587 msgstr "Código fuente"
588
589 #. type: Plain text
590 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
591 #: opensuse-tumbleweed
592 #, no-wrap
593 msgid ""
594 "#define _GNU_SOURCE\n"
595 "#include E<lt>err.hE<gt>\n"
596 "#include E<lt>sched.hE<gt>\n"
597 "#include E<lt>stdio.hE<gt>\n"
598 "#include E<lt>stdlib.hE<gt>\n"
599 "#include E<lt>sys/wait.hE<gt>\n"
600 "#include E<lt>unistd.hE<gt>\n"
601 "\\&\n"
602 "int\n"
603 "main(int argc, char *argv[])\n"
604 "{\n"
605 " int parentCPU, childCPU;\n"
606 " cpu_set_t set;\n"
607 " unsigned int nloops;\n"
608 "\\&\n"
609 " if (argc != 4) {\n"
610 " fprintf(stderr, \"Usage: %s parent-cpu child-cpu num-loops\\[rs]n\",\n"
611 " argv[0]);\n"
612 " exit(EXIT_FAILURE);\n"
613 " }\n"
614 "\\&\n"
615 " parentCPU = atoi(argv[1]);\n"
616 " childCPU = atoi(argv[2]);\n"
617 " nloops = atoi(argv[3]);\n"
618 "\\&\n"
619 " CPU_ZERO(&set);\n"
620 "\\&\n"
621 " switch (fork()) {\n"
622 " case -1: /* Error */\n"
623 " err(EXIT_FAILURE, \"fork\");\n"
624 "\\&\n"
625 " case 0: /* Child */\n"
626 " CPU_SET(childCPU, &set);\n"
627 "\\&\n"
628 " if (sched_setaffinity(0, sizeof(set), &set) == -1)\n"
629 " err(EXIT_FAILURE, \"sched_setaffinity\");\n"
630 "\\&\n"
631 " for (unsigned int j = 0; j E<lt> nloops; j++)\n"
632 " getppid();\n"
633 "\\&\n"
634 " exit(EXIT_SUCCESS);\n"
635 "\\&\n"
636 " default: /* Parent */\n"
637 " CPU_SET(parentCPU, &set);\n"
638 "\\&\n"
639 " if (sched_setaffinity(0, sizeof(set), &set) == -1)\n"
640 " err(EXIT_FAILURE, \"sched_setaffinity\");\n"
641 "\\&\n"
642 " for (unsigned int j = 0; j E<lt> nloops; j++)\n"
643 " getppid();\n"
644 "\\&\n"
645 " wait(NULL); /* Wait for child to terminate */\n"
646 " exit(EXIT_SUCCESS);\n"
647 " }\n"
648 "}\n"
649 msgstr ""
650
651 #. SRC END
652 #. type: SH
653 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
654 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
655 #, no-wrap
656 msgid "SEE ALSO"
657 msgstr "VÉASE TAMBIÉN"
658
659 #. type: Plain text
660 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
661 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
662 msgid ""
663 "B<lscpu>(1), B<nproc>(1), B<taskset>(1), B<clone>(2), B<getcpu>(2), "
664 "B<getpriority>(2), B<gettid>(2), B<nice>(2), B<sched_get_priority_max>(2), "
665 "B<sched_get_priority_min>(2), B<sched_getscheduler>(2), "
666 "B<sched_setscheduler>(2), B<setpriority>(2), B<CPU_SET>(3), "
667 "B<get_nprocs>(3), B<pthread_setaffinity_np>(3), B<sched_getcpu>(3), "
668 "B<capabilities>(7), B<cpuset>(7), B<sched>(7), B<numactl>(8)"
669 msgstr ""
670 "B<lscpu>(1), B<nproc>(1), B<taskset>(1), B<clone>(2), B<getcpu>(2), "
671 "B<getpriority>(2), B<gettid>(2), B<nice>(2), B<sched_get_priority_max>(2), "
672 "B<sched_get_priority_min>(2), B<sched_getscheduler>(2), "
673 "B<sched_setscheduler>(2), B<setpriority>(2), B<CPU_SET>(3), "
674 "B<get_nprocs>(3), B<pthread_setaffinity_np>(3), B<sched_getcpu>(3), "
675 "B<capabilities>(7), B<cpuset>(7), B<sched>(7), B<numactl>(8)"
676
677 #. type: TH
678 #: debian-trixie
679 #, no-wrap
680 msgid "2024-06-15"
681 msgstr "15 Junio 2024"
682
683 #. type: TH
684 #: debian-trixie
685 #, no-wrap
686 msgid "Linux man-pages 6.9.1"
687 msgstr "Páginas de Manual de Linux 6.9.1"
688
689 #. type: Plain text
690 #: debian-trixie
691 msgid "Standard C library (I<libc>, I<-lc>)"
692 msgstr "Biblioteca Estándar C (I<libc>, I<-lc>)"
693
694 #. type: Plain text
695 #: debian-trixie fedora-44 fedora-rawhide
696 #, no-wrap
697 msgid ""
698 "$ B<lscpu | egrep -i \\[aq]core.*:|socket\\[aq]>\n"
699 "Thread(s) per core: 2\n"
700 "Core(s) per socket: 2\n"
701 "Socket(s): 1\n"
702 msgstr ""
703
704 #. type: Plain text
705 #: debian-trixie fedora-44 fedora-rawhide
706 #, no-wrap
707 msgid ""
708 "$ B<time -p ./a.out 0 0 100000000>\n"
709 "real 14.75\n"
710 "user 3.02\n"
711 "sys 11.73\n"
712 "$ B<time -p ./a.out 0 1 100000000>\n"
713 "real 11.52\n"
714 "user 3.98\n"
715 "sys 19.06\n"
716 "$ B<time -p ./a.out 0 3 100000000>\n"
717 "real 7.89\n"
718 "user 3.29\n"
719 "sys 12.07\n"
720 msgstr ""
721
722 #. type: Plain text
723 #: debian-trixie fedora-44 fedora-rawhide
724 #, no-wrap
725 msgid ""
726 "#define _GNU_SOURCE\n"
727 "#include E<lt>err.hE<gt>\n"
728 "#include E<lt>sched.hE<gt>\n"
729 "#include E<lt>stdio.hE<gt>\n"
730 "#include E<lt>stdlib.hE<gt>\n"
731 "#include E<lt>sys/wait.hE<gt>\n"
732 "#include E<lt>unistd.hE<gt>\n"
733 "\\&\n"
734 "int\n"
735 "main(int argc, char *argv[])\n"
736 "{\n"
737 " int parentCPU, childCPU;\n"
738 " cpu_set_t set;\n"
739 " unsigned int nloops;\n"
740 "\\&\n"
741 " if (argc != 4) {\n"
742 " fprintf(stderr, \"Usage: %s parent-cpu child-cpu num-loops\\[rs]n\",\n"
743 " argv[0]);\n"
744 " exit(EXIT_FAILURE);\n"
745 " }\n"
746 "\\&\n"
747 " parentCPU = atoi(argv[1]);\n"
748 " childCPU = atoi(argv[2]);\n"
749 " nloops = atoi(argv[3]);\n"
750 "\\&\n"
751 " CPU_ZERO(&set);\n"
752 "\\&\n"
753 " switch (fork()) {\n"
754 " case -1: /* Error */\n"
755 " err(EXIT_FAILURE, \"fork\");\n"
756 "\\&\n"
757 " case 0: /* Child */\n"
758 " CPU_SET(childCPU, &set);\n"
759 "\\&\n"
760 " if (sched_setaffinity(getpid(), sizeof(set), &set) == -1)\n"
761 " err(EXIT_FAILURE, \"sched_setaffinity\");\n"
762 "\\&\n"
763 " for (unsigned int j = 0; j E<lt> nloops; j++)\n"
764 " getppid();\n"
765 "\\&\n"
766 " exit(EXIT_SUCCESS);\n"
767 "\\&\n"
768 " default: /* Parent */\n"
769 " CPU_SET(parentCPU, &set);\n"
770 "\\&\n"
771 " if (sched_setaffinity(getpid(), sizeof(set), &set) == -1)\n"
772 " err(EXIT_FAILURE, \"sched_setaffinity\");\n"
773 "\\&\n"
774 " for (unsigned int j = 0; j E<lt> nloops; j++)\n"
775 " getppid();\n"
776 "\\&\n"
777 " wait(NULL); /* Wait for child to terminate */\n"
778 " exit(EXIT_SUCCESS);\n"
779 " }\n"
780 "}\n"
781 msgstr ""
782
783 #. type: TH
784 #: fedora-44 fedora-rawhide
785 #, no-wrap
786 msgid "2024-07-23"
787 msgstr "23 ​​Julio 2024"
788
789 #. type: TH
790 #: fedora-44 fedora-rawhide
791 #, no-wrap
792 msgid "Linux man-pages 6.13"
793 msgstr "Páginas de Manual de Linux 6.13"
794
795 #. type: TH
796 #: mageia-cauldron
797 #, no-wrap
798 msgid "Linux man-pages 6.17"
799 msgstr "Páginas de Manual de Linux 6.17"
800
801 #. type: TH
802 #: opensuse-leap-16-1 opensuse-tumbleweed
803 #, no-wrap
804 msgid "Linux man-pages (unreleased)"
805 msgstr "Páginas de Manual de Linux (no publicadas)"