| 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_getcpuclockid" |
| 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-08-20" |
| 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 "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock" |
| 50 |
msgstr "" |
| 51 |
|
| 52 |
#. type: SH |
| 53 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 54 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 55 |
#, no-wrap |
| 56 |
msgid "LIBRARY" |
| 57 |
msgstr "" |
| 58 |
|
| 59 |
#. type: Plain text |
| 60 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 61 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 62 |
msgid "POSIX threads library (I<libpthread>,\\ I<-lpthread>)" |
| 63 |
msgstr "" |
| 64 |
|
| 65 |
#. type: SH |
| 66 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 67 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 68 |
#, no-wrap |
| 69 |
msgid "SYNOPSIS" |
| 70 |
msgstr "" |
| 71 |
|
| 72 |
#. type: Plain text |
| 73 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 74 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 75 |
#, no-wrap |
| 76 |
msgid "" |
| 77 |
"B<#include E<lt>pthread.hE<gt>>\n" |
| 78 |
"B<#include E<lt>time.hE<gt>>\n" |
| 79 |
msgstr "" |
| 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 "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clockid>B<);>\n" |
| 86 |
msgstr "" |
| 87 |
|
| 88 |
#. type: SH |
| 89 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 90 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 91 |
#, no-wrap |
| 92 |
msgid "DESCRIPTION" |
| 93 |
msgstr "" |
| 94 |
|
| 95 |
#. The clockid is constructed as follows: |
| 96 |
#. *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE) |
| 97 |
#. where CLOCK_IDFIELD_SIZE is 3. |
| 98 |
#. type: Plain text |
| 99 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 100 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 101 |
msgid "" |
| 102 |
"The B<pthread_getcpuclockid>() function obtains the ID of the CPU-time " |
| 103 |
"clock of the thread whose ID is given in I<thread>, and returns it in the " |
| 104 |
"location pointed to by I<clockid>." |
| 105 |
msgstr "" |
| 106 |
|
| 107 |
#. type: SH |
| 108 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 109 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 110 |
#, no-wrap |
| 111 |
msgid "RETURN VALUE" |
| 112 |
msgstr "" |
| 113 |
|
| 114 |
#. type: Plain text |
| 115 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 116 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 117 |
msgid "" |
| 118 |
"On success, this function returns 0; on error, it returns a nonzero error " |
| 119 |
"number." |
| 120 |
msgstr "" |
| 121 |
|
| 122 |
#. type: SH |
| 123 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 124 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 125 |
#, no-wrap |
| 126 |
msgid "ERRORS" |
| 127 |
msgstr "" |
| 128 |
|
| 129 |
#. type: TP |
| 130 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 131 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 132 |
#, no-wrap |
| 133 |
msgid "B<ENOENT>" |
| 134 |
msgstr "" |
| 135 |
|
| 136 |
# |
| 137 |
#. CLOCK_THREAD_CPUTIME_ID not defined |
| 138 |
#. Looking at nptl/pthread_getcpuclockid.c an ERANGE error would |
| 139 |
#. be possible if kernel thread IDs took more than 29 bits (which |
| 140 |
#. they currently cannot). |
| 141 |
#. type: Plain text |
| 142 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 143 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 144 |
msgid "Per-thread CPU time clocks are not supported by the system." |
| 145 |
msgstr "" |
| 146 |
|
| 147 |
#. type: TP |
| 148 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 149 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 150 |
#, no-wrap |
| 151 |
msgid "B<ESRCH>" |
| 152 |
msgstr "" |
| 153 |
|
| 154 |
#. type: Plain text |
| 155 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 156 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 157 |
msgid "No thread with the ID I<thread> could be found." |
| 158 |
msgstr "" |
| 159 |
|
| 160 |
#. type: SH |
| 161 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 162 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 163 |
#, no-wrap |
| 164 |
msgid "ATTRIBUTES" |
| 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 "" |
| 171 |
"For an explanation of the terms used in this section, see B<attributes>(7)." |
| 172 |
msgstr "" |
| 173 |
|
| 174 |
#. type: tbl table |
| 175 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 176 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 177 |
#, no-wrap |
| 178 |
msgid "Interface" |
| 179 |
msgstr "" |
| 180 |
|
| 181 |
#. type: tbl table |
| 182 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 183 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 184 |
#, no-wrap |
| 185 |
msgid "Attribute" |
| 186 |
msgstr "" |
| 187 |
|
| 188 |
#. type: tbl table |
| 189 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 190 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 191 |
#, no-wrap |
| 192 |
msgid "Value" |
| 193 |
msgstr "" |
| 194 |
|
| 195 |
#. type: tbl table |
| 196 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 197 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 198 |
#, no-wrap |
| 199 |
msgid ".na\n" |
| 200 |
msgstr "" |
| 201 |
|
| 202 |
#. type: tbl table |
| 203 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 204 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 205 |
#, no-wrap |
| 206 |
msgid ".nh\n" |
| 207 |
msgstr "" |
| 208 |
|
| 209 |
#. type: tbl table |
| 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<pthread_getcpuclockid>()" |
| 214 |
msgstr "" |
| 215 |
|
| 216 |
#. type: tbl table |
| 217 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 218 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 219 |
#, no-wrap |
| 220 |
msgid "Thread safety" |
| 221 |
msgstr "" |
| 222 |
|
| 223 |
#. type: tbl table |
| 224 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 225 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 226 |
#, no-wrap |
| 227 |
msgid "MT-Safe" |
| 228 |
msgstr "" |
| 229 |
|
| 230 |
#. type: SH |
| 231 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 232 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 233 |
#, no-wrap |
| 234 |
msgid "STANDARDS" |
| 235 |
msgstr "" |
| 236 |
|
| 237 |
#. type: Plain text |
| 238 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 239 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 240 |
msgid "POSIX.1-2008." |
| 241 |
msgstr "" |
| 242 |
|
| 243 |
#. type: SH |
| 244 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 245 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 246 |
#, no-wrap |
| 247 |
msgid "HISTORY" |
| 248 |
msgstr "" |
| 249 |
|
| 250 |
#. type: Plain text |
| 251 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 252 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 253 |
msgid "glibc 2.2. POSIX.1-2001." |
| 254 |
msgstr "" |
| 255 |
|
| 256 |
#. type: SH |
| 257 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 258 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 259 |
#, no-wrap |
| 260 |
msgid "NOTES" |
| 261 |
msgstr "" |
| 262 |
|
| 263 |
#. type: Plain text |
| 264 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 265 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 266 |
msgid "" |
| 267 |
"When I<thread> refers to the calling thread, this function returns an " |
| 268 |
"identifier that refers to the same clock manipulated by B<clock_gettime>(2) " |
| 269 |
"and B<clock_settime>(2) when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>." |
| 270 |
msgstr "" |
| 271 |
|
| 272 |
#. type: SH |
| 273 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 274 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 275 |
#, no-wrap |
| 276 |
msgid "EXAMPLES" |
| 277 |
msgstr "" |
| 278 |
|
| 279 |
#. type: Plain text |
| 280 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 281 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 282 |
msgid "" |
| 283 |
"The program below creates a thread and then uses B<clock_gettime>(2) to " |
| 284 |
"retrieve the total process CPU time, and the per-thread CPU time consumed by " |
| 285 |
"the two threads. The following shell session shows an example run:" |
| 286 |
msgstr "" |
| 287 |
|
| 288 |
#. type: Plain text |
| 289 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 290 |
#: opensuse-tumbleweed |
| 291 |
#, no-wrap |
| 292 |
msgid "" |
| 293 |
"$B< ./a.out>;\n" |
| 294 |
"Main thread sleeping\n" |
| 295 |
"Subthread starting infinite loop\n" |
| 296 |
"Main thread consuming some CPU time...\n" |
| 297 |
"Process total CPU time: 1.368\n" |
| 298 |
"Main thread CPU time: 0.376\n" |
| 299 |
"Subthread CPU time: 0.992\n" |
| 300 |
msgstr "" |
| 301 |
|
| 302 |
#. type: SS |
| 303 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 304 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 305 |
#, no-wrap |
| 306 |
msgid "Program source" |
| 307 |
msgstr "" |
| 308 |
|
| 309 |
#. type: Plain text |
| 310 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 311 |
#: opensuse-tumbleweed |
| 312 |
#, no-wrap |
| 313 |
msgid "" |
| 314 |
"/* Link with \"-lrt\" */\n" |
| 315 |
"\\&\n" |
| 316 |
"#include E<lt>err.hE<gt>\n" |
| 317 |
"#include E<lt>errno.hE<gt>\n" |
| 318 |
"#include E<lt>pthread.hE<gt>\n" |
| 319 |
"#include E<lt>stdint.hE<gt>\n" |
| 320 |
"#include E<lt>stdio.hE<gt>\n" |
| 321 |
"#include E<lt>stdlib.hE<gt>\n" |
| 322 |
"#include E<lt>string.hE<gt>\n" |
| 323 |
"#include E<lt>sys/time.hE<gt>\n" |
| 324 |
"#include E<lt>time.hE<gt>\n" |
| 325 |
"#include E<lt>unistd.hE<gt>\n" |
| 326 |
"\\&\n" |
| 327 |
"static void *\n" |
| 328 |
"thread_start(void *arg)\n" |
| 329 |
"{\n" |
| 330 |
" printf(\"Subthread starting infinite loop\\[rs]n\");\n" |
| 331 |
" for (;;)\n" |
| 332 |
" continue;\n" |
| 333 |
"}\n" |
| 334 |
"\\&\n" |
| 335 |
"static void\n" |
| 336 |
"pclock(char *msg, clockid_t cid)\n" |
| 337 |
"{\n" |
| 338 |
" struct timespec ts;\n" |
| 339 |
"\\&\n" |
| 340 |
" printf(\"%s\", msg);\n" |
| 341 |
" if (clock_gettime(cid, &ts) == -1)\n" |
| 342 |
" err(EXIT_FAILURE, \"clock_gettime\");\n" |
| 343 |
" printf(\"%4jd.%03ld\\[rs]n\", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n" |
| 344 |
"}\n" |
| 345 |
"\\&\n" |
| 346 |
"int\n" |
| 347 |
"main(void)\n" |
| 348 |
"{\n" |
| 349 |
" pthread_t thread;\n" |
| 350 |
" clockid_t cid;\n" |
| 351 |
" int s;\n" |
| 352 |
"\\&\n" |
| 353 |
" s = pthread_create(&thread, NULL, thread_start, NULL);\n" |
| 354 |
" if (s != 0)\n" |
| 355 |
" errc(EXIT_FAILURE, s, \"pthread_create\");\n" |
| 356 |
"\\&\n" |
| 357 |
" printf(\"Main thread sleeping\\[rs]n\");\n" |
| 358 |
" sleep(1);\n" |
| 359 |
"\\&\n" |
| 360 |
" printf(\"Main thread consuming some CPU time...\\[rs]n\");\n" |
| 361 |
" for (unsigned int j = 0; j E<lt> 2000000; j++)\n" |
| 362 |
" getppid();\n" |
| 363 |
"\\&\n" |
| 364 |
" pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n" |
| 365 |
"\\&\n" |
| 366 |
" s = pthread_getcpuclockid(pthread_self(), &cid);\n" |
| 367 |
" if (s != 0)\n" |
| 368 |
" errc(EXIT_FAILURE, s, \"pthread_getcpuclockid\");\n" |
| 369 |
" pclock(\"Main thread CPU time: \", cid);\n" |
| 370 |
"\\&\n" |
| 371 |
" /* The preceding 4 lines of code could have been replaced by:\n" |
| 372 |
" pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n" |
| 373 |
"\\&\n" |
| 374 |
" s = pthread_getcpuclockid(thread, &cid);\n" |
| 375 |
" if (s != 0)\n" |
| 376 |
" errc(EXIT_FAILURE, s, \"pthread_getcpuclockid\");\n" |
| 377 |
" pclock(\"Subthread CPU time: 1 \", cid);\n" |
| 378 |
"\\&\n" |
| 379 |
" exit(EXIT_SUCCESS); /* Terminates both threads */\n" |
| 380 |
"}\n" |
| 381 |
msgstr "" |
| 382 |
|
| 383 |
#. SRC END |
| 384 |
#. type: SH |
| 385 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 386 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 387 |
#, no-wrap |
| 388 |
msgid "SEE ALSO" |
| 389 |
msgstr "" |
| 390 |
|
| 391 |
#. type: Plain text |
| 392 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 393 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 394 |
msgid "" |
| 395 |
"B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), " |
| 396 |
"B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)" |
| 397 |
msgstr "" |
| 398 |
|
| 399 |
#. type: TH |
| 400 |
#: debian-trixie |
| 401 |
#, no-wrap |
| 402 |
msgid "2024-06-15" |
| 403 |
msgstr "" |
| 404 |
|
| 405 |
#. type: TH |
| 406 |
#: debian-trixie |
| 407 |
#, no-wrap |
| 408 |
msgid "Linux man-pages 6.9.1" |
| 409 |
msgstr "" |
| 410 |
|
| 411 |
#. type: Plain text |
| 412 |
#: debian-trixie |
| 413 |
msgid "POSIX threads library (I<libpthread>, I<-lpthread>)" |
| 414 |
msgstr "" |
| 415 |
|
| 416 |
#. type: Plain text |
| 417 |
#: debian-trixie fedora-44 fedora-rawhide |
| 418 |
#, no-wrap |
| 419 |
msgid "" |
| 420 |
"$ B<./a.out>\n" |
| 421 |
"Main thread sleeping\n" |
| 422 |
"Subthread starting infinite loop\n" |
| 423 |
"Main thread consuming some CPU time...\n" |
| 424 |
"Process total CPU time: 1.368\n" |
| 425 |
"Main thread CPU time: 0.376\n" |
| 426 |
"Subthread CPU time: 0.992\n" |
| 427 |
msgstr "" |
| 428 |
|
| 429 |
#. type: Plain text |
| 430 |
#: debian-trixie |
| 431 |
#, no-wrap |
| 432 |
msgid "" |
| 433 |
"/* Link with \"-lrt\" */\n" |
| 434 |
"\\&\n" |
| 435 |
"#include E<lt>errno.hE<gt>\n" |
| 436 |
"#include E<lt>pthread.hE<gt>\n" |
| 437 |
"#include E<lt>stdint.hE<gt>\n" |
| 438 |
"#include E<lt>stdio.hE<gt>\n" |
| 439 |
"#include E<lt>stdlib.hE<gt>\n" |
| 440 |
"#include E<lt>string.hE<gt>\n" |
| 441 |
"#include E<lt>time.hE<gt>\n" |
| 442 |
"#include E<lt>unistd.hE<gt>\n" |
| 443 |
"\\&\n" |
| 444 |
"#define handle_error(msg) \\[rs]\n" |
| 445 |
" do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 446 |
"\\&\n" |
| 447 |
"#define handle_error_en(en, msg) \\[rs]\n" |
| 448 |
" do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 449 |
"\\&\n" |
| 450 |
"static void *\n" |
| 451 |
"thread_start(void *arg)\n" |
| 452 |
"{\n" |
| 453 |
" printf(\"Subthread starting infinite loop\\[rs]n\");\n" |
| 454 |
" for (;;)\n" |
| 455 |
" continue;\n" |
| 456 |
"}\n" |
| 457 |
"\\&\n" |
| 458 |
"static void\n" |
| 459 |
"pclock(char *msg, clockid_t cid)\n" |
| 460 |
"{\n" |
| 461 |
" struct timespec ts;\n" |
| 462 |
"\\&\n" |
| 463 |
" printf(\"%s\", msg);\n" |
| 464 |
" if (clock_gettime(cid, &ts) == -1)\n" |
| 465 |
" handle_error(\"clock_gettime\");\n" |
| 466 |
" printf(\"%4jd.%03ld\\[rs]n\", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n" |
| 467 |
"}\n" |
| 468 |
"\\&\n" |
| 469 |
"int\n" |
| 470 |
"main(void)\n" |
| 471 |
"{\n" |
| 472 |
" pthread_t thread;\n" |
| 473 |
" clockid_t cid;\n" |
| 474 |
" int s;\n" |
| 475 |
"\\&\n" |
| 476 |
" s = pthread_create(&thread, NULL, thread_start, NULL);\n" |
| 477 |
" if (s != 0)\n" |
| 478 |
" handle_error_en(s, \"pthread_create\");\n" |
| 479 |
"\\&\n" |
| 480 |
" printf(\"Main thread sleeping\\[rs]n\");\n" |
| 481 |
" sleep(1);\n" |
| 482 |
"\\&\n" |
| 483 |
" printf(\"Main thread consuming some CPU time...\\[rs]n\");\n" |
| 484 |
" for (unsigned int j = 0; j E<lt> 2000000; j++)\n" |
| 485 |
" getppid();\n" |
| 486 |
"\\&\n" |
| 487 |
" pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n" |
| 488 |
"\\&\n" |
| 489 |
" s = pthread_getcpuclockid(pthread_self(), &cid);\n" |
| 490 |
" if (s != 0)\n" |
| 491 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 492 |
" pclock(\"Main thread CPU time: \", cid);\n" |
| 493 |
"\\&\n" |
| 494 |
" /* The preceding 4 lines of code could have been replaced by:\n" |
| 495 |
" pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n" |
| 496 |
"\\&\n" |
| 497 |
" s = pthread_getcpuclockid(thread, &cid);\n" |
| 498 |
" if (s != 0)\n" |
| 499 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 500 |
" pclock(\"Subthread CPU time: 1 \", cid);\n" |
| 501 |
"\\&\n" |
| 502 |
" exit(EXIT_SUCCESS); /* Terminates both threads */\n" |
| 503 |
"}\n" |
| 504 |
msgstr "" |
| 505 |
|
| 506 |
#. type: TH |
| 507 |
#: fedora-44 fedora-rawhide |
| 508 |
#, no-wrap |
| 509 |
msgid "2024-11-03" |
| 510 |
msgstr "" |
| 511 |
|
| 512 |
#. type: TH |
| 513 |
#: fedora-44 fedora-rawhide |
| 514 |
#, no-wrap |
| 515 |
msgid "Linux man-pages 6.13" |
| 516 |
msgstr "" |
| 517 |
|
| 518 |
#. type: Plain text |
| 519 |
#: fedora-44 fedora-rawhide |
| 520 |
#, no-wrap |
| 521 |
msgid "" |
| 522 |
"/* Link with \"-lrt\" */\n" |
| 523 |
"\\&\n" |
| 524 |
"#include E<lt>errno.hE<gt>\n" |
| 525 |
"#include E<lt>pthread.hE<gt>\n" |
| 526 |
"#include E<lt>stdint.hE<gt>\n" |
| 527 |
"#include E<lt>stdio.hE<gt>\n" |
| 528 |
"#include E<lt>stdlib.hE<gt>\n" |
| 529 |
"#include E<lt>string.hE<gt>\n" |
| 530 |
"#include E<lt>sys/time.hE<gt>\n" |
| 531 |
"#include E<lt>time.hE<gt>\n" |
| 532 |
"#include E<lt>unistd.hE<gt>\n" |
| 533 |
"\\&\n" |
| 534 |
"#define handle_error(msg) \\[rs]\n" |
| 535 |
" do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 536 |
"\\&\n" |
| 537 |
"#define handle_error_en(en, msg) \\[rs]\n" |
| 538 |
" do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 539 |
"\\&\n" |
| 540 |
"static void *\n" |
| 541 |
"thread_start(void *arg)\n" |
| 542 |
"{\n" |
| 543 |
" printf(\"Subthread starting infinite loop\\[rs]n\");\n" |
| 544 |
" for (;;)\n" |
| 545 |
" continue;\n" |
| 546 |
"}\n" |
| 547 |
"\\&\n" |
| 548 |
"static void\n" |
| 549 |
"pclock(char *msg, clockid_t cid)\n" |
| 550 |
"{\n" |
| 551 |
" struct timespec ts;\n" |
| 552 |
"\\&\n" |
| 553 |
" printf(\"%s\", msg);\n" |
| 554 |
" if (clock_gettime(cid, &ts) == -1)\n" |
| 555 |
" handle_error(\"clock_gettime\");\n" |
| 556 |
" printf(\"%4jd.%03ld\\[rs]n\", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n" |
| 557 |
"}\n" |
| 558 |
"\\&\n" |
| 559 |
"int\n" |
| 560 |
"main(void)\n" |
| 561 |
"{\n" |
| 562 |
" pthread_t thread;\n" |
| 563 |
" clockid_t cid;\n" |
| 564 |
" int s;\n" |
| 565 |
"\\&\n" |
| 566 |
" s = pthread_create(&thread, NULL, thread_start, NULL);\n" |
| 567 |
" if (s != 0)\n" |
| 568 |
" handle_error_en(s, \"pthread_create\");\n" |
| 569 |
"\\&\n" |
| 570 |
" printf(\"Main thread sleeping\\[rs]n\");\n" |
| 571 |
" sleep(1);\n" |
| 572 |
"\\&\n" |
| 573 |
" printf(\"Main thread consuming some CPU time...\\[rs]n\");\n" |
| 574 |
" for (unsigned int j = 0; j E<lt> 2000000; j++)\n" |
| 575 |
" getppid();\n" |
| 576 |
"\\&\n" |
| 577 |
" pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n" |
| 578 |
"\\&\n" |
| 579 |
" s = pthread_getcpuclockid(pthread_self(), &cid);\n" |
| 580 |
" if (s != 0)\n" |
| 581 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 582 |
" pclock(\"Main thread CPU time: \", cid);\n" |
| 583 |
"\\&\n" |
| 584 |
" /* The preceding 4 lines of code could have been replaced by:\n" |
| 585 |
" pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n" |
| 586 |
"\\&\n" |
| 587 |
" s = pthread_getcpuclockid(thread, &cid);\n" |
| 588 |
" if (s != 0)\n" |
| 589 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 590 |
" pclock(\"Subthread CPU time: 1 \", cid);\n" |
| 591 |
"\\&\n" |
| 592 |
" exit(EXIT_SUCCESS); /* Terminates both threads */\n" |
| 593 |
"}\n" |
| 594 |
msgstr "" |
| 595 |
|
| 596 |
#. type: TH |
| 597 |
#: mageia-cauldron |
| 598 |
#, no-wrap |
| 599 |
msgid "Linux man-pages 6.17" |
| 600 |
msgstr "" |
| 601 |
|
| 602 |
#. type: TH |
| 603 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 604 |
#, no-wrap |
| 605 |
msgid "Linux man-pages (unreleased)" |
| 606 |
msgstr "" |