| 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-Pierre Giraud <[email protected]>, 2024. |
| 20 |
msgid "" |
| 21 |
msgstr "" |
| 22 |
"Project-Id-Version: manpages-l10n 4.22.0\n" |
| 23 |
"POT-Creation-Date: 2026-06-05 06:38+0200\n" |
| 24 |
"PO-Revision-Date: 2024-04-22 10:18+0200\n" |
| 25 |
"Last-Translator: Jean-Pierre Giraud <[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: Lokalize 22.12.3\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_getattr_np" |
| 39 |
msgstr "pthread_getattr_np" |
| 40 |
|
| 41 |
#. type: TH |
| 42 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 43 |
#: opensuse-tumbleweed |
| 44 |
#, no-wrap |
| 45 |
msgid "2025-09-25" |
| 46 |
msgstr "25 septembre 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_getattr_np - get attributes of created thread" |
| 65 |
msgstr "pthread_getattr_np - Obtenir les attributs d'un thread créé" |
| 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 "LIBRARY" |
| 72 |
msgstr "BIBLIOTHÈQUE" |
| 73 |
|
| 74 |
#. type: Plain text |
| 75 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 76 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 77 |
msgid "POSIX threads library (I<libpthread>,\\ I<-lpthread>)" |
| 78 |
msgstr "Bibliothèque de threads POSIX (I<libpthread>,\\ I<-lpthread>)" |
| 79 |
|
| 80 |
#. type: SH |
| 81 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 82 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 83 |
#, no-wrap |
| 84 |
msgid "SYNOPSIS" |
| 85 |
msgstr "SYNOPSIS" |
| 86 |
|
| 87 |
#. type: Plain text |
| 88 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 89 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 90 |
#, no-wrap |
| 91 |
msgid "" |
| 92 |
"B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n" |
| 93 |
"B<#include E<lt>pthread.hE<gt>>\n" |
| 94 |
msgstr "" |
| 95 |
"B<#define _GNU_SOURCE> /* Consultez feature_test_macros(7) */\n" |
| 96 |
"B<#include E<lt>pthread.hE<gt>>\n" |
| 97 |
|
| 98 |
#. type: Plain text |
| 99 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 100 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 101 |
#, no-wrap |
| 102 |
msgid "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n" |
| 103 |
msgstr "B<int pthread_getattr_np(pthread_t >I<thread>B<, pthread_attr_t *>I<attr>B<);>\n" |
| 104 |
|
| 105 |
#. type: SH |
| 106 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 107 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 108 |
#, no-wrap |
| 109 |
msgid "DESCRIPTION" |
| 110 |
msgstr "DESCRIPTION" |
| 111 |
|
| 112 |
#. type: Plain text |
| 113 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 114 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 115 |
msgid "" |
| 116 |
"The B<pthread_getattr_np>() function initializes the thread attributes " |
| 117 |
"object referred to by I<attr> so that it contains actual attribute values " |
| 118 |
"describing the running thread I<thread>." |
| 119 |
msgstr "" |
| 120 |
"La fonction B<pthread_getattr_np>() initialise l'objet d'attributs de thread " |
| 121 |
"auquel I<attr> fait référence de telle sorte qu'il contienne les valeurs " |
| 122 |
"réelles d'attributs qui décrivent le thread I<thread> en cours d'exécution." |
| 123 |
|
| 124 |
#. type: Plain text |
| 125 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 126 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 127 |
msgid "" |
| 128 |
"The returned attribute values may differ from the corresponding attribute " |
| 129 |
"values passed in the I<attr> object that was used to create the thread using " |
| 130 |
"B<pthread_create>(3). In particular, the following attributes may differ:" |
| 131 |
msgstr "" |
| 132 |
"Les valeurs d'attribut renvoyées peuvent être différentes des valeurs " |
| 133 |
"d'attribut correspondantes fournies dans l'objet I<attr> utilisé pour créer " |
| 134 |
"le thread avec B<pthread_create>(3). En particulier, les attributs suivants " |
| 135 |
"peuvent changer :" |
| 136 |
|
| 137 |
#. type: IP |
| 138 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 139 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 140 |
#, no-wrap |
| 141 |
msgid "\\[bu]" |
| 142 |
msgstr "-" |
| 143 |
|
| 144 |
#. type: Plain text |
| 145 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 146 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 147 |
msgid "" |
| 148 |
"the detach state, since a joinable thread may have detached itself after " |
| 149 |
"creation;" |
| 150 |
msgstr "" |
| 151 |
"l'état détaché ou non, puisqu'un thread fusionné peut s'être détaché lui-" |
| 152 |
"même après sa création ;" |
| 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 "" |
| 158 |
"the stack size, which the implementation may align to a suitable boundary." |
| 159 |
msgstr "" |
| 160 |
"la taille de la pile, que l'implémentation peut aligner sur une limite plus " |
| 161 |
"appropriée." |
| 162 |
|
| 163 |
#. type: Plain text |
| 164 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 165 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 166 |
msgid "" |
| 167 |
"and the guard size, which the implementation may round upward to a multiple " |
| 168 |
"of the page size, or ignore (i.e., treat as 0), if the application is " |
| 169 |
"allocating its own stack." |
| 170 |
msgstr "" |
| 171 |
"la taille de garde, que l'implémentation peut arrondir au multiple supérieur " |
| 172 |
"de la taille de page ou ignorer (c'est-à-dire, considérer qu'elle vaut 0) si " |
| 173 |
"l'application alloue sa propre pile." |
| 174 |
|
| 175 |
#. type: Plain text |
| 176 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 177 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 178 |
msgid "" |
| 179 |
"Furthermore, if the stack address attribute was not set in the thread " |
| 180 |
"attributes object used to create the thread, then the returned thread " |
| 181 |
"attributes object will report the actual stack address that the " |
| 182 |
"implementation selected for the thread." |
| 183 |
msgstr "" |
| 184 |
"De plus, si l'attribut contenant l'adresse de la pile n'était pas défini " |
| 185 |
"dans l'objet d'attributs de thread utilisé pour créer le thread, alors " |
| 186 |
"l'objet d'attributs de thread renvoyé contiendra l'adresse effective de la " |
| 187 |
"pile que l'implémentation a choisie pour le thread." |
| 188 |
|
| 189 |
#. type: Plain text |
| 190 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 191 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 192 |
msgid "" |
| 193 |
"When the thread attributes object returned by B<pthread_getattr_np>() is no " |
| 194 |
"longer required, it should be destroyed using B<pthread_attr_destroy>(3)." |
| 195 |
msgstr "" |
| 196 |
"Quand l'objet d'attributs de thread renvoyé par B<pthread_getattr_np>() " |
| 197 |
"n'est plus nécessaire, il devrait être détruit à l'aide de " |
| 198 |
"B<pthread_attr_destroy>(3)." |
| 199 |
|
| 200 |
#. type: SH |
| 201 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 202 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 203 |
#, no-wrap |
| 204 |
msgid "RETURN VALUE" |
| 205 |
msgstr "VALEUR RENVOYÉE" |
| 206 |
|
| 207 |
#. type: Plain text |
| 208 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 209 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 210 |
msgid "" |
| 211 |
"On success, this function returns 0; on error, it returns a nonzero error " |
| 212 |
"number." |
| 213 |
msgstr "" |
| 214 |
"En cas de réussite, cette fonction renvoie 0 ; en cas d'erreur, elle renvoie " |
| 215 |
"un numéro d'erreur non nul." |
| 216 |
|
| 217 |
#. type: SH |
| 218 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 219 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 220 |
#, no-wrap |
| 221 |
msgid "ERRORS" |
| 222 |
msgstr "ERREURS" |
| 223 |
|
| 224 |
#. type: TP |
| 225 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 226 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 227 |
#, no-wrap |
| 228 |
msgid "B<ENOMEM>" |
| 229 |
msgstr "B<ENOMEM>" |
| 230 |
|
| 231 |
#. Can happen (but unlikely) while trying to allocate memory for cpuset |
| 232 |
#. type: Plain text |
| 233 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 234 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 235 |
msgid "Insufficient memory." |
| 236 |
msgstr "Mémoire insuffisante." |
| 237 |
|
| 238 |
#. type: Plain text |
| 239 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 240 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 241 |
msgid "" |
| 242 |
"In addition, if I<thread> refers to the main thread, then " |
| 243 |
"B<pthread_getattr_np>() can fail because of errors from various underlying " |
| 244 |
"calls: B<fopen>(3), if I</proc/self/maps> can't be opened; and " |
| 245 |
"B<getrlimit>(2), if the B<RLIMIT_STACK> resource limit is not supported." |
| 246 |
msgstr "" |
| 247 |
"De plus, si I<thread> se réfère au thread principal, alors " |
| 248 |
"B<pthread_getattr_np>() peut échouer à cause d'erreurs de différents appels " |
| 249 |
"sous-jacents : B<fopen>(3) si I</proc/self/maps> ne peut être ouvert, et " |
| 250 |
"B<getrlimit>(2) si la limite de ressources B<RLIMIT_STACK> n'est pas prise " |
| 251 |
"en charge." |
| 252 |
|
| 253 |
#. type: SH |
| 254 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 255 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 256 |
#, no-wrap |
| 257 |
msgid "ATTRIBUTES" |
| 258 |
msgstr "ATTRIBUTS" |
| 259 |
|
| 260 |
#. type: Plain text |
| 261 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 262 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 263 |
msgid "" |
| 264 |
"For an explanation of the terms used in this section, see B<attributes>(7)." |
| 265 |
msgstr "" |
| 266 |
"Pour une explication des termes utilisés dans cette section, consulter " |
| 267 |
"B<attributes>(7)." |
| 268 |
|
| 269 |
#. type: tbl table |
| 270 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 271 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 272 |
#, no-wrap |
| 273 |
msgid "Interface" |
| 274 |
msgstr "Interface" |
| 275 |
|
| 276 |
#. type: tbl table |
| 277 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 278 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 279 |
#, no-wrap |
| 280 |
msgid "Attribute" |
| 281 |
msgstr "Attribut" |
| 282 |
|
| 283 |
#. type: tbl table |
| 284 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 285 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 286 |
#, no-wrap |
| 287 |
msgid "Value" |
| 288 |
msgstr "Valeur" |
| 289 |
|
| 290 |
#. type: tbl table |
| 291 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 292 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 293 |
#, no-wrap |
| 294 |
msgid ".na\n" |
| 295 |
msgstr ".na\n" |
| 296 |
|
| 297 |
#. type: tbl table |
| 298 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 299 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 300 |
#, no-wrap |
| 301 |
msgid ".nh\n" |
| 302 |
msgstr ".nh\n" |
| 303 |
|
| 304 |
#. type: tbl table |
| 305 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 306 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 307 |
#, no-wrap |
| 308 |
msgid "B<pthread_getattr_np>()" |
| 309 |
msgstr "B<pthread_getattr_np>()." |
| 310 |
|
| 311 |
#. type: tbl table |
| 312 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 313 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 314 |
#, no-wrap |
| 315 |
msgid "Thread safety" |
| 316 |
msgstr "Sécurité des threads" |
| 317 |
|
| 318 |
#. type: tbl table |
| 319 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 320 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 321 |
#, no-wrap |
| 322 |
msgid "MT-Safe" |
| 323 |
msgstr "MT-Safe" |
| 324 |
|
| 325 |
#. type: SH |
| 326 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 327 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 328 |
#, no-wrap |
| 329 |
msgid "STANDARDS" |
| 330 |
msgstr "NORMES" |
| 331 |
|
| 332 |
#. type: Plain text |
| 333 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 334 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 335 |
msgid "GNU; hence the suffix \"_np\" (nonportable) in the name." |
| 336 |
msgstr "GNU ; c'est la raison du suffixe « _np » (non portable) dans son nom." |
| 337 |
|
| 338 |
#. type: SH |
| 339 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 340 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 341 |
#, no-wrap |
| 342 |
msgid "HISTORY" |
| 343 |
msgstr "HISTORIQUE" |
| 344 |
|
| 345 |
#. type: Plain text |
| 346 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 347 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 348 |
msgid "glibc 2.2.3." |
| 349 |
msgstr "glibc 2.2.3." |
| 350 |
|
| 351 |
#. type: SH |
| 352 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 353 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 354 |
#, no-wrap |
| 355 |
msgid "EXAMPLES" |
| 356 |
msgstr "EXEMPLES" |
| 357 |
|
| 358 |
#. type: Plain text |
| 359 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 360 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 361 |
msgid "" |
| 362 |
"The program below demonstrates the use of B<pthread_getattr_np>(). The " |
| 363 |
"program creates a thread that then uses B<pthread_getattr_np>() to retrieve " |
| 364 |
"and display its guard size, stack address, and stack size attributes. " |
| 365 |
"Command-line arguments can be used to set these attributes to values other " |
| 366 |
"than the default when creating the thread. The shell sessions below " |
| 367 |
"demonstrate the use of the program." |
| 368 |
msgstr "" |
| 369 |
"Le programme ci-dessous démontre l'utilisation de B<pthread_getattr_np>(). " |
| 370 |
"Le programme crée un thread qui utilise ensuite B<pthread_getattr_np>() pour " |
| 371 |
"récupérer et afficher les attributs contenant la taille de la garde, " |
| 372 |
"l'adresse de la pile et la taille de la pile. Des paramètres en ligne de " |
| 373 |
"commande peuvent être utilisés pour définir les attributs qui seront " |
| 374 |
"utilisés pour créer le thread à des valeurs autres que les valeurs par " |
| 375 |
"défaut. Les sessions d'interpréteur de commande ci-dessous démontrent " |
| 376 |
"l'utilisation du programme." |
| 377 |
|
| 378 |
#. type: Plain text |
| 379 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 380 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 381 |
msgid "" |
| 382 |
"In the first run, on an x86-32 system, a thread is created using default " |
| 383 |
"attributes:" |
| 384 |
msgstr "" |
| 385 |
"Lors de la première exécution, sur un système x86-32, un thread est créé en " |
| 386 |
"utilisant les attributs par défaut :" |
| 387 |
|
| 388 |
#. type: Plain text |
| 389 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 390 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 391 |
#, no-wrap |
| 392 |
msgid "" |
| 393 |
"$B< ulimit -s> # No stack limit ==E<gt> default stack size is 2 MB\n" |
| 394 |
"unlimited\n" |
| 395 |
"$B< ./a.out>\n" |
| 396 |
"Attributes of created thread:\n" |
| 397 |
" Guard size = 4096 bytes\n" |
| 398 |
" Stack address = 0x40196000 (EOS = 0x40397000)\n" |
| 399 |
" Stack size = 0x201000 (2101248) bytes\n" |
| 400 |
msgstr "" |
| 401 |
"$B< ulimit -s> # Pas de limite de pile ==E<gt> taille de pile par défaut : 2 Mo\n" |
| 402 |
"unlimited\n" |
| 403 |
"$B< ./a.out>\n" |
| 404 |
"Attributs du thread créé :\n" |
| 405 |
" Guard size = 4096 bytes\n" |
| 406 |
" Stack address = 0x40196000 (EOS = 0x40397000)\n" |
| 407 |
" Stack size = 0x201000 (2101248) bytes\n" |
| 408 |
|
| 409 |
#. type: Plain text |
| 410 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 411 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 412 |
msgid "" |
| 413 |
"In the following run, we see that if a guard size is specified, it is " |
| 414 |
"rounded up to the next multiple of the system page size (4096 bytes on " |
| 415 |
"x86-32):" |
| 416 |
msgstr "" |
| 417 |
"Lors de l'exécution suivante, nous voyons que si la taille de la garde est " |
| 418 |
"fournie, elle est arrondie à la valeur supérieure du prochain multiple de la " |
| 419 |
"taille de page système (4096 octets sous x86-32) :" |
| 420 |
|
| 421 |
#. type: Plain text |
| 422 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 423 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 424 |
#, no-wrap |
| 425 |
msgid "" |
| 426 |
"$B< ./a.out -g 4097>\n" |
| 427 |
"Thread attributes object after initializations:\n" |
| 428 |
" Guard size = 4097 bytes\n" |
| 429 |
" Stack address = (nil)\n" |
| 430 |
" Stack size = 0x0 (0) bytes\n" |
| 431 |
"\\&\n" |
| 432 |
"Attributes of created thread:\n" |
| 433 |
" Guard size = 8192 bytes\n" |
| 434 |
" Stack address = 0x40196000 (EOS = 0x40397000)\n" |
| 435 |
" Stack size = 0x201000 (2101248) bytes\n" |
| 436 |
msgstr "" |
| 437 |
"$B< ./a.out -g 4097>\n" |
| 438 |
"Objet d'attributs de thread après initialisations :\n" |
| 439 |
" Guard size = 4097 bytes\n" |
| 440 |
" Stack address = (nil)\n" |
| 441 |
" Stack size = 0x0 (0) bytes\n" |
| 442 |
"\\&\n" |
| 443 |
"Attributs du thread créé :\n" |
| 444 |
" Guard size = 8192 bytes\n" |
| 445 |
" Stack address = 0x40196000 (EOS = 0x40397000)\n" |
| 446 |
" Stack size = 0x201000 (2101248) bytes\n" |
| 447 |
|
| 448 |
# |
| 449 |
#. type: Plain text |
| 450 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 451 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 452 |
msgid "" |
| 453 |
"In the last run, the program manually allocates a stack for the thread. In " |
| 454 |
"this case, the guard size attribute is ignored." |
| 455 |
msgstr "" |
| 456 |
"Lors de la dernière exécution, le programme alloue manuellement une pile " |
| 457 |
"pour le thread. Dans ce cas, l'attribut contenant la taille de la garde est " |
| 458 |
"ignoré." |
| 459 |
|
| 460 |
#. type: Plain text |
| 461 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 462 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 463 |
#, no-wrap |
| 464 |
msgid "" |
| 465 |
"$B< ./a.out -g 4096 -s 0x8000 -a>\n" |
| 466 |
"Allocated thread stack at 0x804d000\n" |
| 467 |
"\\&\n" |
| 468 |
"Thread attributes object after initializations:\n" |
| 469 |
" Guard size = 4096 bytes\n" |
| 470 |
" Stack address = 0x804d000 (EOS = 0x8055000)\n" |
| 471 |
" Stack size = 0x8000 (32768) bytes\n" |
| 472 |
"\\&\n" |
| 473 |
"Attributes of created thread:\n" |
| 474 |
" Guard size = 0 bytes\n" |
| 475 |
" Stack address = 0x804d000 (EOS = 0x8055000)\n" |
| 476 |
" Stack size = 0x8000 (32768) bytes\n" |
| 477 |
msgstr "" |
| 478 |
"$B< ./a.out -g 4096 -s 0x8000 -a>\n" |
| 479 |
"Allocated thread stack at 0x804d000\n" |
| 480 |
"\\&\n" |
| 481 |
"Objet d'attributs de thread après initialisations :\n" |
| 482 |
" Guard size = 4096 bytes\n" |
| 483 |
" Stack address = 0x804d000 (EOS = 0x8055000)\n" |
| 484 |
" Stack size = 0x8000 (32768) bytes\n" |
| 485 |
"\\&\n" |
| 486 |
"Attributs du thread créé :\n" |
| 487 |
" Guard size = 0 bytes\n" |
| 488 |
" Stack address = 0x804d000 (EOS = 0x8055000)\n" |
| 489 |
" Stack size = 0x8000 (32768) bytes\n" |
| 490 |
|
| 491 |
#. type: SS |
| 492 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 493 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 494 |
#, no-wrap |
| 495 |
msgid "Program source" |
| 496 |
msgstr "Source du programme" |
| 497 |
|
| 498 |
#. type: Plain text |
| 499 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 500 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 501 |
#, fuzzy, no-wrap |
| 502 |
#| msgid "" |
| 503 |
#| "#define _GNU_SOURCE /* To get pthread_getattr_np() declaration */\n" |
| 504 |
#| "#include E<lt>err.hE<gt>\n" |
| 505 |
#| "#include E<lt>errno.hE<gt>\n" |
| 506 |
#| "#include E<lt>pthread.hE<gt>\n" |
| 507 |
#| "#include E<lt>stdio.hE<gt>\n" |
| 508 |
#| "#include E<lt>stdlib.hE<gt>\n" |
| 509 |
#| "#include E<lt>unistd.hE<gt>\n" |
| 510 |
#| "\\&\n" |
| 511 |
#| "static void\n" |
| 512 |
#| "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n" |
| 513 |
#| "{\n" |
| 514 |
#| " int s;\n" |
| 515 |
#| " size_t stack_size, guard_size;\n" |
| 516 |
#| " void *stack_addr;\n" |
| 517 |
#| "\\&\n" |
| 518 |
#| " s = pthread_attr_getguardsize(attr, &guard_size);\n" |
| 519 |
#| " if (s != 0)\n" |
| 520 |
#| " errc(EXIT_FAILURE, s, \"pthread_attr_getguardsize\");\n" |
| 521 |
#| " printf(\"%sGuard size = %zu bytes\\en\", prefix, guard_size);\n" |
| 522 |
#| "\\&\n" |
| 523 |
#| " s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n" |
| 524 |
#| " if (s != 0)\n" |
| 525 |
#| " errc(EXIT_FAILURE, s, \"pthread_attr_getstack\");\n" |
| 526 |
#| " printf(\"%sStack address = %p\", prefix, stack_addr);\n" |
| 527 |
#| " if (stack_size E<gt> 0)\n" |
| 528 |
#| " printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n" |
| 529 |
#| " printf(\"\\en\");\n" |
| 530 |
#| " printf(\"%sStack size = %#zx (%zu) bytes\\en\",\n" |
| 531 |
#| " prefix, stack_size, stack_size);\n" |
| 532 |
#| "}\n" |
| 533 |
#| "\\&\n" |
| 534 |
#| "static void\n" |
| 535 |
#| "display_thread_attributes(pthread_t thread, char *prefix)\n" |
| 536 |
#| "{\n" |
| 537 |
#| " int s;\n" |
| 538 |
#| " pthread_attr_t attr;\n" |
| 539 |
#| "\\&\n" |
| 540 |
#| " s = pthread_getattr_np(thread, &attr);\n" |
| 541 |
#| " if (s != 0)\n" |
| 542 |
#| " errc(EXIT_FAILURE, s, \"pthread_getattr_np\");\n" |
| 543 |
#| "\\&\n" |
| 544 |
#| " display_stack_related_attributes(&attr, prefix);\n" |
| 545 |
#| "\\&\n" |
| 546 |
#| " s = pthread_attr_destroy(&attr);\n" |
| 547 |
#| " if (s != 0)\n" |
| 548 |
#| " errc(EXIT_FAILURE, s, \"pthread_attr_destroy\");\n" |
| 549 |
#| "}\n" |
| 550 |
#| "\\&\n" |
| 551 |
#| "static void * /* Start function for thread we create */\n" |
| 552 |
#| "thread_start(void *arg)\n" |
| 553 |
#| "{\n" |
| 554 |
#| " printf(\"Attributes of created thread:\\en\");\n" |
| 555 |
#| " display_thread_attributes(pthread_self(), \"\\et\");\n" |
| 556 |
#| "\\&\n" |
| 557 |
#| " exit(EXIT_SUCCESS); /* Terminate all threads */\n" |
| 558 |
#| "}\n" |
| 559 |
#| "\\&\n" |
| 560 |
#| "static void\n" |
| 561 |
#| "usage(char *pname, char *msg)\n" |
| 562 |
#| "{\n" |
| 563 |
#| " if (msg != NULL)\n" |
| 564 |
#| " fputs(msg, stderr);\n" |
| 565 |
#| " fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n" |
| 566 |
#| " \" [-g guard-size]\\en\", pname);\n" |
| 567 |
#| " fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n" |
| 568 |
#| " exit(EXIT_FAILURE);\n" |
| 569 |
#| "}\n" |
| 570 |
#| "\\&\n" |
| 571 |
#| "static pthread_attr_t * /* Get thread attributes from command line */\n" |
| 572 |
#| "get_thread_attributes_from_cl(int argc, char *argv[],\n" |
| 573 |
#| " pthread_attr_t *attrp)\n" |
| 574 |
#| "{\n" |
| 575 |
#| " int s, opt, allocate_stack;\n" |
| 576 |
#| " size_t stack_size, guard_size;\n" |
| 577 |
#| " void *stack_addr;\n" |
| 578 |
#| " pthread_attr_t *ret_attrp = NULL; /* Set to attrp if we initialize\n" |
| 579 |
#| " a thread attributes object */\n" |
| 580 |
#| " allocate_stack = 0;\n" |
| 581 |
#| " stack_size = -1;\n" |
| 582 |
#| " guard_size = -1;\n" |
| 583 |
#| "\\&\n" |
| 584 |
#| " while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n" |
| 585 |
#| " switch (opt) {\n" |
| 586 |
#| " case \\[aq]a\\[aq]: allocate_stack = 1; break;\n" |
| 587 |
#| " case \\[aq]g\\[aq]: guard_size = strtoul(optarg, NULL, 0); break;\n" |
| 588 |
#| " case \\[aq]s\\[aq]: stack_size = strtoul(optarg, NULL, 0); break;\n" |
| 589 |
#| " default: usage(argv[0], NULL);\n" |
| 590 |
#| " }\n" |
| 591 |
#| " }\n" |
| 592 |
#| "\\&\n" |
| 593 |
#| " if (allocate_stack && stack_size == -1)\n" |
| 594 |
#| " usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n" |
| 595 |
#| "\\&\n" |
| 596 |
#| " if (argc E<gt> optind)\n" |
| 597 |
#| " usage(argv[0], \"Extraneous command-line arguments\\en\");\n" |
| 598 |
#| "\\&\n" |
| 599 |
#| " if (stack_size != -1 || guard_size E<gt> 0) {\n" |
| 600 |
#| " ret_attrp = attrp;\n" |
| 601 |
#| "\\&\n" |
| 602 |
#| " s = pthread_attr_init(attrp);\n" |
| 603 |
#| " if (s != 0)\n" |
| 604 |
#| " errc(EXIT_FAILURE, s, \"pthread_attr_init\");\n" |
| 605 |
#| " }\n" |
| 606 |
#| "\\&\n" |
| 607 |
#| " if (stack_size != -1) {\n" |
| 608 |
#| " if (!allocate_stack) {\n" |
| 609 |
#| " s = pthread_attr_setstacksize(attrp, stack_size);\n" |
| 610 |
#| " if (s != 0)\n" |
| 611 |
#| " errc(EXIT_FAILURE, s, \"pthread_attr_setstacksize\");\n" |
| 612 |
#| " } else {\n" |
| 613 |
#| " s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n" |
| 614 |
#| " stack_size);\n" |
| 615 |
#| " if (s != 0)\n" |
| 616 |
#| " errc(EXIT_FAILURE, s, \"posix_memalign\");\n" |
| 617 |
#| " printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n" |
| 618 |
#| "\\&\n" |
| 619 |
#| " s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n" |
| 620 |
#| " if (s != 0)\n" |
| 621 |
#| " errc(EXIT_FAILURE, s, \"pthread_attr_setstacksize\");\n" |
| 622 |
#| " }\n" |
| 623 |
#| " }\n" |
| 624 |
#| "\\&\n" |
| 625 |
#| " if (guard_size != -1) {\n" |
| 626 |
#| " s = pthread_attr_setguardsize(attrp, guard_size);\n" |
| 627 |
#| " if (s != 0)\n" |
| 628 |
#| " errc(EXIT_FAILURE, s, \"pthread_attr_setstacksize\");\n" |
| 629 |
#| " }\n" |
| 630 |
#| "\\&\n" |
| 631 |
#| " return ret_attrp;\n" |
| 632 |
#| "}\n" |
| 633 |
#| "\\&\n" |
| 634 |
#| "int\n" |
| 635 |
#| "main(int argc, char *argv[])\n" |
| 636 |
#| "{\n" |
| 637 |
#| " int s;\n" |
| 638 |
#| " pthread_t thr;\n" |
| 639 |
#| " pthread_attr_t attr;\n" |
| 640 |
#| " pthread_attr_t *attrp = NULL; /* Set to &attr if we initialize\n" |
| 641 |
#| " a thread attributes object */\n" |
| 642 |
#| "\\&\n" |
| 643 |
#| " attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n" |
| 644 |
#| "\\&\n" |
| 645 |
#| " if (attrp != NULL) {\n" |
| 646 |
#| " printf(\"Thread attributes object after initializations:\\en\");\n" |
| 647 |
#| " display_stack_related_attributes(attrp, \"\\et\");\n" |
| 648 |
#| " printf(\"\\en\");\n" |
| 649 |
#| " }\n" |
| 650 |
#| "\\&\n" |
| 651 |
#| " s = pthread_create(&thr, attrp, &thread_start, NULL);\n" |
| 652 |
#| " if (s != 0)\n" |
| 653 |
#| " errc(EXIT_FAILURE, s, \"pthread_create\");\n" |
| 654 |
#| "\\&\n" |
| 655 |
#| " if (attrp != NULL) {\n" |
| 656 |
#| " s = pthread_attr_destroy(attrp);\n" |
| 657 |
#| " if (s != 0)\n" |
| 658 |
#| " errc(EXIT_FAILURE, s, \"pthread_attr_destroy\");\n" |
| 659 |
#| " }\n" |
| 660 |
#| "\\&\n" |
| 661 |
#| " pause(); /* Terminates when other thread calls exit() */\n" |
| 662 |
#| "}\n" |
| 663 |
msgid "" |
| 664 |
"#define _GNU_SOURCE /* To get pthread_getattr_np() declaration */\n" |
| 665 |
"#include E<lt>err.hE<gt>\n" |
| 666 |
"#include E<lt>errno.hE<gt>\n" |
| 667 |
"#include E<lt>pthread.hE<gt>\n" |
| 668 |
"#include E<lt>stdio.hE<gt>\n" |
| 669 |
"#include E<lt>stdlib.hE<gt>\n" |
| 670 |
"#include E<lt>unistd.hE<gt>\n" |
| 671 |
"\\&\n" |
| 672 |
"static void\n" |
| 673 |
"display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n" |
| 674 |
"{\n" |
| 675 |
" int s;\n" |
| 676 |
" size_t stack_size, guard_size;\n" |
| 677 |
" void *stack_addr;\n" |
| 678 |
"\\&\n" |
| 679 |
" s = pthread_attr_getguardsize(attr, &guard_size);\n" |
| 680 |
" if (s != 0)\n" |
| 681 |
" errc(EXIT_FAILURE, s, \"pthread_attr_getguardsize\");\n" |
| 682 |
" printf(\"%sGuard size = %zu bytes\\[rs]n\", prefix, guard_size);\n" |
| 683 |
"\\&\n" |
| 684 |
" s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n" |
| 685 |
" if (s != 0)\n" |
| 686 |
" errc(EXIT_FAILURE, s, \"pthread_attr_getstack\");\n" |
| 687 |
" printf(\"%sStack address = %p\", prefix, stack_addr);\n" |
| 688 |
" if (stack_size E<gt> 0)\n" |
| 689 |
" printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n" |
| 690 |
" printf(\"\\[rs]n\");\n" |
| 691 |
" printf(\"%sStack size = %#zx (%zu) bytes\\[rs]n\",\n" |
| 692 |
" prefix, stack_size, stack_size);\n" |
| 693 |
"}\n" |
| 694 |
"\\&\n" |
| 695 |
"static void\n" |
| 696 |
"display_thread_attributes(pthread_t thread, char *prefix)\n" |
| 697 |
"{\n" |
| 698 |
" int s;\n" |
| 699 |
" pthread_attr_t attr;\n" |
| 700 |
"\\&\n" |
| 701 |
" s = pthread_getattr_np(thread, &attr);\n" |
| 702 |
" if (s != 0)\n" |
| 703 |
" errc(EXIT_FAILURE, s, \"pthread_getattr_np\");\n" |
| 704 |
"\\&\n" |
| 705 |
" display_stack_related_attributes(&attr, prefix);\n" |
| 706 |
"\\&\n" |
| 707 |
" s = pthread_attr_destroy(&attr);\n" |
| 708 |
" if (s != 0)\n" |
| 709 |
" errc(EXIT_FAILURE, s, \"pthread_attr_destroy\");\n" |
| 710 |
"}\n" |
| 711 |
"\\&\n" |
| 712 |
"static void * /* Start function for thread we create */\n" |
| 713 |
"thread_start(void *arg)\n" |
| 714 |
"{\n" |
| 715 |
" printf(\"Attributes of created thread:\\[rs]n\");\n" |
| 716 |
" display_thread_attributes(pthread_self(), \"\\[rs]t\");\n" |
| 717 |
"\\&\n" |
| 718 |
" exit(EXIT_SUCCESS); /* Terminate all threads */\n" |
| 719 |
"}\n" |
| 720 |
"\\&\n" |
| 721 |
"static void\n" |
| 722 |
"usage(char *pname, char *msg)\n" |
| 723 |
"{\n" |
| 724 |
" if (msg != NULL)\n" |
| 725 |
" fputs(msg, stderr);\n" |
| 726 |
" fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n" |
| 727 |
" \" [-g guard-size]\\[rs]n\", pname);\n" |
| 728 |
" fprintf(stderr, \"\\[rs]t\\[rs]t-a means program should allocate stack\\[rs]n\");\n" |
| 729 |
" exit(EXIT_FAILURE);\n" |
| 730 |
"}\n" |
| 731 |
"\\&\n" |
| 732 |
"static pthread_attr_t * /* Get thread attributes from command line */\n" |
| 733 |
"get_thread_attributes_from_cl(int argc, char *argv[],\n" |
| 734 |
" pthread_attr_t *attrp)\n" |
| 735 |
"{\n" |
| 736 |
" int s, opt, allocate_stack;\n" |
| 737 |
" size_t stack_size, guard_size;\n" |
| 738 |
" void *stack_addr;\n" |
| 739 |
" pthread_attr_t *ret_attrp = NULL; /* Set to attrp if we initialize\n" |
| 740 |
" a thread attributes object */\n" |
| 741 |
" allocate_stack = 0;\n" |
| 742 |
" stack_size = -1;\n" |
| 743 |
" guard_size = -1;\n" |
| 744 |
"\\&\n" |
| 745 |
" while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n" |
| 746 |
" switch (opt) {\n" |
| 747 |
" case \\[aq]a\\[aq]: allocate_stack = 1; break;\n" |
| 748 |
" case \\[aq]g\\[aq]: guard_size = strtoul(optarg, NULL, 0); break;\n" |
| 749 |
" case \\[aq]s\\[aq]: stack_size = strtoul(optarg, NULL, 0); break;\n" |
| 750 |
" default: usage(argv[0], NULL);\n" |
| 751 |
" }\n" |
| 752 |
" }\n" |
| 753 |
"\\&\n" |
| 754 |
" if (allocate_stack && stack_size == -1)\n" |
| 755 |
" usage(argv[0], \"Specifying -a without -s makes no sense\\[rs]n\");\n" |
| 756 |
"\\&\n" |
| 757 |
" if (argc E<gt> optind)\n" |
| 758 |
" usage(argv[0], \"Extraneous command-line arguments\\[rs]n\");\n" |
| 759 |
"\\&\n" |
| 760 |
" if (stack_size != -1 || guard_size E<gt> 0) {\n" |
| 761 |
" ret_attrp = attrp;\n" |
| 762 |
"\\&\n" |
| 763 |
" s = pthread_attr_init(attrp);\n" |
| 764 |
" if (s != 0)\n" |
| 765 |
" errc(EXIT_FAILURE, s, \"pthread_attr_init\");\n" |
| 766 |
" }\n" |
| 767 |
"\\&\n" |
| 768 |
" if (stack_size != -1) {\n" |
| 769 |
" if (!allocate_stack) {\n" |
| 770 |
" s = pthread_attr_setstacksize(attrp, stack_size);\n" |
| 771 |
" if (s != 0)\n" |
| 772 |
" errc(EXIT_FAILURE, s, \"pthread_attr_setstacksize\");\n" |
| 773 |
" } else {\n" |
| 774 |
" s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n" |
| 775 |
" stack_size);\n" |
| 776 |
" if (s != 0)\n" |
| 777 |
" errc(EXIT_FAILURE, s, \"posix_memalign\");\n" |
| 778 |
" printf(\"Allocated thread stack at %p\\[rs]n\\[rs]n\", stack_addr);\n" |
| 779 |
"\\&\n" |
| 780 |
" s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n" |
| 781 |
" if (s != 0)\n" |
| 782 |
" errc(EXIT_FAILURE, s, \"pthread_attr_setstacksize\");\n" |
| 783 |
" }\n" |
| 784 |
" }\n" |
| 785 |
"\\&\n" |
| 786 |
" if (guard_size != -1) {\n" |
| 787 |
" s = pthread_attr_setguardsize(attrp, guard_size);\n" |
| 788 |
" if (s != 0)\n" |
| 789 |
" errc(EXIT_FAILURE, s, \"pthread_attr_setstacksize\");\n" |
| 790 |
" }\n" |
| 791 |
"\\&\n" |
| 792 |
" return ret_attrp;\n" |
| 793 |
"}\n" |
| 794 |
"\\&\n" |
| 795 |
"int\n" |
| 796 |
"main(int argc, char *argv[])\n" |
| 797 |
"{\n" |
| 798 |
" int s;\n" |
| 799 |
" pthread_t thr;\n" |
| 800 |
" pthread_attr_t attr;\n" |
| 801 |
" pthread_attr_t *attrp = NULL; /* Set to &attr if we initialize\n" |
| 802 |
" a thread attributes object */\n" |
| 803 |
"\\&\n" |
| 804 |
" attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n" |
| 805 |
"\\&\n" |
| 806 |
" if (attrp != NULL) {\n" |
| 807 |
" printf(\"Thread attributes object after initializations:\\[rs]n\");\n" |
| 808 |
" display_stack_related_attributes(attrp, \"\\[rs]t\");\n" |
| 809 |
" printf(\"\\[rs]n\");\n" |
| 810 |
" }\n" |
| 811 |
"\\&\n" |
| 812 |
" s = pthread_create(&thr, attrp, &thread_start, NULL);\n" |
| 813 |
" if (s != 0)\n" |
| 814 |
" errc(EXIT_FAILURE, s, \"pthread_create\");\n" |
| 815 |
"\\&\n" |
| 816 |
" if (attrp != NULL) {\n" |
| 817 |
" s = pthread_attr_destroy(attrp);\n" |
| 818 |
" if (s != 0)\n" |
| 819 |
" errc(EXIT_FAILURE, s, \"pthread_attr_destroy\");\n" |
| 820 |
" }\n" |
| 821 |
"\\&\n" |
| 822 |
" pause(); /* Terminates when other thread calls exit() */\n" |
| 823 |
"}\n" |
| 824 |
msgstr "" |
| 825 |
"#define _GNU_SOURCE /* Pour la déclaration de pthread_getattr_np() */\n" |
| 826 |
"#include E<lt>err.hE<gt>\n" |
| 827 |
"#include E<lt>errno.hE<gt>\n" |
| 828 |
"#include E<lt>pthread.hE<gt>\n" |
| 829 |
"#include E<lt>stdio.hE<gt>\n" |
| 830 |
"#include E<lt>stdlib.hE<gt>\n" |
| 831 |
"#include E<lt>unistd.hE<gt>\n" |
| 832 |
"\\&\n" |
| 833 |
"static void\n" |
| 834 |
"display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n" |
| 835 |
"{\n" |
| 836 |
" int s;\n" |
| 837 |
" size_t stack_size, guard_size;\n" |
| 838 |
" void *stack_addr;\n" |
| 839 |
"\\&\n" |
| 840 |
" s = pthread_attr_getguardsize(attr, &guard_size);\n" |
| 841 |
" if (s != 0)\n" |
| 842 |
" errc(EXIT_FAILURE, s, \"pthread_attr_getguardsize\");\n" |
| 843 |
" printf(\"%sGuard size = %zu bytes\\en\", prefix, guard_size);\n" |
| 844 |
"\\&\n" |
| 845 |
" s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n" |
| 846 |
" if (s != 0)\n" |
| 847 |
" errc(EXIT_FAILURE, s, \"pthread_attr_getstack\");\n" |
| 848 |
" printf(\"%sStack address = %p\", prefix, stack_addr);\n" |
| 849 |
" if (stack_size E<gt> 0)\n" |
| 850 |
" printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n" |
| 851 |
" printf(\"\\en\");\n" |
| 852 |
" printf(\"%sStack size = %#zx (%zu) bytes\\en\",\n" |
| 853 |
" prefix, stack_size, stack_size);\n" |
| 854 |
"}\n" |
| 855 |
"\\&\n" |
| 856 |
"static void\n" |
| 857 |
"display_thread_attributes(pthread_t thread, char *prefix)\n" |
| 858 |
"{\n" |
| 859 |
" int s;\n" |
| 860 |
" pthread_attr_t attr;\n" |
| 861 |
"\\&\n" |
| 862 |
" s = pthread_getattr_np(thread, &attr);\n" |
| 863 |
" if (s != 0)\n" |
| 864 |
" errc(EXIT_FAILURE, s, \"pthread_getattr_np\");\n" |
| 865 |
"\\&\n" |
| 866 |
" display_stack_related_attributes(&attr, prefix);\n" |
| 867 |
"\\&\n" |
| 868 |
" s = pthread_attr_destroy(&attr);\n" |
| 869 |
" if (s != 0)\n" |
| 870 |
" errc(EXIT_FAILURE, s, \"pthread_attr_destroy\");\n" |
| 871 |
"}\n" |
| 872 |
"\\&\n" |
| 873 |
"static void * /* Démarrage de la fonction pour le thread créé */\n" |
| 874 |
"thread_start(void *arg)\n" |
| 875 |
"{\n" |
| 876 |
" printf(\"Attributs du thread créé :\\en\");\n" |
| 877 |
" display_thread_attributes(pthread_self(), \"\\et\");\n" |
| 878 |
"\\&\n" |
| 879 |
" exit(EXIT_SUCCESS); /* Termine tous les threads */\n" |
| 880 |
"}\n" |
| 881 |
"\\&\n" |
| 882 |
"static void\n" |
| 883 |
"usage(char *pname, char *msg)\n" |
| 884 |
"{\n" |
| 885 |
" if (msg != NULL)\n" |
| 886 |
" fputs(msg, stderr);\n" |
| 887 |
" fprintf(stderr, \"Utilisation : %s [-s stack-size [-a]]\"\n" |
| 888 |
" \" [-g guard-size]\\en\", pname);\n" |
| 889 |
" fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n" |
| 890 |
" exit(EXIT_FAILURE);\n" |
| 891 |
"}\n" |
| 892 |
"\\&\n" |
| 893 |
"static pthread_attr_t * /* Obtenir les attributs de thread en ligne de commande */\n" |
| 894 |
"get_thread_attributes_from_cl(int argc, char *argv[],\n" |
| 895 |
" pthread_attr_t *attrp)\n" |
| 896 |
"{\n" |
| 897 |
" int s, opt, allocate_stack;\n" |
| 898 |
" size_t stack_size, guard_size;\n" |
| 899 |
" void *stack_addr;\n" |
| 900 |
" pthread_attr_t *ret_attrp = NULL; /* Définir à attrp si un objet\n" |
| 901 |
" d'attributs de thread est initialisé */\n" |
| 902 |
" allocate_stack = 0;\n" |
| 903 |
" stack_size = -1;\n" |
| 904 |
" guard_size = -1;\n" |
| 905 |
"\\&\n" |
| 906 |
" while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n" |
| 907 |
" switch (opt) {\n" |
| 908 |
" case \\[aq]a\\[aq]: allocate_stack = 1; break;\n" |
| 909 |
" case \\[aq]g\\[aq]: guard_size = strtoul(optarg, NULL, 0); break;\n" |
| 910 |
" case \\[aq]s\\[aq]: stack_size = strtoul(optarg, NULL, 0); break;\n" |
| 911 |
" default: usage(argv[0], NULL);\n" |
| 912 |
" }\n" |
| 913 |
" }\n" |
| 914 |
"\\&\n" |
| 915 |
" if (allocate_stack && stack_size == -1)\n" |
| 916 |
" usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n" |
| 917 |
"\\&\n" |
| 918 |
" if (argc E<gt> optind)\n" |
| 919 |
" usage(argv[0], \"Extraneous command-line arguments\\en\");\n" |
| 920 |
"\\&\n" |
| 921 |
" if (stack_size != -1 || guard_size E<gt> 0) {\n" |
| 922 |
" ret_attrp = attrp;\n" |
| 923 |
"\\&\n" |
| 924 |
" s = pthread_attr_init(attrp);\n" |
| 925 |
" if (s != 0)\n" |
| 926 |
" errc(EXIT_FAILURE, s, \"pthread_attr_init\");\n" |
| 927 |
" }\n" |
| 928 |
"\\&\n" |
| 929 |
" if (stack_size != -1) {\n" |
| 930 |
" if (!allocate_stack) {\n" |
| 931 |
" s = pthread_attr_setstacksize(attrp, stack_size);\n" |
| 932 |
" if (s != 0)\n" |
| 933 |
" errc(EXIT_FAILURE, s, \"pthread_attr_setstacksize\");\n" |
| 934 |
" } else {\n" |
| 935 |
" s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n" |
| 936 |
" stack_size);\n" |
| 937 |
" if (s != 0)\n" |
| 938 |
" errc(EXIT_FAILURE, s, \"posix_memalign\");\n" |
| 939 |
" printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n" |
| 940 |
"\\&\n" |
| 941 |
" s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n" |
| 942 |
" if (s != 0)\n" |
| 943 |
" errc(EXIT_FAILURE, s, \"pthread_attr_setstacksize\");\n" |
| 944 |
" }\n" |
| 945 |
" }\n" |
| 946 |
"\\&\n" |
| 947 |
" if (guard_size !1= -1) {\n" |
| 948 |
" s = pthread_attr_setguardsize(attrp, guard_size);\n" |
| 949 |
" if (s != 0)\n" |
| 950 |
" errc(EXIT_FAILURE, s, \"pthread_attr_setstacksize\");\n" |
| 951 |
" }\n" |
| 952 |
"\\&\n" |
| 953 |
" return ret_attrp;\n" |
| 954 |
"}\n" |
| 955 |
"\\&\n" |
| 956 |
"int\n" |
| 957 |
"main(int argc, char *argv[])\n" |
| 958 |
"{\n" |
| 959 |
" int s;\n" |
| 960 |
" pthread_t thr;\n" |
| 961 |
" pthread_attr_t attr;\n" |
| 962 |
" pthread_attr_t *attrp = NULL; /* Définir à &attr si un objet \n" |
| 963 |
" d'attributs de thread est initialisé */\n" |
| 964 |
"\\&\n" |
| 965 |
" attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n" |
| 966 |
"\\&\n" |
| 967 |
" if (attrp != NULL) {\n" |
| 968 |
" printf(\"Objet d'attributs de thread après initialisations :\\en\");\n" |
| 969 |
" display_stack_related_attributes(attrp, \"\\et\");\n" |
| 970 |
" printf(\"\\en\");\n" |
| 971 |
" }\n" |
| 972 |
"\\&\n" |
| 973 |
" s = pthread_create(&thr, attrp, &thread_start, NULL);\n" |
| 974 |
" if (s != 0)\n" |
| 975 |
" errc(EXIT_FAILURE, s, \"pthread_create\");\n" |
| 976 |
"\\&\n" |
| 977 |
" if (attrp != NULL) {\n" |
| 978 |
" s = pthread_attr_destroy(attrp);\n" |
| 979 |
" if (s != 0)\n" |
| 980 |
" errc(EXIT_FAILURE, s, \"pthread_attr_destroy\");\n" |
| 981 |
" }\n" |
| 982 |
"\\&\n" |
| 983 |
" pause(); /* Termine quand un autre thread appelle exit() */\n" |
| 984 |
"}\n" |
| 985 |
|
| 986 |
#. SRC END |
| 987 |
#. type: SH |
| 988 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 989 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 990 |
#, no-wrap |
| 991 |
msgid "SEE ALSO" |
| 992 |
msgstr "VOIR AUSSI" |
| 993 |
|
| 994 |
#. type: Plain text |
| 995 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 996 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 997 |
msgid "" |
| 998 |
"B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), " |
| 999 |
"B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), " |
| 1000 |
"B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), " |
| 1001 |
"B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), " |
| 1002 |
"B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), " |
| 1003 |
"B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)" |
| 1004 |
msgstr "" |
| 1005 |
"B<pthread_attr_getaffinity_np>(3), B<pthread_attr_getdetachstate>(3), " |
| 1006 |
"B<pthread_attr_getguardsize>(3), B<pthread_attr_getinheritsched>(3), " |
| 1007 |
"B<pthread_attr_getschedparam>(3), B<pthread_attr_getschedpolicy>(3), " |
| 1008 |
"B<pthread_attr_getscope>(3), B<pthread_attr_getstack>(3), " |
| 1009 |
"B<pthread_attr_getstackaddr>(3), B<pthread_attr_getstacksize>(3), " |
| 1010 |
"B<pthread_attr_init>(3), B<pthread_create>(3), B<pthreads>(7)" |
| 1011 |
|
| 1012 |
#. type: TH |
| 1013 |
#: debian-trixie |
| 1014 |
#, no-wrap |
| 1015 |
msgid "2024-06-15" |
| 1016 |
msgstr "15 juin 2024" |
| 1017 |
|
| 1018 |
#. type: TH |
| 1019 |
#: debian-trixie |
| 1020 |
#, no-wrap |
| 1021 |
msgid "Linux man-pages 6.9.1" |
| 1022 |
msgstr "Pages du manuel de Linux 6.9.1" |
| 1023 |
|
| 1024 |
#. type: Plain text |
| 1025 |
#: debian-trixie |
| 1026 |
msgid "POSIX threads library (I<libpthread>, I<-lpthread>)" |
| 1027 |
msgstr "Bibliothèque de threads POSIX (I<libpthread>, I<-lpthread>)" |
| 1028 |
|
| 1029 |
#. type: TH |
| 1030 |
#: fedora-44 fedora-rawhide |
| 1031 |
#, no-wrap |
| 1032 |
msgid "2024-07-23" |
| 1033 |
msgstr "23 juillet 2024" |
| 1034 |
|
| 1035 |
#. type: TH |
| 1036 |
#: fedora-44 fedora-rawhide |
| 1037 |
#, no-wrap |
| 1038 |
msgid "Linux man-pages 6.13" |
| 1039 |
msgstr "Pages du manuel de Linux 6.13" |
| 1040 |
|
| 1041 |
#. type: TH |
| 1042 |
#: mageia-cauldron |
| 1043 |
#, no-wrap |
| 1044 |
msgid "Linux man-pages 6.17" |
| 1045 |
msgstr "Pages du manuel de Linux 6.17" |
| 1046 |
|
| 1047 |
#. type: TH |
| 1048 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 1049 |
#, no-wrap |
| 1050 |
msgid "Linux man-pages (unreleased)" |
| 1051 |
msgstr "Pages du manuel de Linux (non publiées)" |