Debian Codegraph @

po/pl/man2/sched_setaffinity.2.po

raw
1 # Polish translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Michał Kułach <[email protected]>, 2026.
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: manpages-l10n 4.29.1\n"
8 "POT-Creation-Date: 2026-06-05 06:42+0200\n"
9 "PO-Revision-Date: 2026-02-15 13:14+0100\n"
10 "Last-Translator: Michał Kułach <[email protected]>\n"
11 "Language-Team: Polish <[email protected]>\n"
12 "Language: pl\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=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
17 "|| n%100>=20) ? 1 : 2);\n"
18 "X-Generator: Lokalize 25.04.0\n"
19
20 #. type: TH
21 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
22 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
23 #, no-wrap
24 msgid "sched_setaffinity"
25 msgstr "sched_setaffinity"
26
27 #. type: TH
28 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
29 #: opensuse-tumbleweed
30 #, no-wrap
31 msgid "2026-02-08"
32 msgstr "8 lutego 2026 r."
33
34 #. type: TH
35 #: archlinux debian-unstable
36 #, no-wrap
37 msgid "Linux man-pages 6.18"
38 msgstr "Linux man-pages 6.18"
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 "NAZWA"
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 msgid ""
51 "sched_setaffinity, sched_getaffinity - set and get a thread's CPU affinity "
52 "mask"
53 msgstr ""
54 "sched_setaffinity, sched_getaffinity - ustawia i pobiera maskę koligacji "
55 "procesora dla wątku"
56
57 #. type: SH
58 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
59 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
60 #, no-wrap
61 msgid "LIBRARY"
62 msgstr "BIBLIOTEKA"
63
64 #. type: Plain text
65 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
66 #: opensuse-leap-16-1 opensuse-tumbleweed
67 msgid "Standard C library (I<libc>,\\ I<-lc>)"
68 msgstr "Standardowa biblioteka C (I<libc>,\\ I<-lc>)"
69
70 #. type: SH
71 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
72 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
73 #, no-wrap
74 msgid "SYNOPSIS"
75 msgstr "SKŁADNIA"
76
77 #. type: Plain text
78 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
79 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
80 #, no-wrap
81 msgid ""
82 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
83 "B<#include E<lt>sched.hE<gt>>\n"
84 msgstr ""
85 "B<#define _GNU_SOURCE> /* Patrz feature_test_macros(7) */\n"
86 "B<#include E<lt>sched.hE<gt>>\n"
87
88 #. type: Plain text
89 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
90 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
91 #, no-wrap
92 msgid ""
93 "B<int sched_setaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
94 "B< const cpu_set_t *>I<mask>B<);>\n"
95 "B<int sched_getaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
96 "B< cpu_set_t *>I<mask>B<);>\n"
97 msgstr ""
98 "B<int sched_setaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
99 "B< const cpu_set_t *>I<mask>B<);>\n"
100 "B<int sched_getaffinity(pid_t >I<pid>B<, size_t >I<cpusetsize>B<,>\n"
101 "B< cpu_set_t *>I<mask>B<);>\n"
102
103 #. type: SH
104 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
105 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
106 #, no-wrap
107 msgid "DESCRIPTION"
108 msgstr "OPIS"
109
110 #. type: Plain text
111 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
112 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
113 msgid ""
114 "A thread's CPU affinity mask determines the set of CPUs on which it is "
115 "eligible to run. On a multiprocessor system, setting the CPU affinity mask "
116 "can be used to obtain performance benefits. For example, by dedicating one "
117 "CPU to a particular thread (i.e., setting the affinity mask of that thread "
118 "to specify a single CPU, and setting the affinity mask of all other threads "
119 "to exclude that CPU), it is possible to ensure maximum execution speed for "
120 "that thread. Restricting a thread to run on a single CPU also avoids the "
121 "performance cost caused by the cache invalidation that occurs when a thread "
122 "ceases to execute on one CPU and then recommences execution on a different "
123 "CPU."
124 msgstr ""
125 "Maska koligacji procesora wątku określa zbiór procesorów, na których może on "
126 "działać. W systemach wieloprocesorowych ustawiając maskę koligacji procesora "
127 "można, w określonych sytuacjach, zyskać na wydajności. Na przykład "
128 "przeznaczając jeden procesor na dany wątek (tj. ustawiając maskę koligacji "
129 "tego wątku tak, aby określała pojedynczy procesor i ustawiając maskę "
130 "koligacji wszystkich innych wątków tak, aby pomijała ten procesor) można "
131 "zapewnić maksymalną szybkość wykonywania danego wątku. Ograniczenie "
132 "możliwości działania wątku do pojedynczego procesora pozwala też na "
133 "uniknięcie narzutu wynikającego z unieważniania bufora zachodzącego, gdy "
134 "wątek przestaje być wykonywany na jednym procesorze, a następnie wznawia "
135 "wykonywanie na kolejnym."
136
137 #. type: Plain text
138 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
139 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
140 msgid ""
141 "A CPU affinity mask is represented by the I<cpu_set_t> structure, a \"CPU "
142 "set\", pointed to by I<mask>. A set of macros for manipulating CPU sets is "
143 "described in B<CPU_SET>(3)."
144 msgstr ""
145 "Maska koligacji procesora jest reprezentowana przez strukturę I<cpu_set_t>, "
146 "\\[Bq]zbiór procesorów\\[rq], na którą wskazuje I<mask>. Zbiór makr do "
147 "operowania na zbiorach procesorów opisano w podręczniku B<CPU_SET>(3)."
148
149 #. type: Plain text
150 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
151 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
152 msgid ""
153 "B<sched_setaffinity>() sets the CPU affinity mask of the thread whose ID is "
154 "I<pid> to the value specified by I<mask>. If I<pid> is zero, then the "
155 "calling thread is used. The argument I<cpusetsize> is the length (in bytes) "
156 "of the data pointed to by I<mask>. Normally this argument would be "
157 "specified as I<sizeof(cpu_set_t)>."
158 msgstr ""
159 "B<sched_setaffinity>() ustawia maskę koligacji procesora wątku o "
160 "identyfikatorze I<pid>, na wartość określoną przez I<mask>. Jeśli I<pid> "
161 "wynosi zero, używany jest wątek wywołujący. Argument I<cpusetsize> jest "
162 "długością (w bajtach) danych, na które wskazuje I<mask>. Argument ten zwykle "
163 "należy podać jako I<sizeof(cpu_set_t)>."
164
165 #. type: Plain text
166 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
167 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
168 msgid ""
169 "If the thread specified by I<pid> is not currently running on one of the "
170 "CPUs specified in I<mask>, then that thread is migrated to one of the CPUs "
171 "specified in I<mask>."
172 msgstr ""
173 "Jeśli wątek podany w I<pid> nie działa obecnie na jednym z procesorów "
174 "określonych w I<mask>, to wątek ten zostanie zmigrowany na jeden z "
175 "procesorów określonych w I<mask>."
176
177 #. type: Plain text
178 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
179 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
180 msgid ""
181 "B<sched_getaffinity>() writes the affinity mask of the thread whose ID is "
182 "I<pid> into the I<cpu_set_t> structure pointed to by I<mask>. The "
183 "I<cpusetsize> argument specifies the size (in bytes) of I<mask>. If I<pid> "
184 "is zero, then the mask of the calling thread is returned."
185 msgstr ""
186 "B<sched_getaffinity>() zapisuje maskę koligacji procesora wątku o "
187 "identyfikatorze I<pid> do struktury I<cpu_set_t>, na którą wskazuje I<mask>. "
188 "Argument I<cpusetsize> określa rozmiar I<mask> (w bajtach). Jeśli I<pid> "
189 "wynosi zero, wywołanie zwraca maskę wątku wywołującego."
190
191 #. type: SH
192 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
193 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
194 #, no-wrap
195 msgid "RETURN VALUE"
196 msgstr "WARTOŚĆ ZWRACANA"
197
198 #. type: Plain text
199 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
200 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
201 msgid ""
202 "On success, B<sched_setaffinity>() and B<sched_getaffinity>() return 0 "
203 "(but see \"C library/kernel differences\" below, which notes that the "
204 "underlying B<sched_getaffinity>() differs in its return value). On "
205 "failure, -1 is returned, and I<errno> is set to indicate the error."
206 msgstr ""
207 "W przypadku powodzenia, B<sched_setaffinity>() i B<sched_getaffinity>() "
208 "zwracają 0 (lecz zob. \\[Bq]Różnice biblioteki C/jądra\\[rq] poniżej, gdzie "
209 "opisano różnice w zwracanej wartości w podległym B<sched_getaffinity>()). W "
210 "razie wystąpienia błędu zwracane jest -1 i ustawiane I<errno>, wskazując "
211 "błąd."
212
213 #. type: SH
214 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
215 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
216 #, no-wrap
217 msgid "ERRORS"
218 msgstr "BŁĘDY"
219
220 #. type: TP
221 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
222 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
223 #, no-wrap
224 msgid "B<EFAULT>"
225 msgstr "B<EFAULT>"
226
227 #. type: Plain text
228 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
229 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
230 msgid "A supplied memory address was invalid."
231 msgstr "Podany adres pamięci był nieprawidłowy."
232
233 #. type: TP
234 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
235 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
236 #, no-wrap
237 msgid "B<EINVAL>"
238 msgstr "B<EINVAL>"
239
240 #. type: Plain text
241 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
242 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
243 msgid ""
244 "The affinity bit mask I<mask> contains no processors that are currently "
245 "physically on the system and permitted to the thread according to any "
246 "restrictions that may be imposed by I<cpuset> cgroups or the \"cpuset\" "
247 "mechanism described in B<cpuset>(7)."
248 msgstr ""
249 "Maska bitowa koligacji I<mask> nie zawierała żadnego procesora obecnego "
250 "fizycznie w systemie, który jest jednocześnie dozwolony do użycia przez "
251 "wątek, biorąc pod uwagę wszelkie ograniczenia, jakie mogą wynikać z grup "
252 "kontrolnych I<cpuset> i mechanizmu \\[Bq]cpuset\\[rq] opisanego w "
253 "podręczniku B<cpuset>(7)."
254
255 #. type: Plain text
256 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
257 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
258 msgid ""
259 "(B<sched_getaffinity>() and, before Linux 2.6.9, B<sched_setaffinity>()) "
260 "I<cpusetsize> is smaller than the size of the affinity mask used by the "
261 "kernel."
262 msgstr ""
263 "(B<sched_getaffinity>() i, przed Linuksem 2.6.9, B<sched_setaffinity>()) "
264 "I<cpusetsize> jest mniejszy od rozmiaru maski koligacji używanego przez "
265 "jądro."
266
267 #. type: TP
268 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
269 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
270 #, no-wrap
271 msgid "B<EPERM>"
272 msgstr "B<EPERM>"
273
274 #. type: Plain text
275 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
276 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
277 msgid ""
278 "(B<sched_setaffinity>()) The calling thread does not have appropriate "
279 "privileges. The caller needs an effective user ID equal to the real user ID "
280 "or effective user ID of the thread identified by I<pid>, or it must possess "
281 "the B<CAP_SYS_NICE> capability in the user namespace of the thread I<pid>."
282 msgstr ""
283 "(B<sched_setaffinity>()) Wątek wywołujący nie ma odpowiednich przywilejów. "
284 "Wywołujący musi mieć efektywny identyfikator użytkownika równy rzeczywistemu "
285 "identyfikatorowi użytkownika albo efektywnemu identyfikatorowi użytkownika "
286 "wątku podanego w I<pid>, albo musi posiadać przywilej B<CAP_SYS_NICE> w "
287 "przestrzeni nazw użytkownika wątku podanego w I<pid>."
288
289 #. type: TP
290 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
291 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
292 #, no-wrap
293 msgid "B<ESRCH>"
294 msgstr "B<ESRCH>"
295
296 #. type: Plain text
297 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
298 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
299 msgid "The thread whose ID is I<pid> could not be found."
300 msgstr "Nie znaleziono wątku o identyfikatorze równym I<pid>."
301
302 #. type: SH
303 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
304 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
305 #, no-wrap
306 msgid "STANDARDS"
307 msgstr "STANDARDY"
308
309 #. type: Plain text
310 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
311 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
312 msgid "Linux."
313 msgstr "Linux."
314
315 #. type: SH
316 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
317 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
318 #, no-wrap
319 msgid "HISTORY"
320 msgstr "HISTORIA"
321
322 #. type: Plain text
323 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
324 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
325 msgid "Linux 2.5.8, glibc 2.3."
326 msgstr "Linux 2.5.8, glibc 2.3."
327
328 #. type: Plain text
329 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
330 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
331 msgid ""
332 "Initially, the glibc interfaces included a I<cpusetsize> argument, typed as "
333 "I<unsigned int>. In glibc 2.3.3, the I<cpusetsize> argument was removed, "
334 "but was then restored in glibc 2.3.4, with type I<size_t>."
335 msgstr ""
336 "Początkowo, intefejsy glibc ujęte w argumencie I<cpusetsize> były typu "
337 "I<unsigned int>. W glibc 2.3.3, usunięto argument I<cpusetsize>, jednak "
338 "przywrócono go w glibc 2.3.4, tym razem jako I<size_t>."
339
340 #. type: SH
341 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
342 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
343 #, no-wrap
344 msgid "NOTES"
345 msgstr "UWAGI"
346
347 #. type: Plain text
348 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
349 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
350 msgid ""
351 "After a call to B<sched_setaffinity>(), the set of CPUs on which the thread "
352 "will actually run is the intersection of the set specified in the I<mask> "
353 "argument and the set of CPUs actually present on the system. The system may "
354 "further restrict the set of CPUs on which the thread runs if the \"cpuset\" "
355 "mechanism described in B<cpuset>(7) is being used. These restrictions on "
356 "the actual set of CPUs on which the thread will run are silently imposed by "
357 "the kernel."
358 msgstr ""
359 "Po wywołaniu do B<sched_setaffinity>(), zbiór procesorów, na których wątek "
360 "faktycznie będzie uruchomiony, jest iloczynem zbioru podanego w argumencie "
361 "I<mask> oraz zbioru procesorów faktycznie obecnych w systemie. System może "
362 "dodatkowo ograniczyć zbiór procesorów, na których działa wątek, jeśli "
363 "używany jest mechanizm \\[Bq]cpuset\\[rq] opisany w podręczniku "
364 "B<cpuset>(7). Ograniczenia te, dotyczące faktycznego zbioru procesorów, na "
365 "których wątek będzie działał, są ezgekwowane po cichu przez jądro."
366
367 #. type: Plain text
368 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
369 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
370 msgid ""
371 "There are various ways of determining the number of CPUs available on the "
372 "system, including: inspecting the contents of I</proc/cpuinfo>; using "
373 "B<sysconf>(3) to obtain the values of the B<_SC_NPROCESSORS_CONF> and "
374 "B<_SC_NPROCESSORS_ONLN> parameters; and inspecting the list of CPU "
375 "directories under I</sys/devices/system/cpu/>."
376 msgstr ""
377 "Istnieje wiele sposobów na sprawdzenie liczby procesorów dostępnych w "
378 "systemie, w tym: sprawdzenie zawartości I</proc/cpuinfo>; skorzystanie z "
379 "B<sysconf>(3) do pozyskania wartości parametrów B<_SC_NPROCESSORS_CONF> i "
380 "B<_SC_NPROCESSORS_ONLN> oraz sprawdzenie listy katalogów procesorów w I</"
381 "sys/devices/system/cpu/>."
382
383 #. type: Plain text
384 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
385 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
386 msgid "B<sched>(7) has a description of the Linux scheduling scheme."
387 msgstr "Podręcznik B<sched>(7) zawiera opis szeregowania zadań w Linuksie."
388
389 #. type: Plain text
390 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
391 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
392 msgid ""
393 "The affinity mask is a per-thread attribute that can be adjusted "
394 "independently for each of the threads in a thread group. The value returned "
395 "from a call to B<gettid>(2) can be passed in the argument I<pid>. "
396 "Specifying I<pid> as 0 will set the attribute for the calling thread, and "
397 "passing the value returned from a call to B<getpid>(2) will set the "
398 "attribute for the main thread of the thread group. (If you are using the "
399 "POSIX threads API, then use B<pthread_setaffinity_np>(3) instead of "
400 "B<sched_setaffinity>().)"
401 msgstr ""
402 "Maska koligacji procesora jest atrybutem przynależnym wątkowi, który można "
403 "dostosować niezależnie dla każdego wątku w grupie wątków. Wartość zwracaną z "
404 "wywołania do B<gettid>(2) można przekazać w argumencie I<pid>. Określenie "
405 "I<pid> jako 0 ustawi atrybut wątku wywołującego, a przekazanie wartości "
406 "zwróconej z wywołania do B<getpid>(2) ustawi atrybut głównego wątku w grupie "
407 "wątków. Jeśli korzysta się z interfejsu wątków POSIX, zamiast "
408 "B<sched_setaffinity>() należy stosować B<pthread_setaffinity_np>(3)."
409
410 #. type: Plain text
411 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
412 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
413 msgid ""
414 "The I<isolcpus> boot option can be used to isolate one or more CPUs at boot "
415 "time, so that no processes are scheduled onto those CPUs. Following the use "
416 "of this boot option, the only way to schedule processes onto the isolated "
417 "CPUs is via B<sched_setaffinity>() or the B<cpuset>(7) mechanism. For "
418 "further information, see the kernel source file I<Documentation/admin-guide/"
419 "kernel-parameters.txt>. As noted in that file, I<isolcpus> is the preferred "
420 "mechanism of isolating CPUs (versus the alternative of manually setting the "
421 "CPU affinity of all processes on the system)."
422 msgstr ""
423 "Za pomocą opcji rozruchowej I<isolcpus> można wyizolować jeden lub więcej "
424 "procesorów przy rozruchu, dzięki czemu żadne procesy nie zostaną na nich "
425 "uruchomione. Po zastosowaniu tej opcji rozruchowej, jedynym sposobem "
426 "przydzielenia wątków na wyizolowane procesory jest mechanizm B<cpuset>(7) "
427 "lub B<sched_setaffinity>(). Więcej informacji znajduje się w pliku "
428 "I<Documentation/admin-guide/kernel-parameters.txt> w źródłach jądra. Jak "
429 "wskazano w tym pliku, preferowanym sposobem izolowania procesorów jest "
430 "I<isolcpus> (w porównaniu do alternatywy, w postaci ręcznego ustawiania "
431 "koligacji procesorów dla wszystkich procesów w systemie)."
432
433 #. type: Plain text
434 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
435 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
436 msgid ""
437 "A child created via B<fork>(2) inherits its parent's CPU affinity mask. "
438 "The affinity mask is preserved across an B<execve>(2)."
439 msgstr ""
440 "Potomek utworzony za pomocą B<fork>(2) dziedziczy maskę koligacji procesora "
441 "swojego rodzica. Maska koligacji jest zachowywana poprzez B<execve>(2)."
442
443 #. type: SS
444 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
445 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
446 #, no-wrap
447 msgid "C library/kernel differences"
448 msgstr "Różnice biblioteki C/jądra"
449
450 #. type: Plain text
451 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
452 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
453 msgid ""
454 "This manual page describes the glibc interface for the CPU affinity calls. "
455 "The actual system call interface is slightly different, with the I<mask> "
456 "being typed as I<unsigned long\\ *>, reflecting the fact that the underlying "
457 "implementation of CPU sets is a simple bit mask."
458 msgstr ""
459 "Niniejszy podręcznik opisuje interfejs glibc wywołań koligacji procesora. "
460 "Rzeczywisty interfejs wywołania systemowego jest nieco odmienny, ponieważ "
461 "I<mask> jest typu I<unsigned long\\ *>, odzwierciedlając fakt, że podległa "
462 "implementacja zbiorów procesorów jest prostą maską bitową."
463
464 #. type: Plain text
465 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
466 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
467 msgid ""
468 "On success, the raw B<sched_getaffinity>() system call returns the number "
469 "of bytes placed copied into the I<mask> buffer; this will be the minimum of "
470 "I<cpusetsize> and the size (in bytes) of the I<cpumask_t> data type that is "
471 "used internally by the kernel to represent the CPU set bit mask."
472 msgstr ""
473 "W przypadku powodzenia, surowe wywołanie systemowe B<sched_getaffinity>() "
474 "zwraca liczbę umieszczonych bajtów, skopiowanych do bufora I<mask>; będzie "
475 "to mniejsza z: I<cpusetsize> oraz rozmiaru (w bajtach) typu danych "
476 "I<cpumask_t>, który służy wewnętrznie w jądrze do reprezentacji maski "
477 "bitowej zbioru procesorów."
478
479 #. type: SS
480 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
481 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
482 #, no-wrap
483 msgid "Handling systems with large CPU affinity masks"
484 msgstr "Obsługa systemów z dużymi maskami koligacji procesora"
485
486 #. FIXME . See https://sourceware.org/bugzilla/show_bug.cgi?id=15630
487 #. and https://sourceware.org/ml/libc-alpha/2013-07/msg00288.html
488 #. type: Plain text
489 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
490 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
491 msgid ""
492 "The underlying system calls (which represent CPU masks as bit masks of type "
493 "I<unsigned long\\ *>) impose no restriction on the size of the CPU mask. "
494 "However, the I<cpu_set_t> data type used by glibc has a fixed size of 128 "
495 "bytes, meaning that the maximum CPU number that can be represented is 1023. "
496 "If the kernel CPU affinity mask is larger than 1024, then calls of the form:"
497 msgstr ""
498 "Podległe wywołanie systemowe (reprezentujące maski procesorów jako maski "
499 "bitowe typu I<unsigned long\\ *>) nie nakładają ograniczeń na rozmiar masek "
500 "procesorów. Jednak typ danych I<cpu_set_t> używany przez bibliotekę glibc ma "
501 "stały rozmiar 128 bajtów co oznacza, że maksymalny numer procesora jaki może "
502 "odwzorować to 1023. Jeśli maska koligacji procesora jest większa niż 1024, "
503 "wywołanie w postaci:"
504
505 #. type: Plain text
506 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
507 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
508 #, no-wrap
509 msgid "sched_getaffinity(pid, sizeof(cpu_set_t), &mask);\n"
510 msgstr "sched_getaffinity(pid, sizeof(cpu_set_t), &mask);\n"
511
512 #. type: Plain text
513 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
514 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
515 msgid ""
516 "fail with the error B<EINVAL>, the error produced by the underlying system "
517 "call for the case where the I<mask> size specified in I<cpusetsize> is "
518 "smaller than the size of the affinity mask used by the kernel. (Depending "
519 "on the system CPU topology, the kernel affinity mask can be substantially "
520 "larger than the number of active CPUs in the system.)"
521 msgstr ""
522 "zawiedzie z błędem B<EINVAL>, błędem z poziomu podległego wywołania "
523 "systemowego stosowanym w przypadku, gdy rozmiar I<mask> podany w "
524 "I<cpusetsize> jest mniejszy od rozmiaru maski koligacji używanego przez "
525 "jądro (w zależności od systemowej topologii procesorów, maska koligacji "
526 "jądra może być znacznie większa od liczby aktywnych procesorów w systemie)."
527
528 #. type: Plain text
529 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
530 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
531 msgid ""
532 "When working on systems with large kernel CPU affinity masks, one must "
533 "dynamically allocate the I<mask> argument (see B<CPU_ALLOC>(3)). Currently, "
534 "the only way to do this is by probing for the size of the required mask "
535 "using B<sched_getaffinity>() calls with increasing mask sizes (until the "
536 "call does not fail with the error B<EINVAL>)."
537 msgstr ""
538 "Przy pracy w systemach o dużych maskach koligacji procesora w jądrze, należy "
539 "dynamicznie przydzielać argument I<mask> (zob. B<CPU_ALLOC>(3)). Obecnie, "
540 "jedynym sposobem na to, jest sprawdzenie rozmiaru wymaganej maski za pomocą "
541 "wywołań B<sched_getaffinity>() o coraz większych rozmiarach masek (do "
542 "momentu zwrócenia przez wywołanie błędu B<EINVAL>)."
543
544 #. type: Plain text
545 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
546 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
547 msgid ""
548 "Be aware that B<CPU_ALLOC>(3) may allocate a slightly larger CPU set than "
549 "requested (because CPU sets are implemented as bit masks allocated in units "
550 "of I<sizeof(long)>). Consequently, B<sched_getaffinity>() can set bits "
551 "beyond the requested allocation size, because the kernel sees a few "
552 "additional bits. Therefore, the caller should iterate over the bits in the "
553 "returned set, counting those which are set, and stop upon reaching the value "
554 "returned by B<CPU_COUNT>(3) (rather than iterating over the number of bits "
555 "requested to be allocated)."
556 msgstr ""
557 "Proszę zauważyć, że B<CPU_ALLOC>(3) może przydzielić nieco większy zbiór "
558 "procesorów niż zażądano (ponieważ zbiory procesorów zaimplementowano jako "
559 "maski bitowe, korzystające z I<sizeof(long)> jako jednostki). Zatem "
560 "B<sched_getaffinity>() może ustawiać bity poza zażądanym rozmiarem alokacji, "
561 "ponieważ jądro widzi kilka dodatkowych bitów. Wywołujący powinien zatem "
562 "iterować bity w zwróconym zbiorze, licząc które z nich są ustawione i "
563 "zatrzymując się po osiągnięciu wartości zwróconej przez B<CPU_COUNT>(3) "
564 "(zamiast iterować po liczbie bitów, których alokacji zażądano)."
565
566 #. type: SH
567 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
568 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
569 #, no-wrap
570 msgid "EXAMPLES"
571 msgstr "PRZYKŁADY"
572
573 #. type: Plain text
574 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
575 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
576 msgid ""
577 "The program below creates a child process. The parent and child then each "
578 "assign themselves to a specified CPU and execute identical loops that "
579 "consume some CPU time. Before terminating, the parent waits for the child "
580 "to complete. The program takes three command-line arguments: the CPU number "
581 "for the parent, the CPU number for the child, and the number of loop "
582 "iterations that both processes should perform."
583 msgstr ""
584 "Poniższy program tworzy proces potomny. Procesy macierzysty i potomny "
585 "następnie przydzielają się na określony procesor i wykonują identyczne "
586 "pętle, które zabierają jakiś czas procesora. Przed zakończeniem, rodzic "
587 "czeka na ukończenie procesu potomnego. Program przyjmuje trzy argumenty "
588 "wiersza poleceń: numer procesora dla rodzica, numer procesora dla potomka i "
589 "liczbę iteracji pętli, jakie mają wykonać oba procesy."
590
591 #. type: Plain text
592 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
593 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
594 msgid ""
595 "As the sample runs below demonstrate, the amount of real and CPU time "
596 "consumed when running the program will depend on intra-core caching effects "
597 "and whether the processes are using the same CPU."
598 msgstr ""
599 "Jak pokazuje niżej przykładowe wykonanie, ilość czasu rzeczywistego i czasu "
600 "procesora działającego programu zależy od buforowania na poziomie wewnątrz "
601 "rdzenia i od tego, czy procesy używają tego samego procesora."
602
603 #. type: Plain text
604 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
605 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
606 msgid ""
607 "We first employ B<lscpu>(1) to determine that this (x86) system has two "
608 "cores, each with two CPUs:"
609 msgstr ""
610 "Najpierw korzystamy z B<lscpu>(1) sprawdzając, że dany system (x86) ma dwa "
611 "rdzenie, każdy z dwoma procesorami:"
612
613 # Tłumaczenie z util-linux 2.41
614 #. type: Plain text
615 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
616 #: opensuse-tumbleweed
617 #, no-wrap
618 msgid ""
619 "$B< lscpu | egrep -i \\[aq]core.*:|socket\\[aq]>;\n"
620 "Thread(s) per core: 2\n"
621 "Core(s) per socket: 2\n"
622 "Socket(s): 1\n"
623 msgstr ""
624 "$B< lscpu | egrep -i \\[aq]core.*:|socket\\[aq]>;\n"
625 "Wątków na rdzeń: 2\n"
626 "Rdzeni na gniazdo: 2\n"
627 "Gniazd: 1\n"
628
629 #. type: Plain text
630 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
631 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
632 msgid ""
633 "We then time the operation of the example program for three cases: both "
634 "processes running on the same CPU; both processes running on different CPUs "
635 "on the same core; and both processes running on different CPUs on different "
636 "cores."
637 msgstr ""
638 "Następnie mierzymy czas działania przykładowego programu dla trzech "
639 "przypadków: gdy oba procesy działają na tym samym procesorze; gdy procesy "
640 "działają na różnych procesorach na tym samym rdzeniu; gdy procesy działają "
641 "na różnych procesorach na różnych rdzeniach."
642
643 #. type: Plain text
644 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
645 #: opensuse-tumbleweed
646 #, no-wrap
647 msgid ""
648 "$B< time -p ./a.out 0 0 100000000>;\n"
649 "real 14.75\n"
650 "user 3.02\n"
651 "sys 11.73\n"
652 "$B< time -p ./a.out 0 1 100000000>;\n"
653 "real 11.52\n"
654 "user 3.98\n"
655 "sys 19.06\n"
656 "$B< time -p ./a.out 0 3 100000000>;\n"
657 "real 7.89\n"
658 "user 3.29\n"
659 "sys 12.07\n"
660 msgstr ""
661 "$B< time -p ./a.out 0 0 100000000>;\n"
662 "real 14.75\n"
663 "user 3.02\n"
664 "sys 11.73\n"
665 "$B< time -p ./a.out 0 1 100000000>;\n"
666 "real 11.52\n"
667 "user 3.98\n"
668 "sys 19.06\n"
669 "$B< time -p ./a.out 0 3 100000000>;\n"
670 "real 7.89\n"
671 "user 3.29\n"
672 "sys 12.07\n"
673
674 #. type: SS
675 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
676 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
677 #, no-wrap
678 msgid "Program source"
679 msgstr "Kod źródłowy programu"
680
681 #. type: Plain text
682 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
683 #: opensuse-tumbleweed
684 #, no-wrap
685 msgid ""
686 "#define _GNU_SOURCE\n"
687 "#include E<lt>err.hE<gt>\n"
688 "#include E<lt>sched.hE<gt>\n"
689 "#include E<lt>stdio.hE<gt>\n"
690 "#include E<lt>stdlib.hE<gt>\n"
691 "#include E<lt>sys/wait.hE<gt>\n"
692 "#include E<lt>unistd.hE<gt>\n"
693 "\\&\n"
694 "int\n"
695 "main(int argc, char *argv[])\n"
696 "{\n"
697 " int parentCPU, childCPU;\n"
698 " cpu_set_t set;\n"
699 " unsigned int nloops;\n"
700 "\\&\n"
701 " if (argc != 4) {\n"
702 " fprintf(stderr, \"Usage: %s parent-cpu child-cpu num-loops\\[rs]n\",\n"
703 " argv[0]);\n"
704 " exit(EXIT_FAILURE);\n"
705 " }\n"
706 "\\&\n"
707 " parentCPU = atoi(argv[1]);\n"
708 " childCPU = atoi(argv[2]);\n"
709 " nloops = atoi(argv[3]);\n"
710 "\\&\n"
711 " CPU_ZERO(&set);\n"
712 "\\&\n"
713 " switch (fork()) {\n"
714 " case -1: /* Error */\n"
715 " err(EXIT_FAILURE, \"fork\");\n"
716 "\\&\n"
717 " case 0: /* Child */\n"
718 " CPU_SET(childCPU, &set);\n"
719 "\\&\n"
720 " if (sched_setaffinity(0, sizeof(set), &set) == -1)\n"
721 " err(EXIT_FAILURE, \"sched_setaffinity\");\n"
722 "\\&\n"
723 " for (unsigned int j = 0; j E<lt> nloops; j++)\n"
724 " getppid();\n"
725 "\\&\n"
726 " exit(EXIT_SUCCESS);\n"
727 "\\&\n"
728 " default: /* Parent */\n"
729 " CPU_SET(parentCPU, &set);\n"
730 "\\&\n"
731 " if (sched_setaffinity(0, sizeof(set), &set) == -1)\n"
732 " err(EXIT_FAILURE, \"sched_setaffinity\");\n"
733 "\\&\n"
734 " for (unsigned int j = 0; j E<lt> nloops; j++)\n"
735 " getppid();\n"
736 "\\&\n"
737 " wait(NULL); /* Wait for child to terminate */\n"
738 " exit(EXIT_SUCCESS);\n"
739 " }\n"
740 "}\n"
741 msgstr ""
742 "#define _GNU_SOURCE\n"
743 "#include E<lt>err.hE<gt>\n"
744 "#include E<lt>sched.hE<gt>\n"
745 "#include E<lt>stdio.hE<gt>\n"
746 "#include E<lt>stdlib.hE<gt>\n"
747 "#include E<lt>sys/wait.hE<gt>\n"
748 "#include E<lt>unistd.hE<gt>\n"
749 "\\&\n"
750 "int\n"
751 "main(int argc, char *argv[])\n"
752 "{\n"
753 " int parentCPU, childCPU;\n"
754 " cpu_set_t set;\n"
755 " unsigned int nloops;\n"
756 "\\&\n"
757 " if (argc != 4) {\n"
758 " fprintf(stderr, \"Użycie: %s cpu-rodzica cpu-potomka l-pętli\\[rs]n\",\n"
759 " argv[0]);\n"
760 " exit(EXIT_FAILURE);\n"
761 " }\n"
762 "\\&\n"
763 " parentCPU = atoi(argv[1]);\n"
764 " childCPU = atoi(argv[2]);\n"
765 " nloops = atoi(argv[3]);\n"
766 "\\&\n"
767 " CPU_ZERO(&set);\n"
768 "\\&\n"
769 " switch (fork()) {\n"
770 " case -1: /* Błąd */\n"
771 " err(EXIT_FAILURE, \"fork\");\n"
772 "\\&\n"
773 " case 0: /* Potomek */\n"
774 " CPU_SET(childCPU, &set);\n"
775 "\\&\n"
776 " if (sched_setaffinity(0, sizeof(set), &set) == -1)\n"
777 " err(EXIT_FAILURE, \"sched_setaffinity\");\n"
778 "\\&\n"
779 " for (unsigned int j = 0; j E<lt> nloops; j++)\n"
780 " getppid();\n"
781 "\\&\n"
782 " exit(EXIT_SUCCESS);\n"
783 "\\&\n"
784 " default: /* Rodzic */\n"
785 " CPU_SET(parentCPU, &set);\n"
786 "\\&\n"
787 " if (sched_setaffinity(0, sizeof(set), &set) == -1)\n"
788 " err(EXIT_FAILURE, \"sched_setaffinity\");\n"
789 "\\&\n"
790 " for (unsigned int j = 0; j E<lt> nloops; j++)\n"
791 " getppid();\n"
792 "\\&\n"
793 " wait(NULL); /* Oczekiwanie na zakończenie potomka */\n"
794 " exit(EXIT_SUCCESS);\n"
795 " }\n"
796 "}\n"
797
798 #. SRC END
799 #. type: SH
800 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
801 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
802 #, no-wrap
803 msgid "SEE ALSO"
804 msgstr "ZOBACZ TAKŻE"
805
806 #. type: Plain text
807 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
808 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
809 msgid ""
810 "B<lscpu>(1), B<nproc>(1), B<taskset>(1), B<clone>(2), B<getcpu>(2), "
811 "B<getpriority>(2), B<gettid>(2), B<nice>(2), B<sched_get_priority_max>(2), "
812 "B<sched_get_priority_min>(2), B<sched_getscheduler>(2), "
813 "B<sched_setscheduler>(2), B<setpriority>(2), B<CPU_SET>(3), "
814 "B<get_nprocs>(3), B<pthread_setaffinity_np>(3), B<sched_getcpu>(3), "
815 "B<capabilities>(7), B<cpuset>(7), B<sched>(7), B<numactl>(8)"
816 msgstr ""
817 "B<lscpu>(1), B<nproc>(1), B<taskset>(1), B<clone>(2), B<getcpu>(2), "
818 "B<getpriority>(2), B<gettid>(2), B<nice>(2), B<sched_get_priority_max>(2), "
819 "B<sched_get_priority_min>(2), B<sched_getscheduler>(2), "
820 "B<sched_setscheduler>(2), B<setpriority>(2), B<CPU_SET>(3), "
821 "B<get_nprocs>(3), B<pthread_setaffinity_np>(3), B<sched_getcpu>(3), "
822 "B<capabilities>(7), B<cpuset>(7), B<sched>(7), B<numactl>(8)"
823
824 #. type: TH
825 #: debian-trixie
826 #, no-wrap
827 msgid "2024-06-15"
828 msgstr "15 czerwca 2024 r."
829
830 #. type: TH
831 #: debian-trixie
832 #, no-wrap
833 msgid "Linux man-pages 6.9.1"
834 msgstr "Linux man-pages 6.9.1"
835
836 #. type: Plain text
837 #: debian-trixie
838 msgid "Standard C library (I<libc>, I<-lc>)"
839 msgstr "Standardowa biblioteka C (I<libc>, I<-lc>)"
840
841 #. type: Plain text
842 #: debian-trixie fedora-44 fedora-rawhide
843 #, no-wrap
844 msgid ""
845 "$ B<lscpu | egrep -i \\[aq]core.*:|socket\\[aq]>\n"
846 "Thread(s) per core: 2\n"
847 "Core(s) per socket: 2\n"
848 "Socket(s): 1\n"
849 msgstr ""
850 "$ B<lscpu | egrep -i \\[aq]core.*:|socket\\[aq]>;\n"
851 "Wątków na rdzeń: 2\n"
852 "Rdzeni na gniazdo: 2\n"
853 "Gniazd: 1\n"
854
855 #. type: Plain text
856 #: debian-trixie fedora-44 fedora-rawhide
857 #, no-wrap
858 msgid ""
859 "$ B<time -p ./a.out 0 0 100000000>\n"
860 "real 14.75\n"
861 "user 3.02\n"
862 "sys 11.73\n"
863 "$ B<time -p ./a.out 0 1 100000000>\n"
864 "real 11.52\n"
865 "user 3.98\n"
866 "sys 19.06\n"
867 "$ B<time -p ./a.out 0 3 100000000>\n"
868 "real 7.89\n"
869 "user 3.29\n"
870 "sys 12.07\n"
871 msgstr ""
872 "$ B<time -p ./a.out 0 0 100000000>\n"
873 "real 14.75\n"
874 "user 3.02\n"
875 "sys 11.73\n"
876 "$ B<time -p ./a.out 0 1 100000000>\n"
877 "real 11.52\n"
878 "user 3.98\n"
879 "sys 19.06\n"
880 "$ B<time -p ./a.out 0 3 100000000>\n"
881 "real 7.89\n"
882 "user 3.29\n"
883 "sys 12.07\n"
884
885 #. type: Plain text
886 #: debian-trixie fedora-44 fedora-rawhide
887 #, no-wrap
888 msgid ""
889 "#define _GNU_SOURCE\n"
890 "#include E<lt>err.hE<gt>\n"
891 "#include E<lt>sched.hE<gt>\n"
892 "#include E<lt>stdio.hE<gt>\n"
893 "#include E<lt>stdlib.hE<gt>\n"
894 "#include E<lt>sys/wait.hE<gt>\n"
895 "#include E<lt>unistd.hE<gt>\n"
896 "\\&\n"
897 "int\n"
898 "main(int argc, char *argv[])\n"
899 "{\n"
900 " int parentCPU, childCPU;\n"
901 " cpu_set_t set;\n"
902 " unsigned int nloops;\n"
903 "\\&\n"
904 " if (argc != 4) {\n"
905 " fprintf(stderr, \"Usage: %s parent-cpu child-cpu num-loops\\[rs]n\",\n"
906 " argv[0]);\n"
907 " exit(EXIT_FAILURE);\n"
908 " }\n"
909 "\\&\n"
910 " parentCPU = atoi(argv[1]);\n"
911 " childCPU = atoi(argv[2]);\n"
912 " nloops = atoi(argv[3]);\n"
913 "\\&\n"
914 " CPU_ZERO(&set);\n"
915 "\\&\n"
916 " switch (fork()) {\n"
917 " case -1: /* Error */\n"
918 " err(EXIT_FAILURE, \"fork\");\n"
919 "\\&\n"
920 " case 0: /* Child */\n"
921 " CPU_SET(childCPU, &set);\n"
922 "\\&\n"
923 " if (sched_setaffinity(getpid(), sizeof(set), &set) == -1)\n"
924 " err(EXIT_FAILURE, \"sched_setaffinity\");\n"
925 "\\&\n"
926 " for (unsigned int j = 0; j E<lt> nloops; j++)\n"
927 " getppid();\n"
928 "\\&\n"
929 " exit(EXIT_SUCCESS);\n"
930 "\\&\n"
931 " default: /* Parent */\n"
932 " CPU_SET(parentCPU, &set);\n"
933 "\\&\n"
934 " if (sched_setaffinity(getpid(), sizeof(set), &set) == -1)\n"
935 " err(EXIT_FAILURE, \"sched_setaffinity\");\n"
936 "\\&\n"
937 " for (unsigned int j = 0; j E<lt> nloops; j++)\n"
938 " getppid();\n"
939 "\\&\n"
940 " wait(NULL); /* Wait for child to terminate */\n"
941 " exit(EXIT_SUCCESS);\n"
942 " }\n"
943 "}\n"
944 msgstr ""
945 "#define _GNU_SOURCE\n"
946 "#include E<lt>err.hE<gt>\n"
947 "#include E<lt>sched.hE<gt>\n"
948 "#include E<lt>stdio.hE<gt>\n"
949 "#include E<lt>stdlib.hE<gt>\n"
950 "#include E<lt>sys/wait.hE<gt>\n"
951 "#include E<lt>unistd.hE<gt>\n"
952 "\\&\n"
953 "int\n"
954 "main(int argc, char *argv[])\n"
955 "{\n"
956 " int parentCPU, childCPU;\n"
957 " cpu_set_t set;\n"
958 " unsigned int nloops;\n"
959 "\\&\n"
960 " if (argc != 4) {\n"
961 " fprintf(stderr, \"Użycie: %s cpu-rodzica cpu-potomka l-pętli\\[rs]n\",\n"
962 " argv[0]);\n"
963 " exit(EXIT_FAILURE);\n"
964 " }\n"
965 "\\&\n"
966 " parentCPU = atoi(argv[1]);\n"
967 " childCPU = atoi(argv[2]);\n"
968 " nloops = atoi(argv[3]);\n"
969 "\\&\n"
970 " CPU_ZERO(&set);\n"
971 "\\&\n"
972 " switch (fork()) {\n"
973 " case -1: /* Błąd */\n"
974 " err(EXIT_FAILURE, \"fork\");\n"
975 "\\&\n"
976 " case 0: /* Potomek */\n"
977 " CPU_SET(childCPU, &set);\n"
978 "\\&\n"
979 " if (sched_setaffinity(getpid(), sizeof(set), &set) == -1)\n"
980 " err(EXIT_FAILURE, \"sched_setaffinity\");\n"
981 "\\&\n"
982 " for (unsigned int j = 0; j E<lt> nloops; j++)\n"
983 " getppid();\n"
984 "\\&\n"
985 " exit(EXIT_SUCCESS);\n"
986 "\\&\n"
987 " default: /* Rodzic */\n"
988 " CPU_SET(parentCPU, &set);\n"
989 "\\&\n"
990 " if (sched_setaffinity(getpid(), sizeof(set), &set) == -1)\n"
991 " err(EXIT_FAILURE, \"sched_setaffinity\");\n"
992 "\\&\n"
993 " for (unsigned int j = 0; j E<lt> nloops; j++)\n"
994 " getppid();\n"
995 "\\&\n"
996 " wait(NULL); /* Oczekiwanie na zakończenie potomka */\n"
997 " exit(EXIT_SUCCESS);\n"
998 " }\n"
999 "}\n"
1000
1001 #. type: TH
1002 #: fedora-44 fedora-rawhide
1003 #, no-wrap
1004 msgid "2024-07-23"
1005 msgstr "23 lipca 2024 r."
1006
1007 #. type: TH
1008 #: fedora-44 fedora-rawhide
1009 #, no-wrap
1010 msgid "Linux man-pages 6.13"
1011 msgstr "Linux man-pages 6.13"
1012
1013 #. type: TH
1014 #: mageia-cauldron
1015 #, no-wrap
1016 msgid "Linux man-pages 6.17"
1017 msgstr "Linux man-pages 6.17"
1018
1019 #. type: TH
1020 #: opensuse-leap-16-1 opensuse-tumbleweed
1021 #, no-wrap
1022 msgid "Linux man-pages (unreleased)"
1023 msgstr "Linux man-pages (niewydane)"