| 1 |
# SOME DESCRIPTIVE TITLE |
| 2 |
# Copyright (C) YEAR Free Software Foundation, Inc. |
| 3 |
# This file is distributed under the same license as the PACKAGE package. |
| 4 |
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
| 5 |
# |
| 6 |
#, fuzzy |
| 7 |
msgid "" |
| 8 |
msgstr "" |
| 9 |
"Project-Id-Version: PACKAGE VERSION\n" |
| 10 |
"POT-Creation-Date: 2026-06-05 06:38+0200\n" |
| 11 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
| 12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
| 13 |
"Language-Team: LANGUAGE <[email protected]>\n" |
| 14 |
"Language: \n" |
| 15 |
"MIME-Version: 1.0\n" |
| 16 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 17 |
"Content-Transfer-Encoding: 8bit\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 "pthread_setaffinity_np" |
| 24 |
msgstr "" |
| 25 |
|
| 26 |
#. type: TH |
| 27 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 28 |
#: opensuse-tumbleweed |
| 29 |
#, no-wrap |
| 30 |
msgid "2025-09-21" |
| 31 |
msgstr "" |
| 32 |
|
| 33 |
#. type: TH |
| 34 |
#: archlinux debian-unstable |
| 35 |
#, no-wrap |
| 36 |
msgid "Linux man-pages 6.18" |
| 37 |
msgstr "" |
| 38 |
|
| 39 |
#. type: SH |
| 40 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 41 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 42 |
#, no-wrap |
| 43 |
msgid "NAME" |
| 44 |
msgstr "" |
| 45 |
|
| 46 |
#. type: Plain text |
| 47 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 48 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 49 |
msgid "" |
| 50 |
"pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a " |
| 51 |
"thread" |
| 52 |
msgstr "" |
| 53 |
|
| 54 |
#. type: SH |
| 55 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 56 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 57 |
#, no-wrap |
| 58 |
msgid "LIBRARY" |
| 59 |
msgstr "" |
| 60 |
|
| 61 |
#. type: Plain text |
| 62 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 63 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 64 |
msgid "POSIX threads library (I<libpthread>,\\ I<-lpthread>)" |
| 65 |
msgstr "" |
| 66 |
|
| 67 |
#. type: SH |
| 68 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 69 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 70 |
#, no-wrap |
| 71 |
msgid "SYNOPSIS" |
| 72 |
msgstr "" |
| 73 |
|
| 74 |
#. type: Plain text |
| 75 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 76 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 77 |
#, no-wrap |
| 78 |
msgid "" |
| 79 |
"B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n" |
| 80 |
"B<#include E<lt>pthread.hE<gt>>\n" |
| 81 |
msgstr "" |
| 82 |
|
| 83 |
#. type: Plain text |
| 84 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 85 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 86 |
#, no-wrap |
| 87 |
msgid "" |
| 88 |
"B<int pthread_setaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n" |
| 89 |
"B< const cpu_set_t *>I<cpuset>B<);>\n" |
| 90 |
"B<int pthread_getaffinity_np(pthread_t >I<thread>B<, size_t >I<cpusetsize>B<,>\n" |
| 91 |
"B< cpu_set_t *>I<cpuset>B<);>\n" |
| 92 |
msgstr "" |
| 93 |
|
| 94 |
#. type: SH |
| 95 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 96 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 97 |
#, no-wrap |
| 98 |
msgid "DESCRIPTION" |
| 99 |
msgstr "" |
| 100 |
|
| 101 |
#. type: Plain text |
| 102 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 103 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 104 |
msgid "" |
| 105 |
"The B<pthread_setaffinity_np>() function sets the CPU affinity mask of the " |
| 106 |
"thread I<thread> to the CPU set pointed to by I<cpuset>. If the call is " |
| 107 |
"successful, and the thread is not currently running on one of the CPUs in " |
| 108 |
"I<cpuset>, then it is migrated to one of those CPUs." |
| 109 |
msgstr "" |
| 110 |
|
| 111 |
#. type: Plain text |
| 112 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 113 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 114 |
msgid "" |
| 115 |
"The B<pthread_getaffinity_np>() function returns the CPU affinity mask of " |
| 116 |
"the thread I<thread> in the buffer pointed to by I<cpuset>." |
| 117 |
msgstr "" |
| 118 |
|
| 119 |
#. type: Plain text |
| 120 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 121 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 122 |
msgid "" |
| 123 |
"For more details on CPU affinity masks, see B<sched_setaffinity>(2). For a " |
| 124 |
"description of a set of macros that can be used to manipulate and inspect " |
| 125 |
"CPU sets, see B<CPU_SET>(3)." |
| 126 |
msgstr "" |
| 127 |
|
| 128 |
#. type: Plain text |
| 129 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 130 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 131 |
msgid "" |
| 132 |
"The argument I<cpusetsize> is the length (in bytes) of the buffer pointed to " |
| 133 |
"by I<cpuset>. Typically, this argument would be specified as " |
| 134 |
"I<sizeof(cpu_set_t)>. (It may be some other value, if using the macros " |
| 135 |
"described in B<CPU_SET>(3) for dynamically allocating a CPU set.)" |
| 136 |
msgstr "" |
| 137 |
|
| 138 |
#. type: SH |
| 139 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 140 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 141 |
#, no-wrap |
| 142 |
msgid "RETURN VALUE" |
| 143 |
msgstr "" |
| 144 |
|
| 145 |
#. type: Plain text |
| 146 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 147 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 148 |
msgid "" |
| 149 |
"On success, these functions return 0; on error, they return a nonzero error " |
| 150 |
"number." |
| 151 |
msgstr "" |
| 152 |
|
| 153 |
#. type: SH |
| 154 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 155 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 156 |
#, no-wrap |
| 157 |
msgid "ERRORS" |
| 158 |
msgstr "" |
| 159 |
|
| 160 |
#. type: TP |
| 161 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 162 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 163 |
#, no-wrap |
| 164 |
msgid "B<EFAULT>" |
| 165 |
msgstr "" |
| 166 |
|
| 167 |
#. type: Plain text |
| 168 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 169 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 170 |
msgid "A supplied memory address was invalid." |
| 171 |
msgstr "" |
| 172 |
|
| 173 |
#. type: TP |
| 174 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 175 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 176 |
#, no-wrap |
| 177 |
msgid "B<EINVAL>" |
| 178 |
msgstr "" |
| 179 |
|
| 180 |
#. type: Plain text |
| 181 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 182 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 183 |
msgid "" |
| 184 |
"(B<pthread_setaffinity_np>()) The affinity bit mask I<mask> contains no " |
| 185 |
"processors that are currently physically on the system and permitted to the " |
| 186 |
"thread according to any restrictions that may be imposed by the \"cpuset\" " |
| 187 |
"mechanism described in B<cpuset>(7)." |
| 188 |
msgstr "" |
| 189 |
|
| 190 |
#. cpumask_t |
| 191 |
#. The raw sched_getaffinity() system call returns the size (in bytes) |
| 192 |
#. of the cpumask_t type. |
| 193 |
#. type: Plain text |
| 194 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 195 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 196 |
msgid "" |
| 197 |
"(B<pthread_setaffinity_np>()) I<cpuset> specified a CPU that was outside " |
| 198 |
"the set supported by the kernel. (The kernel configuration option " |
| 199 |
"B<CONFIG_NR_CPUS> defines the range of the set supported by the kernel data " |
| 200 |
"type used to represent CPU sets.)" |
| 201 |
msgstr "" |
| 202 |
|
| 203 |
#. type: Plain text |
| 204 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 205 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 206 |
msgid "" |
| 207 |
"(B<pthread_getaffinity_np>()) I<cpusetsize> is smaller than the size of the " |
| 208 |
"affinity mask used by the kernel." |
| 209 |
msgstr "" |
| 210 |
|
| 211 |
#. type: TP |
| 212 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 213 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 214 |
#, no-wrap |
| 215 |
msgid "B<ESRCH>" |
| 216 |
msgstr "" |
| 217 |
|
| 218 |
#. type: Plain text |
| 219 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 220 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 221 |
msgid "No thread with the ID I<thread> could be found." |
| 222 |
msgstr "" |
| 223 |
|
| 224 |
#. type: SH |
| 225 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 226 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 227 |
#, no-wrap |
| 228 |
msgid "ATTRIBUTES" |
| 229 |
msgstr "" |
| 230 |
|
| 231 |
#. type: Plain text |
| 232 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 233 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 234 |
msgid "" |
| 235 |
"For an explanation of the terms used in this section, see B<attributes>(7)." |
| 236 |
msgstr "" |
| 237 |
|
| 238 |
#. type: tbl table |
| 239 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 240 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 241 |
#, no-wrap |
| 242 |
msgid "Interface" |
| 243 |
msgstr "" |
| 244 |
|
| 245 |
#. type: tbl table |
| 246 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 247 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 248 |
#, no-wrap |
| 249 |
msgid "Attribute" |
| 250 |
msgstr "" |
| 251 |
|
| 252 |
#. type: tbl table |
| 253 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 254 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 255 |
#, no-wrap |
| 256 |
msgid "Value" |
| 257 |
msgstr "" |
| 258 |
|
| 259 |
#. type: tbl table |
| 260 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 261 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 262 |
#, no-wrap |
| 263 |
msgid ".na\n" |
| 264 |
msgstr "" |
| 265 |
|
| 266 |
#. type: tbl table |
| 267 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 268 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 269 |
#, no-wrap |
| 270 |
msgid ".nh\n" |
| 271 |
msgstr "" |
| 272 |
|
| 273 |
#. type: tbl table |
| 274 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 275 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 276 |
#, no-wrap |
| 277 |
msgid "" |
| 278 |
"B<pthread_setaffinity_np>(),\n" |
| 279 |
"B<pthread_getaffinity_np>()" |
| 280 |
msgstr "" |
| 281 |
|
| 282 |
#. type: tbl table |
| 283 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 284 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 285 |
#, no-wrap |
| 286 |
msgid "Thread safety" |
| 287 |
msgstr "" |
| 288 |
|
| 289 |
#. type: tbl table |
| 290 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 291 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 292 |
#, no-wrap |
| 293 |
msgid "MT-Safe" |
| 294 |
msgstr "" |
| 295 |
|
| 296 |
#. type: SH |
| 297 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 298 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 299 |
#, no-wrap |
| 300 |
msgid "STANDARDS" |
| 301 |
msgstr "" |
| 302 |
|
| 303 |
#. type: Plain text |
| 304 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 305 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 306 |
msgid "GNU; hence the suffix \"_np\" (nonportable) in the names." |
| 307 |
msgstr "" |
| 308 |
|
| 309 |
#. type: SH |
| 310 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 311 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 312 |
#, no-wrap |
| 313 |
msgid "HISTORY" |
| 314 |
msgstr "" |
| 315 |
|
| 316 |
#. type: Plain text |
| 317 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 318 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 319 |
msgid "glibc 2.3.4." |
| 320 |
msgstr "" |
| 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 "" |
| 326 |
"In glibc 2.3.3 only, versions of these functions were provided that did not " |
| 327 |
"have a I<cpusetsize> argument. Instead the CPU set size given to the " |
| 328 |
"underlying system calls was always I<sizeof(cpu_set_t)>." |
| 329 |
msgstr "" |
| 330 |
|
| 331 |
#. type: SH |
| 332 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 333 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 334 |
#, no-wrap |
| 335 |
msgid "NOTES" |
| 336 |
msgstr "" |
| 337 |
|
| 338 |
#. type: Plain text |
| 339 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 340 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 341 |
msgid "" |
| 342 |
"After a call to B<pthread_setaffinity_np>(), the set of CPUs on which the " |
| 343 |
"thread will actually run is the intersection of the set specified in the " |
| 344 |
"I<cpuset> argument and the set of CPUs actually present on the system. The " |
| 345 |
"system may further restrict the set of CPUs on which the thread runs if the " |
| 346 |
"\"cpuset\" mechanism described in B<cpuset>(7) is being used. These " |
| 347 |
"restrictions on the actual set of CPUs on which the thread will run are " |
| 348 |
"silently imposed by the kernel." |
| 349 |
msgstr "" |
| 350 |
|
| 351 |
#. type: Plain text |
| 352 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 353 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 354 |
msgid "" |
| 355 |
"These functions are implemented on top of the B<sched_setaffinity>(2) and " |
| 356 |
"B<sched_getaffinity>(2) system calls." |
| 357 |
msgstr "" |
| 358 |
|
| 359 |
#. type: Plain text |
| 360 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 361 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 362 |
msgid "" |
| 363 |
"A new thread created by B<pthread_create>(3) inherits a copy of its " |
| 364 |
"creator's CPU affinity mask." |
| 365 |
msgstr "" |
| 366 |
|
| 367 |
#. type: SH |
| 368 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 369 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 370 |
#, no-wrap |
| 371 |
msgid "EXAMPLES" |
| 372 |
msgstr "" |
| 373 |
|
| 374 |
#. type: Plain text |
| 375 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 376 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 377 |
msgid "" |
| 378 |
"In the following program, the main thread uses B<pthread_setaffinity_np>() " |
| 379 |
"to set its CPU affinity mask to include CPUs 0 to 7 (which may not all be " |
| 380 |
"available on the system), and then calls B<pthread_getaffinity_np>() to " |
| 381 |
"check the resulting CPU affinity mask of the thread." |
| 382 |
msgstr "" |
| 383 |
|
| 384 |
#. type: Plain text |
| 385 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 386 |
#: opensuse-tumbleweed |
| 387 |
#, no-wrap |
| 388 |
msgid "" |
| 389 |
"#define _GNU_SOURCE\n" |
| 390 |
"#include E<lt>err.hE<gt>\n" |
| 391 |
"#include E<lt>pthread.hE<gt>\n" |
| 392 |
"#include E<lt>sched.hE<gt>\n" |
| 393 |
"#include E<lt>stdio.hE<gt>\n" |
| 394 |
"#include E<lt>stdlib.hE<gt>\n" |
| 395 |
"\\&\n" |
| 396 |
"int\n" |
| 397 |
"main(void)\n" |
| 398 |
"{\n" |
| 399 |
" int s;\n" |
| 400 |
" cpu_set_t cpuset;\n" |
| 401 |
" pthread_t thread;\n" |
| 402 |
"\\&\n" |
| 403 |
" thread = pthread_self();\n" |
| 404 |
"\\&\n" |
| 405 |
" /* Set affinity mask to include CPUs 0 to 7. */\n" |
| 406 |
"\\&\n" |
| 407 |
" CPU_ZERO(&cpuset);\n" |
| 408 |
" for (size_t j = 0; j E<lt> 8; j++)\n" |
| 409 |
" CPU_SET(j, &cpuset);\n" |
| 410 |
"\\&\n" |
| 411 |
" s = pthread_setaffinity_np(thread, sizeof(cpuset), &cpuset);\n" |
| 412 |
" if (s != 0)\n" |
| 413 |
" errc(EXIT_FAILURE, s, \"pthread_setaffinity_np\");\n" |
| 414 |
"\\&\n" |
| 415 |
" /* Check the actual affinity mask assigned to the thread. */\n" |
| 416 |
"\\&\n" |
| 417 |
" s = pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset);\n" |
| 418 |
" if (s != 0)\n" |
| 419 |
" errc(EXIT_FAILURE, s, \"pthread_getaffinity_np\");\n" |
| 420 |
"\\&\n" |
| 421 |
" printf(\"Set returned by pthread_getaffinity_np() contained:\\[rs]n\");\n" |
| 422 |
" for (size_t j = 0; j E<lt> CPU_SETSIZE; j++)\n" |
| 423 |
" if (CPU_ISSET(j, &cpuset))\n" |
| 424 |
" printf(\" CPU %zu\\[rs]n\", j);\n" |
| 425 |
"\\&\n" |
| 426 |
" exit(EXIT_SUCCESS);\n" |
| 427 |
"}\n" |
| 428 |
msgstr "" |
| 429 |
|
| 430 |
#. SRC END |
| 431 |
#. type: SH |
| 432 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 433 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 434 |
#, no-wrap |
| 435 |
msgid "SEE ALSO" |
| 436 |
msgstr "" |
| 437 |
|
| 438 |
#. type: Plain text |
| 439 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 440 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 441 |
msgid "" |
| 442 |
"B<sched_setaffinity>(2), B<CPU_SET>(3), B<pthread_attr_setaffinity_np>(3), " |
| 443 |
"B<pthread_self>(3), B<sched_getcpu>(3), B<cpuset>(7), B<pthreads>(7), " |
| 444 |
"B<sched>(7)" |
| 445 |
msgstr "" |
| 446 |
|
| 447 |
#. type: TH |
| 448 |
#: debian-trixie |
| 449 |
#, no-wrap |
| 450 |
msgid "2024-06-15" |
| 451 |
msgstr "" |
| 452 |
|
| 453 |
#. type: TH |
| 454 |
#: debian-trixie |
| 455 |
#, no-wrap |
| 456 |
msgid "Linux man-pages 6.9.1" |
| 457 |
msgstr "" |
| 458 |
|
| 459 |
#. type: Plain text |
| 460 |
#: debian-trixie |
| 461 |
msgid "POSIX threads library (I<libpthread>, I<-lpthread>)" |
| 462 |
msgstr "" |
| 463 |
|
| 464 |
#. type: Plain text |
| 465 |
#: debian-trixie |
| 466 |
#, no-wrap |
| 467 |
msgid "" |
| 468 |
"#define _GNU_SOURCE\n" |
| 469 |
"#include E<lt>err.hE<gt>\n" |
| 470 |
"#include E<lt>errno.hE<gt>\n" |
| 471 |
"#include E<lt>pthread.hE<gt>\n" |
| 472 |
"#include E<lt>stdio.hE<gt>\n" |
| 473 |
"#include E<lt>stdlib.hE<gt>\n" |
| 474 |
"\\&\n" |
| 475 |
"int\n" |
| 476 |
"main(void)\n" |
| 477 |
"{\n" |
| 478 |
" int s;\n" |
| 479 |
" cpu_set_t cpuset;\n" |
| 480 |
" pthread_t thread;\n" |
| 481 |
"\\&\n" |
| 482 |
" thread = pthread_self();\n" |
| 483 |
"\\&\n" |
| 484 |
" /* Set affinity mask to include CPUs 0 to 7. */\n" |
| 485 |
"\\&\n" |
| 486 |
" CPU_ZERO(&cpuset);\n" |
| 487 |
" for (size_t j = 0; j E<lt> 8; j++)\n" |
| 488 |
" CPU_SET(j, &cpuset);\n" |
| 489 |
"\\&\n" |
| 490 |
" s = pthread_setaffinity_np(thread, sizeof(cpuset), &cpuset);\n" |
| 491 |
" if (s != 0)\n" |
| 492 |
" errc(EXIT_FAILURE, s, \"pthread_setaffinity_np\");\n" |
| 493 |
"\\&\n" |
| 494 |
" /* Check the actual affinity mask assigned to the thread. */\n" |
| 495 |
"\\&\n" |
| 496 |
" s = pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset);\n" |
| 497 |
" if (s != 0)\n" |
| 498 |
" errc(EXIT_FAILURE, s, \"pthread_getaffinity_np\");\n" |
| 499 |
"\\&\n" |
| 500 |
" printf(\"Set returned by pthread_getaffinity_np() contained:\\[rs]n\");\n" |
| 501 |
" for (size_t j = 0; j E<lt> CPU_SETSIZE; j++)\n" |
| 502 |
" if (CPU_ISSET(j, &cpuset))\n" |
| 503 |
" printf(\" CPU %zu\\[rs]n\", j);\n" |
| 504 |
"\\&\n" |
| 505 |
" exit(EXIT_SUCCESS);\n" |
| 506 |
"}\n" |
| 507 |
msgstr "" |
| 508 |
|
| 509 |
#. type: TH |
| 510 |
#: fedora-44 fedora-rawhide |
| 511 |
#, no-wrap |
| 512 |
msgid "2024-11-03" |
| 513 |
msgstr "" |
| 514 |
|
| 515 |
#. type: TH |
| 516 |
#: fedora-44 fedora-rawhide |
| 517 |
#, no-wrap |
| 518 |
msgid "Linux man-pages 6.13" |
| 519 |
msgstr "" |
| 520 |
|
| 521 |
#. type: Plain text |
| 522 |
#: fedora-44 fedora-rawhide |
| 523 |
#, no-wrap |
| 524 |
msgid "" |
| 525 |
"#define _GNU_SOURCE\n" |
| 526 |
"#include E<lt>err.hE<gt>\n" |
| 527 |
"#include E<lt>pthread.hE<gt>\n" |
| 528 |
"#include E<lt>sched.hE<gt>\n" |
| 529 |
"#include E<lt>stdio.hE<gt>\n" |
| 530 |
"#include E<lt>stdlib.hE<gt>\n" |
| 531 |
"\\&\n" |
| 532 |
"int\n" |
| 533 |
"main(void)\n" |
| 534 |
"{\n" |
| 535 |
" int s;\n" |
| 536 |
" cpu_set_t cpuset;\n" |
| 537 |
" pthread_t thread;\n" |
| 538 |
"\\&\n" |
| 539 |
" thread = pthread_self();\n" |
| 540 |
"\\&\n" |
| 541 |
" /* Set affinity mask to include CPUs 0 to 7. */\n" |
| 542 |
"\\&\n" |
| 543 |
" CPU_ZERO(&cpuset);\n" |
| 544 |
" for (size_t j = 0; j E<lt> 8; j++)\n" |
| 545 |
" CPU_SET(j, &cpuset);\n" |
| 546 |
"\\&\n" |
| 547 |
" s = pthread_setaffinity_np(thread, sizeof(cpuset), &cpuset);\n" |
| 548 |
" if (s != 0)\n" |
| 549 |
" errc(EXIT_FAILURE, s, \"pthread_setaffinity_np\");\n" |
| 550 |
"\\&\n" |
| 551 |
" /* Check the actual affinity mask assigned to the thread. */\n" |
| 552 |
"\\&\n" |
| 553 |
" s = pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset);\n" |
| 554 |
" if (s != 0)\n" |
| 555 |
" errc(EXIT_FAILURE, s, \"pthread_getaffinity_np\");\n" |
| 556 |
"\\&\n" |
| 557 |
" printf(\"Set returned by pthread_getaffinity_np() contained:\\[rs]n\");\n" |
| 558 |
" for (size_t j = 0; j E<lt> CPU_SETSIZE; j++)\n" |
| 559 |
" if (CPU_ISSET(j, &cpuset))\n" |
| 560 |
" printf(\" CPU %zu\\[rs]n\", j);\n" |
| 561 |
"\\&\n" |
| 562 |
" exit(EXIT_SUCCESS);\n" |
| 563 |
"}\n" |
| 564 |
msgstr "" |
| 565 |
|
| 566 |
#. type: TH |
| 567 |
#: mageia-cauldron |
| 568 |
#, no-wrap |
| 569 |
msgid "Linux man-pages 6.17" |
| 570 |
msgstr "" |
| 571 |
|
| 572 |
#. type: TH |
| 573 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 574 |
#, no-wrap |
| 575 |
msgid "Linux man-pages (unreleased)" |
| 576 |
msgstr "" |