| 1 |
# French translation of manpages |
| 2 |
# This file is distributed under the same license as the manpages-l10n package. |
| 3 |
# Copyright © of this file: |
| 4 |
# Christophe Blaess <https://www.blaess.fr/christophe/>, 1996-2003. |
| 5 |
# Stéphan Rafin <[email protected]>, 2002. |
| 6 |
# Thierry Vignaud <[email protected]>, 1999, 2002. |
| 7 |
# François Micaux, 2002. |
| 8 |
# Alain Portal <[email protected]>, 2003-2008. |
| 9 |
# Jean-Philippe Guérard <[email protected]>, 2005-2006. |
| 10 |
# Jean-Luc Coulon (f5ibh) <[email protected]>, 2006-2007. |
| 11 |
# Julien Cristau <[email protected]>, 2006-2007. |
| 12 |
# Thomas Huriaux <[email protected]>, 2006-2008. |
| 13 |
# Nicolas François <[email protected]>, 2006-2008. |
| 14 |
# Florentin Duneau <[email protected]>, 2006-2010. |
| 15 |
# Simon Paillard <[email protected]>, 2006. |
| 16 |
# Denis Barbier <[email protected]>, 2006, 2010. |
| 17 |
# David Prévot <[email protected]>, 2010, 2012. |
| 18 |
# Frédéric Hantrais <[email protected]>, 2013, 2014. |
| 19 |
# Jean-Philippe MENGUAL <[email protected]>, 2023 |
| 20 |
msgid "" |
| 21 |
msgstr "" |
| 22 |
"Project-Id-Version: perkamon\n" |
| 23 |
"POT-Creation-Date: 2026-06-05 06:38+0200\n" |
| 24 |
"PO-Revision-Date: 2023-09-23 10:02+0200\n" |
| 25 |
"Last-Translator: Jean-Philippe MENGUAL <[email protected]>\n" |
| 26 |
"Language-Team: French <[email protected]>\n" |
| 27 |
"Language: fr\n" |
| 28 |
"MIME-Version: 1.0\n" |
| 29 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 30 |
"Content-Transfer-Encoding: 8bit\n" |
| 31 |
"Plural-Forms: nplurals=2; plural=n > 1;\n" |
| 32 |
"X-Generator: Weblate 3.1.1\n" |
| 33 |
|
| 34 |
#. type: TH |
| 35 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 36 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 37 |
#, no-wrap |
| 38 |
msgid "pthread_getcpuclockid" |
| 39 |
msgstr "pthread_getcpuclockid" |
| 40 |
|
| 41 |
#. type: TH |
| 42 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 43 |
#: opensuse-tumbleweed |
| 44 |
#, no-wrap |
| 45 |
msgid "2025-08-20" |
| 46 |
msgstr "20 août 2025" |
| 47 |
|
| 48 |
#. type: TH |
| 49 |
#: archlinux debian-unstable |
| 50 |
#, no-wrap |
| 51 |
msgid "Linux man-pages 6.18" |
| 52 |
msgstr "Pages du manuel de Linux 6.18" |
| 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 "NAME" |
| 59 |
msgstr "NOM" |
| 60 |
|
| 61 |
#. type: Plain text |
| 62 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 63 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 64 |
msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock" |
| 65 |
msgstr "" |
| 66 |
"pthread_getcpuclockid - Récupérer l'identifiant d'horloge de temps CPU d'un " |
| 67 |
"thread" |
| 68 |
|
| 69 |
#. type: SH |
| 70 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 71 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 72 |
#, no-wrap |
| 73 |
msgid "LIBRARY" |
| 74 |
msgstr "BIBLIOTHÈQUE" |
| 75 |
|
| 76 |
#. type: Plain text |
| 77 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 78 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 79 |
msgid "POSIX threads library (I<libpthread>,\\ I<-lpthread>)" |
| 80 |
msgstr "Bibliothèque de threads POSIX (I<libpthread>,\\ I<-lpthread>)" |
| 81 |
|
| 82 |
#. type: SH |
| 83 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 84 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 85 |
#, no-wrap |
| 86 |
msgid "SYNOPSIS" |
| 87 |
msgstr "SYNOPSIS" |
| 88 |
|
| 89 |
#. type: Plain text |
| 90 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 91 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 92 |
#, no-wrap |
| 93 |
msgid "" |
| 94 |
"B<#include E<lt>pthread.hE<gt>>\n" |
| 95 |
"B<#include E<lt>time.hE<gt>>\n" |
| 96 |
msgstr "" |
| 97 |
"B<#include E<lt>pthread.hE<gt>>\n" |
| 98 |
"B<#include E<lt>time.hE<gt>>\n" |
| 99 |
|
| 100 |
#. type: Plain text |
| 101 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 102 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 103 |
#, no-wrap |
| 104 |
msgid "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clockid>B<);>\n" |
| 105 |
msgstr "B<int pthread_getcpuclockid(pthread_t >I<thread>B<, clockid_t *>I<clockid>B<);>\n" |
| 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 "DESCRIPTION" |
| 112 |
msgstr "DESCRIPTION" |
| 113 |
|
| 114 |
#. The clockid is constructed as follows: |
| 115 |
#. *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE) |
| 116 |
#. where CLOCK_IDFIELD_SIZE is 3. |
| 117 |
#. type: Plain text |
| 118 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 119 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 120 |
msgid "" |
| 121 |
"The B<pthread_getcpuclockid>() function obtains the ID of the CPU-time " |
| 122 |
"clock of the thread whose ID is given in I<thread>, and returns it in the " |
| 123 |
"location pointed to by I<clockid>." |
| 124 |
msgstr "" |
| 125 |
"La fonction B<pthread_getcpuclockid>() récupère l'identifiant d'horloge pour " |
| 126 |
"l'horloge de temps processeur du thread donné dans I<thread> et le renvoie à " |
| 127 |
"l'emplacement vers lequel pointe I<clockid>." |
| 128 |
|
| 129 |
#. type: SH |
| 130 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 131 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 132 |
#, no-wrap |
| 133 |
msgid "RETURN VALUE" |
| 134 |
msgstr "VALEUR RENVOYÉE" |
| 135 |
|
| 136 |
#. type: Plain text |
| 137 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 138 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 139 |
msgid "" |
| 140 |
"On success, this function returns 0; on error, it returns a nonzero error " |
| 141 |
"number." |
| 142 |
msgstr "" |
| 143 |
"En cas de réussite, cette fonction renvoie 0 ; en cas d'erreur, elle renvoie " |
| 144 |
"un numéro d'erreur non nul." |
| 145 |
|
| 146 |
#. type: SH |
| 147 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 148 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 149 |
#, no-wrap |
| 150 |
msgid "ERRORS" |
| 151 |
msgstr "ERREURS" |
| 152 |
|
| 153 |
#. type: TP |
| 154 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 155 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 156 |
#, no-wrap |
| 157 |
msgid "B<ENOENT>" |
| 158 |
msgstr "B<ENOENT>" |
| 159 |
|
| 160 |
# |
| 161 |
#. CLOCK_THREAD_CPUTIME_ID not defined |
| 162 |
#. Looking at nptl/pthread_getcpuclockid.c an ERANGE error would |
| 163 |
#. be possible if kernel thread IDs took more than 29 bits (which |
| 164 |
#. they currently cannot). |
| 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 "Per-thread CPU time clocks are not supported by the system." |
| 169 |
msgstr "" |
| 170 |
"Les horloges de temps CPU par thread ne sont pas pris en charge par le " |
| 171 |
"système." |
| 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<ESRCH>" |
| 178 |
msgstr "B<ESRCH>" |
| 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 "No thread with the ID I<thread> could be found." |
| 184 |
msgstr "" |
| 185 |
"Aucun fil d’exécution avec pour identifiant I<thread> n'a pu être trouvé." |
| 186 |
|
| 187 |
#. type: SH |
| 188 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 189 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 190 |
#, no-wrap |
| 191 |
msgid "ATTRIBUTES" |
| 192 |
msgstr "ATTRIBUTS" |
| 193 |
|
| 194 |
#. type: Plain text |
| 195 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 196 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 197 |
msgid "" |
| 198 |
"For an explanation of the terms used in this section, see B<attributes>(7)." |
| 199 |
msgstr "" |
| 200 |
"Pour une explication des termes utilisés dans cette section, consulter " |
| 201 |
"B<attributes>(7)." |
| 202 |
|
| 203 |
#. type: tbl table |
| 204 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 205 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 206 |
#, no-wrap |
| 207 |
msgid "Interface" |
| 208 |
msgstr "Interface" |
| 209 |
|
| 210 |
#. type: tbl table |
| 211 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 212 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 213 |
#, no-wrap |
| 214 |
msgid "Attribute" |
| 215 |
msgstr "Attribut" |
| 216 |
|
| 217 |
#. type: tbl table |
| 218 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 219 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 220 |
#, no-wrap |
| 221 |
msgid "Value" |
| 222 |
msgstr "Valeur" |
| 223 |
|
| 224 |
#. type: tbl table |
| 225 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 226 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 227 |
#, no-wrap |
| 228 |
msgid ".na\n" |
| 229 |
msgstr ".na\n" |
| 230 |
|
| 231 |
#. type: tbl table |
| 232 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 233 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 234 |
#, no-wrap |
| 235 |
msgid ".nh\n" |
| 236 |
msgstr ".nh\n" |
| 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 "B<pthread_getcpuclockid>()" |
| 243 |
msgstr "B<pthread_getcpuclockid>()" |
| 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 "Thread safety" |
| 250 |
msgstr "Sécurité des threads" |
| 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 "MT-Safe" |
| 257 |
msgstr "MT-Safe" |
| 258 |
|
| 259 |
#. type: SH |
| 260 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 261 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 262 |
#, no-wrap |
| 263 |
msgid "STANDARDS" |
| 264 |
msgstr "NORMES" |
| 265 |
|
| 266 |
#. type: Plain text |
| 267 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 268 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 269 |
msgid "POSIX.1-2008." |
| 270 |
msgstr "POSIX.1-2008." |
| 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 "HISTORY" |
| 277 |
msgstr "HISTORIQUE" |
| 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 "glibc 2.2. POSIX.1-2001." |
| 283 |
msgstr "glibc 2.2. POSIX.1-2001." |
| 284 |
|
| 285 |
#. type: SH |
| 286 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 287 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 288 |
#, no-wrap |
| 289 |
msgid "NOTES" |
| 290 |
msgstr "NOTES" |
| 291 |
|
| 292 |
#. type: Plain text |
| 293 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 294 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 295 |
msgid "" |
| 296 |
"When I<thread> refers to the calling thread, this function returns an " |
| 297 |
"identifier that refers to the same clock manipulated by B<clock_gettime>(2) " |
| 298 |
"and B<clock_settime>(2) when given the clock ID B<CLOCK_THREAD_CPUTIME_ID>." |
| 299 |
msgstr "" |
| 300 |
"Quand I<thread> se rapporte au thread appelant, cette fonction renvoie un " |
| 301 |
"identifiant qui indique la même horloge que celle manipulée par " |
| 302 |
"B<clock_gettime>(2) et B<clock_settime>(2) avec l'identifiant d'horloge " |
| 303 |
"B<CLOCK_THREAD_CPUTIME_ID>." |
| 304 |
|
| 305 |
#. type: SH |
| 306 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 307 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 308 |
#, no-wrap |
| 309 |
msgid "EXAMPLES" |
| 310 |
msgstr "EXEMPLES" |
| 311 |
|
| 312 |
#. type: Plain text |
| 313 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 314 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 315 |
msgid "" |
| 316 |
"The program below creates a thread and then uses B<clock_gettime>(2) to " |
| 317 |
"retrieve the total process CPU time, and the per-thread CPU time consumed by " |
| 318 |
"the two threads. The following shell session shows an example run:" |
| 319 |
msgstr "" |
| 320 |
"Le programme ci-dessous crée un thread puis utilise B<clock_gettime>(2) pour " |
| 321 |
"récupérer le temps CPU total du processus et le temps CPU utilisé par chacun " |
| 322 |
"des deux threads. La session suivante montre un exemple d'exécution :" |
| 323 |
|
| 324 |
#. type: Plain text |
| 325 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 326 |
#: opensuse-tumbleweed |
| 327 |
#, fuzzy, no-wrap |
| 328 |
#| msgid "" |
| 329 |
#| "$ B<./a.out>\n" |
| 330 |
#| "Main thread sleeping\n" |
| 331 |
#| "Subthread starting infinite loop\n" |
| 332 |
#| "Main thread consuming some CPU time...\n" |
| 333 |
#| "Process total CPU time: 1.368\n" |
| 334 |
#| "Main thread CPU time: 0.376\n" |
| 335 |
#| "Subthread CPU time: 0.992\n" |
| 336 |
msgid "" |
| 337 |
"$B< ./a.out>;\n" |
| 338 |
"Main thread sleeping\n" |
| 339 |
"Subthread starting infinite loop\n" |
| 340 |
"Main thread consuming some CPU time...\n" |
| 341 |
"Process total CPU time: 1.368\n" |
| 342 |
"Main thread CPU time: 0.376\n" |
| 343 |
"Subthread CPU time: 0.992\n" |
| 344 |
msgstr "" |
| 345 |
"$ B<./a.out>\n" |
| 346 |
"Main thread sleeping\n" |
| 347 |
"Subthread starting infinite loop\n" |
| 348 |
"Main thread consuming some CPU time...\n" |
| 349 |
"Process total CPU time: 1.368\n" |
| 350 |
"Main thread CPU time: 0.376\n" |
| 351 |
"Subthread CPU time: 0.992\n" |
| 352 |
|
| 353 |
#. type: SS |
| 354 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 355 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 356 |
#, no-wrap |
| 357 |
msgid "Program source" |
| 358 |
msgstr "Source du programme" |
| 359 |
|
| 360 |
#. type: Plain text |
| 361 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 362 |
#: opensuse-tumbleweed |
| 363 |
#, fuzzy, no-wrap |
| 364 |
#| msgid "" |
| 365 |
#| "/* Link with \"-lrt\" */\n" |
| 366 |
#| "\\&\n" |
| 367 |
#| "#include E<lt>errno.hE<gt>\n" |
| 368 |
#| "#include E<lt>pthread.hE<gt>\n" |
| 369 |
#| "#include E<lt>stdint.hE<gt>\n" |
| 370 |
#| "#include E<lt>stdio.hE<gt>\n" |
| 371 |
#| "#include E<lt>stdlib.hE<gt>\n" |
| 372 |
#| "#include E<lt>string.hE<gt>\n" |
| 373 |
#| "#include E<lt>time.hE<gt>\n" |
| 374 |
#| "#include E<lt>unistd.hE<gt>\n" |
| 375 |
#| "\\&\n" |
| 376 |
#| "#define handle_error(msg) \\e\n" |
| 377 |
#| " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 378 |
#| "\\&\n" |
| 379 |
#| "#define handle_error_en(en, msg) \\e\n" |
| 380 |
#| " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 381 |
#| "\\&\n" |
| 382 |
#| "static void *\n" |
| 383 |
#| "thread_start(void *arg)\n" |
| 384 |
#| "{\n" |
| 385 |
#| " printf(\"Subthread starting infinite loop\\en\");\n" |
| 386 |
#| " for (;;)\n" |
| 387 |
#| " continue;\n" |
| 388 |
#| "}\n" |
| 389 |
#| "\\&\n" |
| 390 |
#| "static void\n" |
| 391 |
#| "pclock(char *msg, clockid_t cid)\n" |
| 392 |
#| "{\n" |
| 393 |
#| " struct timespec ts;\n" |
| 394 |
#| "\\&\n" |
| 395 |
#| " printf(\"%s\", msg);\n" |
| 396 |
#| " if (clock_gettime(cid, &ts) == -1)\n" |
| 397 |
#| " handle_error(\"clock_gettime\");\n" |
| 398 |
#| " printf(\"%4jd.%03ld\\en\", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n" |
| 399 |
#| "}\n" |
| 400 |
#| "\\&\n" |
| 401 |
#| "int\n" |
| 402 |
#| "main(void)\n" |
| 403 |
#| "{\n" |
| 404 |
#| " pthread_t thread;\n" |
| 405 |
#| " clockid_t cid;\n" |
| 406 |
#| " int s;\n" |
| 407 |
#| "\\&\n" |
| 408 |
#| " s = pthread_create(&thread, NULL, thread_start, NULL);\n" |
| 409 |
#| " if (s != 0)\n" |
| 410 |
#| " handle_error_en(s, \"pthread_create\");\n" |
| 411 |
#| "\\&\n" |
| 412 |
#| " printf(\"Main thread sleeping\\en\");\n" |
| 413 |
#| " sleep(1);\n" |
| 414 |
#| "\\&\n" |
| 415 |
#| " printf(\"Main thread consuming some CPU time...\\en\");\n" |
| 416 |
#| " for (unsigned int j = 0; j E<lt> 2000000; j++)\n" |
| 417 |
#| " getppid();\n" |
| 418 |
#| "\\&\n" |
| 419 |
#| " pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n" |
| 420 |
#| "\\&\n" |
| 421 |
#| " s = pthread_getcpuclockid(pthread_self(), &cid);\n" |
| 422 |
#| " if (s != 0)\n" |
| 423 |
#| " handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 424 |
#| " pclock(\"Main thread CPU time: \", cid);\n" |
| 425 |
#| "\\&\n" |
| 426 |
#| " /* The preceding 4 lines of code could have been replaced by:\n" |
| 427 |
#| " pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n" |
| 428 |
#| "\\&\n" |
| 429 |
#| " s = pthread_getcpuclockid(thread, &cid);\n" |
| 430 |
#| " if (s != 0)\n" |
| 431 |
#| " handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 432 |
#| " pclock(\"Subthread CPU time: 1 \", cid);\n" |
| 433 |
#| "\\&\n" |
| 434 |
#| " exit(EXIT_SUCCESS); /* Terminates both threads */\n" |
| 435 |
#| "}\n" |
| 436 |
msgid "" |
| 437 |
"/* Link with \"-lrt\" */\n" |
| 438 |
"\\&\n" |
| 439 |
"#include E<lt>err.hE<gt>\n" |
| 440 |
"#include E<lt>errno.hE<gt>\n" |
| 441 |
"#include E<lt>pthread.hE<gt>\n" |
| 442 |
"#include E<lt>stdint.hE<gt>\n" |
| 443 |
"#include E<lt>stdio.hE<gt>\n" |
| 444 |
"#include E<lt>stdlib.hE<gt>\n" |
| 445 |
"#include E<lt>string.hE<gt>\n" |
| 446 |
"#include E<lt>sys/time.hE<gt>\n" |
| 447 |
"#include E<lt>time.hE<gt>\n" |
| 448 |
"#include E<lt>unistd.hE<gt>\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 |
" err(EXIT_FAILURE, \"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 |
" errc(EXIT_FAILURE, 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 |
" errc(EXIT_FAILURE, 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 |
" errc(EXIT_FAILURE, 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 |
"/* Lier avec \"-lrt\" */\n" |
| 506 |
"\\&\n" |
| 507 |
"#include E<lt>errno.hE<gt>\n" |
| 508 |
"#include E<lt>pthread.hE<gt>\n" |
| 509 |
"#include E<lt>stdint.hE<gt>\n" |
| 510 |
"#include E<lt>stdio.hE<gt>\n" |
| 511 |
"#include E<lt>stdlib.hE<gt>\n" |
| 512 |
"#include E<lt>string.hE<gt>\n" |
| 513 |
"#include E<lt>time.hE<gt>\n" |
| 514 |
"#include E<lt>unistd.hE<gt>\n" |
| 515 |
"\\&\n" |
| 516 |
"#define handle_error(msg) \\\\e\n" |
| 517 |
" do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 518 |
"\\&\n" |
| 519 |
"#define handle_error_en(en, msg) \\e\n" |
| 520 |
" do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 521 |
"\\&\n" |
| 522 |
"static void *\n" |
| 523 |
"thread_start(void *arg)\n" |
| 524 |
"{\n" |
| 525 |
" printf(\"Le sous-thread commence une boucle infinie\\en\");\n" |
| 526 |
" for (;;)\n" |
| 527 |
" continue;\n" |
| 528 |
"}\n" |
| 529 |
"\\&\n" |
| 530 |
"static void\n" |
| 531 |
"pclock(char *msg, clockid_t cid)\n" |
| 532 |
"{\n" |
| 533 |
" struct timespec ts;\n" |
| 534 |
"\\&\n" |
| 535 |
" printf(\"%s\", msg);\n" |
| 536 |
" if (clock_gettime(cid, &ts) == -1)\n" |
| 537 |
" handle_error(\"clock_gettime\");\n" |
| 538 |
" printf(\"%4jd.%03ld\\en\", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n" |
| 539 |
"}\n" |
| 540 |
"\\&\n" |
| 541 |
"int\n" |
| 542 |
"main(void)\n" |
| 543 |
"{\n" |
| 544 |
" pthread_t thread;\n" |
| 545 |
" clockid_t cid;\n" |
| 546 |
" int s;\n" |
| 547 |
"\\&\n" |
| 548 |
" s = pthread_create(&thread, NULL, thread_start, NULL);\n" |
| 549 |
" if (s != 0)\n" |
| 550 |
" handle_error_en(s, \"pthread_create\");\n" |
| 551 |
"\\&\n" |
| 552 |
" printf(\"Le thread principal est en sommeil\\en\");\n" |
| 553 |
" sleep(1);\n" |
| 554 |
"\\&\n" |
| 555 |
" printf(\"Le thread principal consomme du temps processeur...\\en\");\n" |
| 556 |
" for (unsigned int j = 0; j E<lt> 2000000; j++)\n" |
| 557 |
" getppid();\n" |
| 558 |
"\\&\n" |
| 559 |
" pclock(\"Temps total du processeur : \", CLOCK_PROCESS_CPUTIME_ID);\n" |
| 560 |
"\\&\n" |
| 561 |
" s = pthread_getcpuclockid(pthread_self(), &cid);\n" |
| 562 |
" if (s != 0)\n" |
| 563 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 564 |
" pclock(\"Temps processeur du thread principal : \", cid);\n" |
| 565 |
"\\&\n" |
| 566 |
" /* Les 4 lignes de code précédentes auraient être pu être remplacées par :\n" |
| 567 |
" pclock(\"Temps processeur du thread principal : \", CLOCK_THREAD_CPUTIME_ID); */\n" |
| 568 |
"\\&\n" |
| 569 |
" s = pthread_getcpuclockid(thread, &cid);\n" |
| 570 |
" if (s != 0)\n" |
| 571 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 572 |
" pclock(\"Temps processeur du sous-pthread : 1 \", cid);\n" |
| 573 |
"\\&\n" |
| 574 |
" exit(EXIT_SUCCESS); /* Terminer les deux threads */\n" |
| 575 |
"}\n" |
| 576 |
|
| 577 |
#. SRC END |
| 578 |
#. type: SH |
| 579 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 580 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 581 |
#, no-wrap |
| 582 |
msgid "SEE ALSO" |
| 583 |
msgstr "VOIR AUSSI" |
| 584 |
|
| 585 |
#. type: Plain text |
| 586 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 587 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 588 |
msgid "" |
| 589 |
"B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), " |
| 590 |
"B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)" |
| 591 |
msgstr "" |
| 592 |
"B<clock_gettime>(2), B<clock_settime>(2), B<timer_create>(2), " |
| 593 |
"B<clock_getcpuclockid>(3), B<pthread_self>(3), B<pthreads>(7), B<time>(7)" |
| 594 |
|
| 595 |
#. type: TH |
| 596 |
#: debian-trixie |
| 597 |
#, no-wrap |
| 598 |
msgid "2024-06-15" |
| 599 |
msgstr "15 juin 2024" |
| 600 |
|
| 601 |
#. type: TH |
| 602 |
#: debian-trixie |
| 603 |
#, no-wrap |
| 604 |
msgid "Linux man-pages 6.9.1" |
| 605 |
msgstr "Pages du manuel de Linux 6.9.1" |
| 606 |
|
| 607 |
#. type: Plain text |
| 608 |
#: debian-trixie |
| 609 |
msgid "POSIX threads library (I<libpthread>, I<-lpthread>)" |
| 610 |
msgstr "Bibliothèque de threads POSIX (I<libpthread>, I<-lpthread>)" |
| 611 |
|
| 612 |
#. type: Plain text |
| 613 |
#: debian-trixie fedora-44 fedora-rawhide |
| 614 |
#, no-wrap |
| 615 |
msgid "" |
| 616 |
"$ B<./a.out>\n" |
| 617 |
"Main thread sleeping\n" |
| 618 |
"Subthread starting infinite loop\n" |
| 619 |
"Main thread consuming some CPU time...\n" |
| 620 |
"Process total CPU time: 1.368\n" |
| 621 |
"Main thread CPU time: 0.376\n" |
| 622 |
"Subthread CPU time: 0.992\n" |
| 623 |
msgstr "" |
| 624 |
"$ B<./a.out>\n" |
| 625 |
"Main thread sleeping\n" |
| 626 |
"Subthread starting infinite loop\n" |
| 627 |
"Main thread consuming some CPU time...\n" |
| 628 |
"Process total CPU time: 1.368\n" |
| 629 |
"Main thread CPU time: 0.376\n" |
| 630 |
"Subthread CPU time: 0.992\n" |
| 631 |
|
| 632 |
#. type: Plain text |
| 633 |
#: debian-trixie |
| 634 |
#, fuzzy, no-wrap |
| 635 |
#| msgid "" |
| 636 |
#| "/* Link with \"-lrt\" */\n" |
| 637 |
#| "\\&\n" |
| 638 |
#| "#include E<lt>errno.hE<gt>\n" |
| 639 |
#| "#include E<lt>pthread.hE<gt>\n" |
| 640 |
#| "#include E<lt>stdint.hE<gt>\n" |
| 641 |
#| "#include E<lt>stdio.hE<gt>\n" |
| 642 |
#| "#include E<lt>stdlib.hE<gt>\n" |
| 643 |
#| "#include E<lt>string.hE<gt>\n" |
| 644 |
#| "#include E<lt>time.hE<gt>\n" |
| 645 |
#| "#include E<lt>unistd.hE<gt>\n" |
| 646 |
#| "\\&\n" |
| 647 |
#| "#define handle_error(msg) \\e\n" |
| 648 |
#| " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 649 |
#| "\\&\n" |
| 650 |
#| "#define handle_error_en(en, msg) \\e\n" |
| 651 |
#| " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 652 |
#| "\\&\n" |
| 653 |
#| "static void *\n" |
| 654 |
#| "thread_start(void *arg)\n" |
| 655 |
#| "{\n" |
| 656 |
#| " printf(\"Subthread starting infinite loop\\en\");\n" |
| 657 |
#| " for (;;)\n" |
| 658 |
#| " continue;\n" |
| 659 |
#| "}\n" |
| 660 |
#| "\\&\n" |
| 661 |
#| "static void\n" |
| 662 |
#| "pclock(char *msg, clockid_t cid)\n" |
| 663 |
#| "{\n" |
| 664 |
#| " struct timespec ts;\n" |
| 665 |
#| "\\&\n" |
| 666 |
#| " printf(\"%s\", msg);\n" |
| 667 |
#| " if (clock_gettime(cid, &ts) == -1)\n" |
| 668 |
#| " handle_error(\"clock_gettime\");\n" |
| 669 |
#| " printf(\"%4jd.%03ld\\en\", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n" |
| 670 |
#| "}\n" |
| 671 |
#| "\\&\n" |
| 672 |
#| "int\n" |
| 673 |
#| "main(void)\n" |
| 674 |
#| "{\n" |
| 675 |
#| " pthread_t thread;\n" |
| 676 |
#| " clockid_t cid;\n" |
| 677 |
#| " int s;\n" |
| 678 |
#| "\\&\n" |
| 679 |
#| " s = pthread_create(&thread, NULL, thread_start, NULL);\n" |
| 680 |
#| " if (s != 0)\n" |
| 681 |
#| " handle_error_en(s, \"pthread_create\");\n" |
| 682 |
#| "\\&\n" |
| 683 |
#| " printf(\"Main thread sleeping\\en\");\n" |
| 684 |
#| " sleep(1);\n" |
| 685 |
#| "\\&\n" |
| 686 |
#| " printf(\"Main thread consuming some CPU time...\\en\");\n" |
| 687 |
#| " for (unsigned int j = 0; j E<lt> 2000000; j++)\n" |
| 688 |
#| " getppid();\n" |
| 689 |
#| "\\&\n" |
| 690 |
#| " pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n" |
| 691 |
#| "\\&\n" |
| 692 |
#| " s = pthread_getcpuclockid(pthread_self(), &cid);\n" |
| 693 |
#| " if (s != 0)\n" |
| 694 |
#| " handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 695 |
#| " pclock(\"Main thread CPU time: \", cid);\n" |
| 696 |
#| "\\&\n" |
| 697 |
#| " /* The preceding 4 lines of code could have been replaced by:\n" |
| 698 |
#| " pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n" |
| 699 |
#| "\\&\n" |
| 700 |
#| " s = pthread_getcpuclockid(thread, &cid);\n" |
| 701 |
#| " if (s != 0)\n" |
| 702 |
#| " handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 703 |
#| " pclock(\"Subthread CPU time: 1 \", cid);\n" |
| 704 |
#| "\\&\n" |
| 705 |
#| " exit(EXIT_SUCCESS); /* Terminates both threads */\n" |
| 706 |
#| "}\n" |
| 707 |
msgid "" |
| 708 |
"/* Link with \"-lrt\" */\n" |
| 709 |
"\\&\n" |
| 710 |
"#include E<lt>errno.hE<gt>\n" |
| 711 |
"#include E<lt>pthread.hE<gt>\n" |
| 712 |
"#include E<lt>stdint.hE<gt>\n" |
| 713 |
"#include E<lt>stdio.hE<gt>\n" |
| 714 |
"#include E<lt>stdlib.hE<gt>\n" |
| 715 |
"#include E<lt>string.hE<gt>\n" |
| 716 |
"#include E<lt>time.hE<gt>\n" |
| 717 |
"#include E<lt>unistd.hE<gt>\n" |
| 718 |
"\\&\n" |
| 719 |
"#define handle_error(msg) \\[rs]\n" |
| 720 |
" do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 721 |
"\\&\n" |
| 722 |
"#define handle_error_en(en, msg) \\[rs]\n" |
| 723 |
" do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 724 |
"\\&\n" |
| 725 |
"static void *\n" |
| 726 |
"thread_start(void *arg)\n" |
| 727 |
"{\n" |
| 728 |
" printf(\"Subthread starting infinite loop\\[rs]n\");\n" |
| 729 |
" for (;;)\n" |
| 730 |
" continue;\n" |
| 731 |
"}\n" |
| 732 |
"\\&\n" |
| 733 |
"static void\n" |
| 734 |
"pclock(char *msg, clockid_t cid)\n" |
| 735 |
"{\n" |
| 736 |
" struct timespec ts;\n" |
| 737 |
"\\&\n" |
| 738 |
" printf(\"%s\", msg);\n" |
| 739 |
" if (clock_gettime(cid, &ts) == -1)\n" |
| 740 |
" handle_error(\"clock_gettime\");\n" |
| 741 |
" printf(\"%4jd.%03ld\\[rs]n\", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n" |
| 742 |
"}\n" |
| 743 |
"\\&\n" |
| 744 |
"int\n" |
| 745 |
"main(void)\n" |
| 746 |
"{\n" |
| 747 |
" pthread_t thread;\n" |
| 748 |
" clockid_t cid;\n" |
| 749 |
" int s;\n" |
| 750 |
"\\&\n" |
| 751 |
" s = pthread_create(&thread, NULL, thread_start, NULL);\n" |
| 752 |
" if (s != 0)\n" |
| 753 |
" handle_error_en(s, \"pthread_create\");\n" |
| 754 |
"\\&\n" |
| 755 |
" printf(\"Main thread sleeping\\[rs]n\");\n" |
| 756 |
" sleep(1);\n" |
| 757 |
"\\&\n" |
| 758 |
" printf(\"Main thread consuming some CPU time...\\[rs]n\");\n" |
| 759 |
" for (unsigned int j = 0; j E<lt> 2000000; j++)\n" |
| 760 |
" getppid();\n" |
| 761 |
"\\&\n" |
| 762 |
" pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n" |
| 763 |
"\\&\n" |
| 764 |
" s = pthread_getcpuclockid(pthread_self(), &cid);\n" |
| 765 |
" if (s != 0)\n" |
| 766 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 767 |
" pclock(\"Main thread CPU time: \", cid);\n" |
| 768 |
"\\&\n" |
| 769 |
" /* The preceding 4 lines of code could have been replaced by:\n" |
| 770 |
" pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n" |
| 771 |
"\\&\n" |
| 772 |
" s = pthread_getcpuclockid(thread, &cid);\n" |
| 773 |
" if (s != 0)\n" |
| 774 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 775 |
" pclock(\"Subthread CPU time: 1 \", cid);\n" |
| 776 |
"\\&\n" |
| 777 |
" exit(EXIT_SUCCESS); /* Terminates both threads */\n" |
| 778 |
"}\n" |
| 779 |
msgstr "" |
| 780 |
"/* Lier avec \"-lrt\" */\n" |
| 781 |
"\\&\n" |
| 782 |
"#include E<lt>errno.hE<gt>\n" |
| 783 |
"#include E<lt>pthread.hE<gt>\n" |
| 784 |
"#include E<lt>stdint.hE<gt>\n" |
| 785 |
"#include E<lt>stdio.hE<gt>\n" |
| 786 |
"#include E<lt>stdlib.hE<gt>\n" |
| 787 |
"#include E<lt>string.hE<gt>\n" |
| 788 |
"#include E<lt>time.hE<gt>\n" |
| 789 |
"#include E<lt>unistd.hE<gt>\n" |
| 790 |
"\\&\n" |
| 791 |
"#define handle_error(msg) \\\\e\n" |
| 792 |
" do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 793 |
"\\&\n" |
| 794 |
"#define handle_error_en(en, msg) \\e\n" |
| 795 |
" do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 796 |
"\\&\n" |
| 797 |
"static void *\n" |
| 798 |
"thread_start(void *arg)\n" |
| 799 |
"{\n" |
| 800 |
" printf(\"Le sous-thread commence une boucle infinie\\en\");\n" |
| 801 |
" for (;;)\n" |
| 802 |
" continue;\n" |
| 803 |
"}\n" |
| 804 |
"\\&\n" |
| 805 |
"static void\n" |
| 806 |
"pclock(char *msg, clockid_t cid)\n" |
| 807 |
"{\n" |
| 808 |
" struct timespec ts;\n" |
| 809 |
"\\&\n" |
| 810 |
" printf(\"%s\", msg);\n" |
| 811 |
" if (clock_gettime(cid, &ts) == -1)\n" |
| 812 |
" handle_error(\"clock_gettime\");\n" |
| 813 |
" printf(\"%4jd.%03ld\\en\", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n" |
| 814 |
"}\n" |
| 815 |
"\\&\n" |
| 816 |
"int\n" |
| 817 |
"main(void)\n" |
| 818 |
"{\n" |
| 819 |
" pthread_t thread;\n" |
| 820 |
" clockid_t cid;\n" |
| 821 |
" int s;\n" |
| 822 |
"\\&\n" |
| 823 |
" s = pthread_create(&thread, NULL, thread_start, NULL);\n" |
| 824 |
" if (s != 0)\n" |
| 825 |
" handle_error_en(s, \"pthread_create\");\n" |
| 826 |
"\\&\n" |
| 827 |
" printf(\"Le thread principal est en sommeil\\en\");\n" |
| 828 |
" sleep(1);\n" |
| 829 |
"\\&\n" |
| 830 |
" printf(\"Le thread principal consomme du temps processeur...\\en\");\n" |
| 831 |
" for (unsigned int j = 0; j E<lt> 2000000; j++)\n" |
| 832 |
" getppid();\n" |
| 833 |
"\\&\n" |
| 834 |
" pclock(\"Temps total du processeur : \", CLOCK_PROCESS_CPUTIME_ID);\n" |
| 835 |
"\\&\n" |
| 836 |
" s = pthread_getcpuclockid(pthread_self(), &cid);\n" |
| 837 |
" if (s != 0)\n" |
| 838 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 839 |
" pclock(\"Temps processeur du thread principal : \", cid);\n" |
| 840 |
"\\&\n" |
| 841 |
" /* Les 4 lignes de code précédentes auraient être pu être remplacées par :\n" |
| 842 |
" pclock(\"Temps processeur du thread principal : \", CLOCK_THREAD_CPUTIME_ID); */\n" |
| 843 |
"\\&\n" |
| 844 |
" s = pthread_getcpuclockid(thread, &cid);\n" |
| 845 |
" if (s != 0)\n" |
| 846 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 847 |
" pclock(\"Temps processeur du sous-pthread : 1 \", cid);\n" |
| 848 |
"\\&\n" |
| 849 |
" exit(EXIT_SUCCESS); /* Terminer les deux threads */\n" |
| 850 |
"}\n" |
| 851 |
|
| 852 |
#. type: TH |
| 853 |
#: fedora-44 fedora-rawhide |
| 854 |
#, no-wrap |
| 855 |
msgid "2024-11-03" |
| 856 |
msgstr "3 novembre 2024" |
| 857 |
|
| 858 |
#. type: TH |
| 859 |
#: fedora-44 fedora-rawhide |
| 860 |
#, no-wrap |
| 861 |
msgid "Linux man-pages 6.13" |
| 862 |
msgstr "Pages du manuel de Linux 6.13" |
| 863 |
|
| 864 |
#. type: Plain text |
| 865 |
#: fedora-44 fedora-rawhide |
| 866 |
#, fuzzy, no-wrap |
| 867 |
#| msgid "" |
| 868 |
#| "/* Link with \"-lrt\" */\n" |
| 869 |
#| "\\&\n" |
| 870 |
#| "#include E<lt>errno.hE<gt>\n" |
| 871 |
#| "#include E<lt>pthread.hE<gt>\n" |
| 872 |
#| "#include E<lt>stdint.hE<gt>\n" |
| 873 |
#| "#include E<lt>stdio.hE<gt>\n" |
| 874 |
#| "#include E<lt>stdlib.hE<gt>\n" |
| 875 |
#| "#include E<lt>string.hE<gt>\n" |
| 876 |
#| "#include E<lt>time.hE<gt>\n" |
| 877 |
#| "#include E<lt>unistd.hE<gt>\n" |
| 878 |
#| "\\&\n" |
| 879 |
#| "#define handle_error(msg) \\e\n" |
| 880 |
#| " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 881 |
#| "\\&\n" |
| 882 |
#| "#define handle_error_en(en, msg) \\e\n" |
| 883 |
#| " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 884 |
#| "\\&\n" |
| 885 |
#| "static void *\n" |
| 886 |
#| "thread_start(void *arg)\n" |
| 887 |
#| "{\n" |
| 888 |
#| " printf(\"Subthread starting infinite loop\\en\");\n" |
| 889 |
#| " for (;;)\n" |
| 890 |
#| " continue;\n" |
| 891 |
#| "}\n" |
| 892 |
#| "\\&\n" |
| 893 |
#| "static void\n" |
| 894 |
#| "pclock(char *msg, clockid_t cid)\n" |
| 895 |
#| "{\n" |
| 896 |
#| " struct timespec ts;\n" |
| 897 |
#| "\\&\n" |
| 898 |
#| " printf(\"%s\", msg);\n" |
| 899 |
#| " if (clock_gettime(cid, &ts) == -1)\n" |
| 900 |
#| " handle_error(\"clock_gettime\");\n" |
| 901 |
#| " printf(\"%4jd.%03ld\\en\", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n" |
| 902 |
#| "}\n" |
| 903 |
#| "\\&\n" |
| 904 |
#| "int\n" |
| 905 |
#| "main(void)\n" |
| 906 |
#| "{\n" |
| 907 |
#| " pthread_t thread;\n" |
| 908 |
#| " clockid_t cid;\n" |
| 909 |
#| " int s;\n" |
| 910 |
#| "\\&\n" |
| 911 |
#| " s = pthread_create(&thread, NULL, thread_start, NULL);\n" |
| 912 |
#| " if (s != 0)\n" |
| 913 |
#| " handle_error_en(s, \"pthread_create\");\n" |
| 914 |
#| "\\&\n" |
| 915 |
#| " printf(\"Main thread sleeping\\en\");\n" |
| 916 |
#| " sleep(1);\n" |
| 917 |
#| "\\&\n" |
| 918 |
#| " printf(\"Main thread consuming some CPU time...\\en\");\n" |
| 919 |
#| " for (unsigned int j = 0; j E<lt> 2000000; j++)\n" |
| 920 |
#| " getppid();\n" |
| 921 |
#| "\\&\n" |
| 922 |
#| " pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n" |
| 923 |
#| "\\&\n" |
| 924 |
#| " s = pthread_getcpuclockid(pthread_self(), &cid);\n" |
| 925 |
#| " if (s != 0)\n" |
| 926 |
#| " handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 927 |
#| " pclock(\"Main thread CPU time: \", cid);\n" |
| 928 |
#| "\\&\n" |
| 929 |
#| " /* The preceding 4 lines of code could have been replaced by:\n" |
| 930 |
#| " pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n" |
| 931 |
#| "\\&\n" |
| 932 |
#| " s = pthread_getcpuclockid(thread, &cid);\n" |
| 933 |
#| " if (s != 0)\n" |
| 934 |
#| " handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 935 |
#| " pclock(\"Subthread CPU time: 1 \", cid);\n" |
| 936 |
#| "\\&\n" |
| 937 |
#| " exit(EXIT_SUCCESS); /* Terminates both threads */\n" |
| 938 |
#| "}\n" |
| 939 |
msgid "" |
| 940 |
"/* Link with \"-lrt\" */\n" |
| 941 |
"\\&\n" |
| 942 |
"#include E<lt>errno.hE<gt>\n" |
| 943 |
"#include E<lt>pthread.hE<gt>\n" |
| 944 |
"#include E<lt>stdint.hE<gt>\n" |
| 945 |
"#include E<lt>stdio.hE<gt>\n" |
| 946 |
"#include E<lt>stdlib.hE<gt>\n" |
| 947 |
"#include E<lt>string.hE<gt>\n" |
| 948 |
"#include E<lt>sys/time.hE<gt>\n" |
| 949 |
"#include E<lt>time.hE<gt>\n" |
| 950 |
"#include E<lt>unistd.hE<gt>\n" |
| 951 |
"\\&\n" |
| 952 |
"#define handle_error(msg) \\[rs]\n" |
| 953 |
" do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 954 |
"\\&\n" |
| 955 |
"#define handle_error_en(en, msg) \\[rs]\n" |
| 956 |
" do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 957 |
"\\&\n" |
| 958 |
"static void *\n" |
| 959 |
"thread_start(void *arg)\n" |
| 960 |
"{\n" |
| 961 |
" printf(\"Subthread starting infinite loop\\[rs]n\");\n" |
| 962 |
" for (;;)\n" |
| 963 |
" continue;\n" |
| 964 |
"}\n" |
| 965 |
"\\&\n" |
| 966 |
"static void\n" |
| 967 |
"pclock(char *msg, clockid_t cid)\n" |
| 968 |
"{\n" |
| 969 |
" struct timespec ts;\n" |
| 970 |
"\\&\n" |
| 971 |
" printf(\"%s\", msg);\n" |
| 972 |
" if (clock_gettime(cid, &ts) == -1)\n" |
| 973 |
" handle_error(\"clock_gettime\");\n" |
| 974 |
" printf(\"%4jd.%03ld\\[rs]n\", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n" |
| 975 |
"}\n" |
| 976 |
"\\&\n" |
| 977 |
"int\n" |
| 978 |
"main(void)\n" |
| 979 |
"{\n" |
| 980 |
" pthread_t thread;\n" |
| 981 |
" clockid_t cid;\n" |
| 982 |
" int s;\n" |
| 983 |
"\\&\n" |
| 984 |
" s = pthread_create(&thread, NULL, thread_start, NULL);\n" |
| 985 |
" if (s != 0)\n" |
| 986 |
" handle_error_en(s, \"pthread_create\");\n" |
| 987 |
"\\&\n" |
| 988 |
" printf(\"Main thread sleeping\\[rs]n\");\n" |
| 989 |
" sleep(1);\n" |
| 990 |
"\\&\n" |
| 991 |
" printf(\"Main thread consuming some CPU time...\\[rs]n\");\n" |
| 992 |
" for (unsigned int j = 0; j E<lt> 2000000; j++)\n" |
| 993 |
" getppid();\n" |
| 994 |
"\\&\n" |
| 995 |
" pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n" |
| 996 |
"\\&\n" |
| 997 |
" s = pthread_getcpuclockid(pthread_self(), &cid);\n" |
| 998 |
" if (s != 0)\n" |
| 999 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 1000 |
" pclock(\"Main thread CPU time: \", cid);\n" |
| 1001 |
"\\&\n" |
| 1002 |
" /* The preceding 4 lines of code could have been replaced by:\n" |
| 1003 |
" pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n" |
| 1004 |
"\\&\n" |
| 1005 |
" s = pthread_getcpuclockid(thread, &cid);\n" |
| 1006 |
" if (s != 0)\n" |
| 1007 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 1008 |
" pclock(\"Subthread CPU time: 1 \", cid);\n" |
| 1009 |
"\\&\n" |
| 1010 |
" exit(EXIT_SUCCESS); /* Terminates both threads */\n" |
| 1011 |
"}\n" |
| 1012 |
msgstr "" |
| 1013 |
"/* Lier avec \"-lrt\" */\n" |
| 1014 |
"\\&\n" |
| 1015 |
"#include E<lt>errno.hE<gt>\n" |
| 1016 |
"#include E<lt>pthread.hE<gt>\n" |
| 1017 |
"#include E<lt>stdint.hE<gt>\n" |
| 1018 |
"#include E<lt>stdio.hE<gt>\n" |
| 1019 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1020 |
"#include E<lt>string.hE<gt>\n" |
| 1021 |
"#include E<lt>time.hE<gt>\n" |
| 1022 |
"#include E<lt>unistd.hE<gt>\n" |
| 1023 |
"\\&\n" |
| 1024 |
"#define handle_error(msg) \\\\e\n" |
| 1025 |
" do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 1026 |
"\\&\n" |
| 1027 |
"#define handle_error_en(en, msg) \\e\n" |
| 1028 |
" do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n" |
| 1029 |
"\\&\n" |
| 1030 |
"static void *\n" |
| 1031 |
"thread_start(void *arg)\n" |
| 1032 |
"{\n" |
| 1033 |
" printf(\"Le sous-thread commence une boucle infinie\\en\");\n" |
| 1034 |
" for (;;)\n" |
| 1035 |
" continue;\n" |
| 1036 |
"}\n" |
| 1037 |
"\\&\n" |
| 1038 |
"static void\n" |
| 1039 |
"pclock(char *msg, clockid_t cid)\n" |
| 1040 |
"{\n" |
| 1041 |
" struct timespec ts;\n" |
| 1042 |
"\\&\n" |
| 1043 |
" printf(\"%s\", msg);\n" |
| 1044 |
" if (clock_gettime(cid, &ts) == -1)\n" |
| 1045 |
" handle_error(\"clock_gettime\");\n" |
| 1046 |
" printf(\"%4jd.%03ld\\en\", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n" |
| 1047 |
"}\n" |
| 1048 |
"\\&\n" |
| 1049 |
"int\n" |
| 1050 |
"main(void)\n" |
| 1051 |
"{\n" |
| 1052 |
" pthread_t thread;\n" |
| 1053 |
" clockid_t cid;\n" |
| 1054 |
" int s;\n" |
| 1055 |
"\\&\n" |
| 1056 |
" s = pthread_create(&thread, NULL, thread_start, NULL);\n" |
| 1057 |
" if (s != 0)\n" |
| 1058 |
" handle_error_en(s, \"pthread_create\");\n" |
| 1059 |
"\\&\n" |
| 1060 |
" printf(\"Le thread principal est en sommeil\\en\");\n" |
| 1061 |
" sleep(1);\n" |
| 1062 |
"\\&\n" |
| 1063 |
" printf(\"Le thread principal consomme du temps processeur...\\en\");\n" |
| 1064 |
" for (unsigned int j = 0; j E<lt> 2000000; j++)\n" |
| 1065 |
" getppid();\n" |
| 1066 |
"\\&\n" |
| 1067 |
" pclock(\"Temps total du processeur : \", CLOCK_PROCESS_CPUTIME_ID);\n" |
| 1068 |
"\\&\n" |
| 1069 |
" s = pthread_getcpuclockid(pthread_self(), &cid);\n" |
| 1070 |
" if (s != 0)\n" |
| 1071 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 1072 |
" pclock(\"Temps processeur du thread principal : \", cid);\n" |
| 1073 |
"\\&\n" |
| 1074 |
" /* Les 4 lignes de code précédentes auraient être pu être remplacées par :\n" |
| 1075 |
" pclock(\"Temps processeur du thread principal : \", CLOCK_THREAD_CPUTIME_ID); */\n" |
| 1076 |
"\\&\n" |
| 1077 |
" s = pthread_getcpuclockid(thread, &cid);\n" |
| 1078 |
" if (s != 0)\n" |
| 1079 |
" handle_error_en(s, \"pthread_getcpuclockid\");\n" |
| 1080 |
" pclock(\"Temps processeur du sous-pthread : 1 \", cid);\n" |
| 1081 |
"\\&\n" |
| 1082 |
" exit(EXIT_SUCCESS); /* Terminer les deux threads */\n" |
| 1083 |
"}\n" |
| 1084 |
|
| 1085 |
#. type: TH |
| 1086 |
#: mageia-cauldron |
| 1087 |
#, no-wrap |
| 1088 |
msgid "Linux man-pages 6.17" |
| 1089 |
msgstr "Pages du manuel de Linux 6.17" |
| 1090 |
|
| 1091 |
#. type: TH |
| 1092 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 1093 |
#, no-wrap |
| 1094 |
msgid "Linux man-pages (unreleased)" |
| 1095 |
msgstr "Pages du manuel de Linux (non publiées)" |