| 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, 2013-2014. |
| 16 |
# Denis Barbier <[email protected]>, 2006, 2010. |
| 17 |
# David Prévot <[email protected]>, 2010-2014. |
| 18 |
# Jean-Pierre Giraud <[email protected]>, 2024-2025. |
| 19 |
msgid "" |
| 20 |
msgstr "" |
| 21 |
"Project-Id-Version: manpages-l10n 4.21.0\n" |
| 22 |
"POT-Creation-Date: 2026-06-05 06:25+0200\n" |
| 23 |
"PO-Revision-Date: 2025-04-15 16:58+0200\n" |
| 24 |
"Last-Translator: Jean-Pierre Giraud <[email protected]>\n" |
| 25 |
"Language-Team: French <[email protected]>\n" |
| 26 |
"Language: fr\n" |
| 27 |
"MIME-Version: 1.0\n" |
| 28 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 29 |
"Content-Transfer-Encoding: 8bit\n" |
| 30 |
"Plural-Forms: nplurals=2; plural=n > 1;\n" |
| 31 |
"X-Generator: Lokalize 22.12.3\n" |
| 32 |
|
| 33 |
#. type: TH |
| 34 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 35 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 36 |
#, no-wrap |
| 37 |
msgid "getaddrinfo_a" |
| 38 |
msgstr "getaddrinfo_a" |
| 39 |
|
| 40 |
#. type: TH |
| 41 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 42 |
#: opensuse-tumbleweed |
| 43 |
#, no-wrap |
| 44 |
msgid "2026-02-08" |
| 45 |
msgstr "8 février 2026" |
| 46 |
|
| 47 |
#. type: TH |
| 48 |
#: archlinux debian-unstable |
| 49 |
#, no-wrap |
| 50 |
msgid "Linux man-pages 6.18" |
| 51 |
msgstr "Pages du manuel de Linux 6.18" |
| 52 |
|
| 53 |
#. type: SH |
| 54 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 55 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 56 |
#, no-wrap |
| 57 |
msgid "NAME" |
| 58 |
msgstr "NOM" |
| 59 |
|
| 60 |
#. type: Plain text |
| 61 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 62 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 63 |
msgid "" |
| 64 |
"getaddrinfo_a, gai_suspend, gai_error, gai_cancel - asynchronous network " |
| 65 |
"address and service translation" |
| 66 |
msgstr "" |
| 67 |
"getaddrinfo_a, gai_suspend, gai_error, gai_cancel – Traduction asynchrone " |
| 68 |
"d'adresses et de services réseau" |
| 69 |
|
| 70 |
#. type: SH |
| 71 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 72 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 73 |
#, no-wrap |
| 74 |
msgid "LIBRARY" |
| 75 |
msgstr "BIBLIOTHÈQUE" |
| 76 |
|
| 77 |
#. type: Plain text |
| 78 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 79 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 80 |
msgid "Asynchronous name lookup library (I<libanl>,\\ I<-lanl>)" |
| 81 |
msgstr "Bibliothèque de résolution de noms asynchrone (I<libanl>,\\ I<-lanl>)" |
| 82 |
|
| 83 |
#. type: SH |
| 84 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 85 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 86 |
#, no-wrap |
| 87 |
msgid "SYNOPSIS" |
| 88 |
msgstr "SYNOPSIS" |
| 89 |
|
| 90 |
#. type: Plain text |
| 91 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 92 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 93 |
#, no-wrap |
| 94 |
msgid "" |
| 95 |
"B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n" |
| 96 |
"B<#include E<lt>netdb.hE<gt>>\n" |
| 97 |
msgstr "" |
| 98 |
"B<#define _GNU_SOURCE> /* Consultez feature_test_macros(7) */\n" |
| 99 |
"B<#include E<lt>netdb.hE<gt>>\n" |
| 100 |
|
| 101 |
#. type: Plain text |
| 102 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 103 |
#: opensuse-tumbleweed |
| 104 |
#, fuzzy, no-wrap |
| 105 |
#| msgid "" |
| 106 |
#| "B<int getaddrinfo_a(int >I<mode>B<, struct gaicb *>I<list>B<[restrict],>\n" |
| 107 |
#| "B< int >I<n>B<, struct sigevent *restrict >I<sevp>B<);>\n" |
| 108 |
#| "B<int gai_suspend(const struct gaicb *const >I<list>B<[], int >I<n>B<,>\n" |
| 109 |
#| "B< const struct timespec *>I<timeout>B<);>\n" |
| 110 |
msgid "" |
| 111 |
"B<int getaddrinfo_a(int >I<mode>B<, struct gaicb *>I<list>B<[restrict >I<n>B<],>\n" |
| 112 |
"B< int >I<n>B<, struct sigevent *restrict >I<sevp>B<);>\n" |
| 113 |
"B<int gai_suspend(const struct gaicb *const >I<list>B<[>I<n>B<], int >I<n>B<,>\n" |
| 114 |
"B< const struct timespec *>I<timeout>B<);>\n" |
| 115 |
msgstr "" |
| 116 |
"B<int getaddrinfo_a(int >I<mode>B<, struct gaicb *>I<list>B<[restrict],>\n" |
| 117 |
"B< int >I<n>B<, struct sigevent *restrict >I<sevp>B<);>\n" |
| 118 |
"B<int gai_suspend(const struct gaicb *const >I<list>B<[], int >I<n>B<,>\n" |
| 119 |
"B< const struct timespec *>I<timeout>B<);>\n" |
| 120 |
|
| 121 |
#. type: Plain text |
| 122 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 123 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 124 |
#, no-wrap |
| 125 |
msgid "" |
| 126 |
"B<int gai_error(struct gaicb *>I<req>B<);>\n" |
| 127 |
"B<int gai_cancel(struct gaicb *>I<req>B<);>\n" |
| 128 |
msgstr "" |
| 129 |
"B<int gai_error(struct gaicb *>I<req>B<);>\n" |
| 130 |
"B<int gai_cancel(struct gaicb *>I<req>B<);>\n" |
| 131 |
|
| 132 |
#. type: SH |
| 133 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 134 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 135 |
#, no-wrap |
| 136 |
msgid "DESCRIPTION" |
| 137 |
msgstr "DESCRIPTION" |
| 138 |
|
| 139 |
#. type: Plain text |
| 140 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 141 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 142 |
msgid "" |
| 143 |
"The B<getaddrinfo_a>() function performs the same task as " |
| 144 |
"B<getaddrinfo>(3), but allows multiple name look-ups to be performed " |
| 145 |
"asynchronously, with optional notification on completion of look-up " |
| 146 |
"operations." |
| 147 |
msgstr "" |
| 148 |
"La fonction B<getaddrinfo_a>() effectue la même opération que " |
| 149 |
"B<getaddrinfo>(3), mais permet d'effectuer plusieurs résolutions de manière " |
| 150 |
"asynchrone et de recevoir une notification à chaque résolution effectuée." |
| 151 |
|
| 152 |
#. type: Plain text |
| 153 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 154 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 155 |
msgid "The I<mode> argument has one of the following values:" |
| 156 |
msgstr "Le champ I<mode> peut prendre une des valeurs suivantes\\ :" |
| 157 |
|
| 158 |
#. type: TP |
| 159 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 160 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 161 |
#, no-wrap |
| 162 |
msgid "B<GAI_WAIT>" |
| 163 |
msgstr "B<GAI_WAIT>" |
| 164 |
|
| 165 |
#. type: Plain text |
| 166 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 167 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 168 |
msgid "" |
| 169 |
"Perform the look-ups synchronously. The call blocks until the look-ups have " |
| 170 |
"completed." |
| 171 |
msgstr "" |
| 172 |
"Effectue les résolutions de manière synchrone. L'appel bloque tant que les " |
| 173 |
"résolutions ne sont pas terminées." |
| 174 |
|
| 175 |
#. type: TP |
| 176 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 177 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 178 |
#, no-wrap |
| 179 |
msgid "B<GAI_NOWAIT>" |
| 180 |
msgstr "B<GAI_NOWAIT>" |
| 181 |
|
| 182 |
#. type: Plain text |
| 183 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 184 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 185 |
msgid "" |
| 186 |
"Perform the look-ups asynchronously. The call returns immediately, and the " |
| 187 |
"requests are resolved in the background. See the discussion of the I<sevp> " |
| 188 |
"argument below." |
| 189 |
msgstr "" |
| 190 |
"Effectue les résolutions de manière asynchrone. L'appel s'achève " |
| 191 |
"immédiatement et les requêtes sont résolues en arrière-plan. Consultez la " |
| 192 |
"description du paramètre I<sevp> ci-dessous." |
| 193 |
|
| 194 |
#. type: Plain text |
| 195 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 196 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 197 |
msgid "" |
| 198 |
"The array I<list> specifies the look-up requests to process. The I<n> " |
| 199 |
"argument specifies the number of elements in I<list>. The requested look-up " |
| 200 |
"operations are started in parallel. NULL elements in I<list> are ignored. " |
| 201 |
"Each request is described by a I<gaicb> structure, defined as follows:" |
| 202 |
msgstr "" |
| 203 |
"Le tableau I<list> indique les requêtes de recherche à traiter. Le paramètre " |
| 204 |
"I<n> indique le nombre d'éléments dans I<list>. Les opérations de recherche " |
| 205 |
"demandées sont lancées en parallèle. Les éléments égal à NULL de I<list> " |
| 206 |
"sont ignorés. Chaque requête est décrite par une structure I<gaicb> définie " |
| 207 |
"ci-dessous\\ :" |
| 208 |
|
| 209 |
#. type: Plain text |
| 210 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 211 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 212 |
#, no-wrap |
| 213 |
msgid "" |
| 214 |
"struct gaicb {\n" |
| 215 |
" const char *ar_name;\n" |
| 216 |
" const char *ar_service;\n" |
| 217 |
" const struct addrinfo *ar_request;\n" |
| 218 |
" struct addrinfo *ar_result;\n" |
| 219 |
"};\n" |
| 220 |
msgstr "" |
| 221 |
"struct gaicb {\n" |
| 222 |
" const char *ar_name;\n" |
| 223 |
" const char *ar_service;\n" |
| 224 |
" const struct addrinfo *ar_request;\n" |
| 225 |
" struct addrinfo *ar_result;\n" |
| 226 |
"};\n" |
| 227 |
|
| 228 |
#. type: Plain text |
| 229 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 230 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 231 |
msgid "" |
| 232 |
"The elements of this structure correspond to the arguments of " |
| 233 |
"B<getaddrinfo>(3). Thus, I<ar_name> corresponds to the I<node> argument and " |
| 234 |
"I<ar_service> to the I<service> argument, identifying an Internet host and a " |
| 235 |
"service. The I<ar_request> element corresponds to the I<hints> argument, " |
| 236 |
"specifying the criteria for selecting the returned socket address " |
| 237 |
"structures. Finally, I<ar_result> corresponds to the I<res> argument; you " |
| 238 |
"do not need to initialize this element, it will be automatically set when " |
| 239 |
"the request is resolved. The I<addrinfo> structure referenced by the last " |
| 240 |
"two elements is described in B<getaddrinfo>(3)." |
| 241 |
msgstr "" |
| 242 |
"Les éléments de cette structure correspondent aux paramètres de " |
| 243 |
"B<getaddrinfo>(3). Ainsi, I<ar_name> correspond au paramètre I<node> et " |
| 244 |
"I<ar_service> au paramètre I<service>, identifiant respectivement un hôte et " |
| 245 |
"un service Internet. L'élément I<ar_request> correspond au paramètre " |
| 246 |
"I<hints>, indiquant le critère de sélection des structures d'adresse de " |
| 247 |
"socket renvoyées. Enfin, I<ar_result> correspond au paramètre I<res>\\ ; " |
| 248 |
"vous n'avez pas besoin d'initialiser ce paramètre, il sera automatiquement " |
| 249 |
"défini lorsque la requête sera résolue. La structure I<addrinfo> référencée " |
| 250 |
"par les deux derniers éléments est décrite dans B<getaddrinfo>(3)." |
| 251 |
|
| 252 |
#. type: Plain text |
| 253 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 254 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 255 |
msgid "" |
| 256 |
"When I<mode> is specified as B<GAI_NOWAIT>, notifications about resolved " |
| 257 |
"requests can be obtained by employing the I<sigevent> structure pointed to " |
| 258 |
"by the I<sevp> argument. For the definition and general details of this " |
| 259 |
"structure, see B<sigevent>(3type). The I<sevp-E<gt>sigev_notify> field can " |
| 260 |
"have the following values:" |
| 261 |
msgstr "" |
| 262 |
"Lorsque I<mode> est défini à B<GAI_NOWAIT>, les notifications des requêtes " |
| 263 |
"résolues peuvent être obtenues avec la structure I<sigevent> pointée par le " |
| 264 |
"paramètre I<sevp>. Pour la définition et les détails généraux de cette " |
| 265 |
"structure, consultez B<sigevent>(3type). Le champ I<sevp-E<gt>sigev_notify> " |
| 266 |
"peut prendre l'une des valeurs suivantes\\ :" |
| 267 |
|
| 268 |
#. type: TP |
| 269 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 270 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 271 |
#, no-wrap |
| 272 |
msgid "B<SIGEV_NONE>" |
| 273 |
msgstr "B<SIGEV_NONE>" |
| 274 |
|
| 275 |
#. type: Plain text |
| 276 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 277 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 278 |
msgid "Don't provide any notification." |
| 279 |
msgstr "Ne fournit pas de notification." |
| 280 |
|
| 281 |
#. type: TP |
| 282 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 283 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 284 |
#, no-wrap |
| 285 |
msgid "B<SIGEV_SIGNAL>" |
| 286 |
msgstr "B<SIGEV_SIGNAL>" |
| 287 |
|
| 288 |
#. si_pid and si_uid are also set, to the values of the calling process, |
| 289 |
#. which doesn't provide useful information, so we'll skip mentioning it. |
| 290 |
#. type: Plain text |
| 291 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 292 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 293 |
msgid "" |
| 294 |
"When a look-up completes, generate the signal I<sigev_signo> for the " |
| 295 |
"process. See B<sigevent>(3type) for general details. The I<si_code> field " |
| 296 |
"of the I<siginfo_t> structure will be set to B<SI_ASYNCNL>." |
| 297 |
msgstr "" |
| 298 |
"Lorsqu'une recherche se termine, générer le signal I<sigev_signo> à " |
| 299 |
"destination du processus. Consultez B<sigevent>(3type) pour plus de détails. " |
| 300 |
"Le champ I<si_code> de la structure I<siginfo_t> sera défini à B<SI_ASYNCNL>." |
| 301 |
|
| 302 |
#. type: TP |
| 303 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 304 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 305 |
#, no-wrap |
| 306 |
msgid "B<SIGEV_THREAD>" |
| 307 |
msgstr "B<SIGEV_THREAD>" |
| 308 |
|
| 309 |
#. type: Plain text |
| 310 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 311 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 312 |
msgid "" |
| 313 |
"When a look-up completes, invoke I<sigev_notify_function> as if it were the " |
| 314 |
"start function of a new thread. See B<sigevent>(3type) for details." |
| 315 |
msgstr "" |
| 316 |
"Lors d'une résolution, invoquer I<sigev_notify_function> comme si c'était la " |
| 317 |
"fonction de création d'un nouveau processus léger. Consultez " |
| 318 |
"B<sigevent>(3type) pour plus détails." |
| 319 |
|
| 320 |
#. type: Plain text |
| 321 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 322 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 323 |
msgid "" |
| 324 |
"For B<SIGEV_SIGNAL> and B<SIGEV_THREAD>, it may be useful to point I<sevp-" |
| 325 |
"E<gt>sigev_value.sival_ptr> to I<list>." |
| 326 |
msgstr "" |
| 327 |
"Pour B<SIGEV_SIGNAL> et B<SIGEV_THREAD>, il peut être utile de faire pointer " |
| 328 |
"I<sevp-E<gt>sigev_value.sival_ptr> vers I<list>." |
| 329 |
|
| 330 |
#. type: Plain text |
| 331 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 332 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 333 |
msgid "" |
| 334 |
"The B<gai_suspend>() function suspends execution of the calling thread, " |
| 335 |
"waiting for the completion of one or more requests in the array I<list>. " |
| 336 |
"The I<n> argument specifies the size of the array I<list>. The call blocks " |
| 337 |
"until one of the following occurs:" |
| 338 |
msgstr "" |
| 339 |
"La fonction B<gai_suspend>() suspend l'exécution du processus léger " |
| 340 |
"appelant, attendant la fin d'une ou plusieurs requêtes du tableau I<list>. " |
| 341 |
"L'argument I<n> indique la taille du tableau I<list>. L'appel est bloquant " |
| 342 |
"tant que l'un des événements suivants ne se produisent :" |
| 343 |
|
| 344 |
#. type: IP |
| 345 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 346 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 347 |
#, no-wrap |
| 348 |
msgid "\\[bu]" |
| 349 |
msgstr "-" |
| 350 |
|
| 351 |
#. type: Plain text |
| 352 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 353 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 354 |
msgid "One or more of the operations in I<list> completes." |
| 355 |
msgstr "Une ou plusieurs des opérations de I<list> se sont terminées." |
| 356 |
|
| 357 |
#. type: Plain text |
| 358 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 359 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 360 |
msgid "The call is interrupted by a signal that is caught." |
| 361 |
msgstr "L'appel a été interrompu par un signal qui a été interrompu." |
| 362 |
|
| 363 |
#. type: Plain text |
| 364 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 365 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 366 |
msgid "" |
| 367 |
"The time interval specified in I<timeout> elapses. This argument specifies " |
| 368 |
"a timeout in seconds plus nanoseconds (see B<nanosleep>(2) for details of " |
| 369 |
"the I<timespec> structure). If I<timeout> is NULL, then the call blocks " |
| 370 |
"indefinitely (until one of the events above occurs)." |
| 371 |
msgstr "" |
| 372 |
"L'intervalle de temps indiqué dans I<timeout> s'est écoulé. Ce paramètre " |
| 373 |
"indique un délai en seconds plus nanosecondes (consultez B<nanosleep>(2) " |
| 374 |
"pour plus de détails sur la structure I<timespec>). Si I<timeout> est NULL, " |
| 375 |
"alors l'appel est bloqué indéfiniment (à moins que l'un des événement ci-" |
| 376 |
"dessus se produisent)." |
| 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 |
"No explicit indication of which request was completed is given; you must " |
| 383 |
"determine which request(s) have completed by iterating with B<gai_error>() " |
| 384 |
"over the list of requests." |
| 385 |
msgstr "" |
| 386 |
"Aucune indication explicite sur la requête qui s'est terminée est " |
| 387 |
"fournie\\ ; vous devez déterminer quelle requête s'est terminée en " |
| 388 |
"parcourant avec B<gai_error>() la liste des requête (il peut y avoir " |
| 389 |
"plusieurs requêtes)." |
| 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 |
"The B<gai_error>() function returns the status of the request I<req>: " |
| 396 |
"either B<EAI_INPROGRESS> if the request was not completed yet, 0 if it was " |
| 397 |
"handled successfully, or an error code if the request could not be resolved." |
| 398 |
msgstr "" |
| 399 |
"La fonction B<gai_error>() renvoie l'état de la requête I<req>\\ : soit " |
| 400 |
"B<EAI_INPROGRESS> si la requête ne s'est pas encore terminée, soit B<0> si " |
| 401 |
"elle s'est terminé correctement ou soit un code d'erreur si elle ne peut pas " |
| 402 |
"être résolue." |
| 403 |
|
| 404 |
#. type: Plain text |
| 405 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 406 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 407 |
msgid "" |
| 408 |
"The B<gai_cancel>() function cancels the request I<req>. If the request " |
| 409 |
"has been canceled successfully, the error status of the request will be set " |
| 410 |
"to B<EAI_CANCELED> and normal asynchronous notification will be performed. " |
| 411 |
"The request cannot be canceled if it is currently being processed; in that " |
| 412 |
"case, it will be handled as if B<gai_cancel>() has never been called. If " |
| 413 |
"I<req> is NULL, an attempt is made to cancel all outstanding requests that " |
| 414 |
"the process has made." |
| 415 |
msgstr "" |
| 416 |
"La fonction B<gai_cancel>() annule la requête I<req>. Si la requête a été " |
| 417 |
"annulée avec succès, le statut d'erreur de la requête sera défini à " |
| 418 |
"B<EAI_CANCELED> et un notification asynchrone normale sera exécutée. La " |
| 419 |
"requête ne peut pas être annulée si elle est en cours d'utilisation\\ ; dans " |
| 420 |
"ce cas, elle continuera comme si B<gai_cancel>() n'avait jamais été appelée. " |
| 421 |
"Si I<req> est NULL, une tentative d'annulation de toutes les requêtes en " |
| 422 |
"cours que le processus a fait sera exécutée." |
| 423 |
|
| 424 |
#. type: SH |
| 425 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 426 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 427 |
#, no-wrap |
| 428 |
msgid "RETURN VALUE" |
| 429 |
msgstr "VALEUR RENVOYÉE" |
| 430 |
|
| 431 |
#. type: Plain text |
| 432 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 433 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 434 |
msgid "" |
| 435 |
"The B<getaddrinfo_a>() function returns 0 if all of the requests have been " |
| 436 |
"enqueued successfully, or one of the following nonzero error codes:" |
| 437 |
msgstr "" |
| 438 |
"La fonction B<getaddrinfo_a>() renvoie B<0> si toutes les requêtes ont été " |
| 439 |
"mises en file d'attente avec succès, ou un des codes d'erreur non nuls " |
| 440 |
"suivants\\ :" |
| 441 |
|
| 442 |
#. type: TP |
| 443 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 444 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 445 |
#, no-wrap |
| 446 |
msgid "B<EAI_AGAIN>" |
| 447 |
msgstr "B<EAI_AGAIN>" |
| 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 |
"The resources necessary to enqueue the look-up requests were not available. " |
| 454 |
"The application may check the error status of each request to determine " |
| 455 |
"which ones failed." |
| 456 |
msgstr "" |
| 457 |
"Les ressources nécessaires pour mettre en file d'attente les requêtes de " |
| 458 |
"recherche ne sont pas disponibles. L'application devrait vérifier le statut " |
| 459 |
"d'erreur de chaque requête pour déterminer laquelle a échoué." |
| 460 |
|
| 461 |
#. type: TP |
| 462 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 463 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 464 |
#, no-wrap |
| 465 |
msgid "B<EAI_MEMORY>" |
| 466 |
msgstr "B<EAI_MEMORY>" |
| 467 |
|
| 468 |
#. type: Plain text |
| 469 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 470 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 471 |
msgid "Out of memory." |
| 472 |
msgstr "Plus assez de mémoire." |
| 473 |
|
| 474 |
#. type: TP |
| 475 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 476 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 477 |
#, no-wrap |
| 478 |
msgid "B<EAI_SYSTEM>" |
| 479 |
msgstr "B<EAI_SYSTEM>" |
| 480 |
|
| 481 |
#. type: Plain text |
| 482 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 483 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 484 |
msgid "I<mode> is invalid." |
| 485 |
msgstr "I<mode> est non valable." |
| 486 |
|
| 487 |
#. type: Plain text |
| 488 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 489 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 490 |
msgid "" |
| 491 |
"The B<gai_suspend>() function returns 0 if at least one of the listed " |
| 492 |
"requests has been completed. Otherwise, it returns one of the following " |
| 493 |
"nonzero error codes:" |
| 494 |
msgstr "" |
| 495 |
"La fonction B<gai_suspend>() renvoie B<0> si au moins une des requêtes " |
| 496 |
"listées s'est terminée. Sinon, elle renvoie un des codes d'erreur non nuls " |
| 497 |
"suivants\\ :" |
| 498 |
|
| 499 |
#. type: Plain text |
| 500 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 501 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 502 |
msgid "" |
| 503 |
"The given timeout expired before any of the requests could be completed." |
| 504 |
msgstr "Le délai d'attente a expiré avant que toute requête ne soit terminée." |
| 505 |
|
| 506 |
#. type: TP |
| 507 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 508 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 509 |
#, no-wrap |
| 510 |
msgid "B<EAI_ALLDONE>" |
| 511 |
msgstr "B<EAI_ALLDONE>" |
| 512 |
|
| 513 |
#. type: Plain text |
| 514 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 515 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 516 |
msgid "There were no actual requests given to the function." |
| 517 |
msgstr "Il n'y a actuellement aucune requête fournie à la fonction." |
| 518 |
|
| 519 |
#. type: TP |
| 520 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 521 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 522 |
#, no-wrap |
| 523 |
msgid "B<EAI_INTR>" |
| 524 |
msgstr "B<EAI_INTR>" |
| 525 |
|
| 526 |
#. type: Plain text |
| 527 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 528 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 529 |
msgid "" |
| 530 |
"A signal has interrupted the function. Note that this interruption might " |
| 531 |
"have been caused by signal notification of some completed look-up request." |
| 532 |
msgstr "" |
| 533 |
"Un signal a interrompu la fonction. Notez que cette interruption pourrait " |
| 534 |
"avoir été causé par une notification de signal de fin de certaines requêtes " |
| 535 |
"de recherche." |
| 536 |
|
| 537 |
#. type: Plain text |
| 538 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 539 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 540 |
msgid "" |
| 541 |
"The B<gai_error>() function can return B<EAI_INPROGRESS> for an unfinished " |
| 542 |
"look-up request, 0 for a successfully completed look-up (as described " |
| 543 |
"above), one of the error codes that could be returned by B<getaddrinfo>(3), " |
| 544 |
"or the error code B<EAI_CANCELED> if the request has been canceled " |
| 545 |
"explicitly before it could be finished." |
| 546 |
msgstr "" |
| 547 |
"La fonction B<gai_error>() peut renvoyer B<EAI_INPROGRESS> pour une requête " |
| 548 |
"de recherche non terminée, B<0> pour une recherche terminée avec succès (cas " |
| 549 |
"décrit ci-dessus), un des codes d'erreur qui peut être renvoyé par " |
| 550 |
"B<getaddrinfo>(3), ou le code d'erreur B<EAI_CANCELED> si la requête a été " |
| 551 |
"annulée explicitement avant quelle ne soit terminée." |
| 552 |
|
| 553 |
#. type: Plain text |
| 554 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 555 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 556 |
msgid "The B<gai_cancel>() function can return one of these values:" |
| 557 |
msgstr "La fonction B<gai_cancel>() peut renvoyer une des valeurs suivantes :" |
| 558 |
|
| 559 |
#. type: TP |
| 560 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 561 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 562 |
#, no-wrap |
| 563 |
msgid "B<EAI_CANCELED>" |
| 564 |
msgstr "B<EAI_CANCELED>" |
| 565 |
|
| 566 |
#. type: Plain text |
| 567 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 568 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 569 |
msgid "The request has been canceled successfully." |
| 570 |
msgstr "La requête a été annulée avec succès." |
| 571 |
|
| 572 |
#. type: TP |
| 573 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 574 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 575 |
#, no-wrap |
| 576 |
msgid "B<EAI_NOTCANCELED>" |
| 577 |
msgstr "B<EAI_NOTCANCELED>" |
| 578 |
|
| 579 |
#. type: Plain text |
| 580 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 581 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 582 |
msgid "The request has not been canceled." |
| 583 |
msgstr "La requête n'a pas été annulée." |
| 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 "The request has already completed." |
| 589 |
msgstr "La requête est déjà terminée." |
| 590 |
|
| 591 |
#. type: Plain text |
| 592 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 593 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 594 |
msgid "" |
| 595 |
"The B<gai_strerror>(3) function translates these error codes to a human " |
| 596 |
"readable string, suitable for error reporting." |
| 597 |
msgstr "" |
| 598 |
"La fonction B<gai_strerror>(3) traduit ces codes d'erreur en une chaîne de " |
| 599 |
"caractères compréhensible, utilisable pour rendre compte du problème." |
| 600 |
|
| 601 |
#. type: SH |
| 602 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 603 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 604 |
#, no-wrap |
| 605 |
msgid "ATTRIBUTES" |
| 606 |
msgstr "ATTRIBUTS" |
| 607 |
|
| 608 |
#. type: Plain text |
| 609 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 610 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 611 |
msgid "" |
| 612 |
"For an explanation of the terms used in this section, see B<attributes>(7)." |
| 613 |
msgstr "" |
| 614 |
"Pour une explication des termes utilisés dans cette section, consulter " |
| 615 |
"B<attributes>(7)." |
| 616 |
|
| 617 |
#. type: tbl table |
| 618 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 619 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 620 |
#, no-wrap |
| 621 |
msgid "Interface" |
| 622 |
msgstr "Interface" |
| 623 |
|
| 624 |
#. type: tbl table |
| 625 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 626 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 627 |
#, no-wrap |
| 628 |
msgid "Attribute" |
| 629 |
msgstr "Attribut" |
| 630 |
|
| 631 |
#. type: tbl table |
| 632 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 633 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 634 |
#, no-wrap |
| 635 |
msgid "Value" |
| 636 |
msgstr "Valeur" |
| 637 |
|
| 638 |
#. type: tbl table |
| 639 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 640 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 641 |
#, no-wrap |
| 642 |
msgid ".na\n" |
| 643 |
msgstr ".na\n" |
| 644 |
|
| 645 |
#. type: tbl table |
| 646 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 647 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 648 |
#, no-wrap |
| 649 |
msgid ".nh\n" |
| 650 |
msgstr ".nh\n" |
| 651 |
|
| 652 |
#. type: tbl table |
| 653 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 654 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 655 |
#, no-wrap |
| 656 |
msgid "" |
| 657 |
"B<getaddrinfo_a>(),\n" |
| 658 |
"B<gai_suspend>(),\n" |
| 659 |
"B<gai_error>(),\n" |
| 660 |
"B<gai_cancel>()" |
| 661 |
msgstr "" |
| 662 |
"B<getaddrinfo_a>(),\n" |
| 663 |
"B<gai_suspend>(),\n" |
| 664 |
"B<gai_error>(),\n" |
| 665 |
"B<gai_cancel>()" |
| 666 |
|
| 667 |
#. type: tbl table |
| 668 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 669 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 670 |
#, no-wrap |
| 671 |
msgid "Thread safety" |
| 672 |
msgstr "Sécurité des threads" |
| 673 |
|
| 674 |
#. type: tbl table |
| 675 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 676 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 677 |
#, no-wrap |
| 678 |
msgid "MT-Safe" |
| 679 |
msgstr "MT-Safe" |
| 680 |
|
| 681 |
#. type: SH |
| 682 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 683 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 684 |
#, no-wrap |
| 685 |
msgid "STANDARDS" |
| 686 |
msgstr "NORMES" |
| 687 |
|
| 688 |
#. type: Plain text |
| 689 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 690 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 691 |
msgid "GNU." |
| 692 |
msgstr "GNU." |
| 693 |
|
| 694 |
#. type: SH |
| 695 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 696 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 697 |
#, no-wrap |
| 698 |
msgid "HISTORY" |
| 699 |
msgstr "HISTORIQUE" |
| 700 |
|
| 701 |
#. type: Plain text |
| 702 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 703 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 704 |
msgid "glibc 2.2.3." |
| 705 |
msgstr "glibc 2.2.3." |
| 706 |
|
| 707 |
#. type: Plain text |
| 708 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 709 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 710 |
msgid "" |
| 711 |
"The interface of B<getaddrinfo_a>() was modeled after the B<lio_listio>(3) " |
| 712 |
"interface." |
| 713 |
msgstr "" |
| 714 |
"L'interface de B<getaddrinfo_a>() a été modifiée après l'interface " |
| 715 |
"B<lio_listio>(3)." |
| 716 |
|
| 717 |
#. type: SH |
| 718 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 719 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 720 |
#, no-wrap |
| 721 |
msgid "EXAMPLES" |
| 722 |
msgstr "EXEMPLES" |
| 723 |
|
| 724 |
#. type: Plain text |
| 725 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 726 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 727 |
msgid "" |
| 728 |
"Two examples are provided: a simple example that resolves several requests " |
| 729 |
"in parallel synchronously, and a complex example showing some of the " |
| 730 |
"asynchronous capabilities." |
| 731 |
msgstr "" |
| 732 |
"Deux exemples sont fournis\\ : un simple exemple qui résout plusieurs " |
| 733 |
"requête en parallèle de façon synchrone et un exemple complexe montrant " |
| 734 |
"certaines des capacités asynchrones." |
| 735 |
|
| 736 |
#. type: SS |
| 737 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 738 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 739 |
#, no-wrap |
| 740 |
msgid "Synchronous example" |
| 741 |
msgstr "Exemple synchrone" |
| 742 |
|
| 743 |
#. type: Plain text |
| 744 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 745 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 746 |
msgid "" |
| 747 |
"The program below simply resolves several hostnames in parallel, giving a " |
| 748 |
"speed-up compared to resolving the hostnames sequentially using " |
| 749 |
"B<getaddrinfo>(3). The program might be used like this:" |
| 750 |
msgstr "" |
| 751 |
"Le programme ci-dessous résout simplement plusieurs noms d'hôte en " |
| 752 |
"parallèle, améliorant le temps de résolution des noms d'hôtes comparé à des " |
| 753 |
"appels séquentiels à B<getaddrinfo>(3). Le programme peut être utilisé comme " |
| 754 |
"suit\\ :" |
| 755 |
|
| 756 |
#. type: Plain text |
| 757 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 758 |
#: opensuse-tumbleweed |
| 759 |
#, fuzzy, no-wrap |
| 760 |
#| msgid "" |
| 761 |
#| "$ B<./a.out mirrors.kernel.org enoent.linuxfoundation.org gnu.org>\n" |
| 762 |
#| "mirrors.kernel.org: 139.178.88.99\n" |
| 763 |
#| "enoent.linuxfoundation.org: Name or service not known\n" |
| 764 |
#| "gnu.org: 209.51.188.116\n" |
| 765 |
msgid "" |
| 766 |
"$B< ./a.out mirrors.kernel.org enoent.linuxfoundation.org gnu.org>;\n" |
| 767 |
"mirrors.kernel.org: 139.178.88.99\n" |
| 768 |
"enoent.linuxfoundation.org: Name or service not known\n" |
| 769 |
"gnu.org: 209.51.188.116\n" |
| 770 |
msgstr "" |
| 771 |
"$ B<./a.out mirrors.kernel.org enoent.linuxfoundation.org gnu.org>\n" |
| 772 |
"mirrors.kernel.org: 139.178.88.99\n" |
| 773 |
"enoent.linuxfoundation.org: Name or service not known\n" |
| 774 |
"gnu.org: 209.51.188.116\n" |
| 775 |
|
| 776 |
#. type: Plain text |
| 777 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 778 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 779 |
msgid "Here is the program source code" |
| 780 |
msgstr "Voilà le code source du programme" |
| 781 |
|
| 782 |
#. type: Plain text |
| 783 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 784 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 785 |
#, no-wrap |
| 786 |
msgid "" |
| 787 |
"#define _GNU_SOURCE\n" |
| 788 |
"#include E<lt>err.hE<gt>\n" |
| 789 |
"#include E<lt>netdb.hE<gt>\n" |
| 790 |
"#include E<lt>stdio.hE<gt>\n" |
| 791 |
"#include E<lt>stdlib.hE<gt>\n" |
| 792 |
"#include E<lt>string.hE<gt>\n" |
| 793 |
"\\&\n" |
| 794 |
"#define MALLOC(n, type) ((type *) reallocarray(NULL, n, sizeof(type)))\n" |
| 795 |
"\\&\n" |
| 796 |
"int\n" |
| 797 |
"main(int argc, char *argv[])\n" |
| 798 |
"{\n" |
| 799 |
" int ret;\n" |
| 800 |
" struct gaicb *reqs[argc - 1];\n" |
| 801 |
" char host[NI_MAXHOST];\n" |
| 802 |
" struct addrinfo *res;\n" |
| 803 |
"\\&\n" |
| 804 |
" if (argc E<lt> 2) {\n" |
| 805 |
" fprintf(stderr, \"Usage: %s HOST...\\[rs]n\", argv[0]);\n" |
| 806 |
" exit(EXIT_FAILURE);\n" |
| 807 |
" }\n" |
| 808 |
"\\&\n" |
| 809 |
" for (size_t i = 0; i E<lt> argc - 1; i++) {\n" |
| 810 |
" reqs[i] = MALLOC(1, struct gaicb);\n" |
| 811 |
" if (reqs[i] == NULL)\n" |
| 812 |
" err(EXIT_FAILURE, \"malloc\");\n" |
| 813 |
"\\&\n" |
| 814 |
" memset(reqs[i], 0, sizeof(*reqs[0]));\n" |
| 815 |
" reqs[i]-E<gt>ar_name = argv[i + 1];\n" |
| 816 |
" }\n" |
| 817 |
"\\&\n" |
| 818 |
" ret = getaddrinfo_a(GAI_WAIT, reqs, argc - 1, NULL);\n" |
| 819 |
" if (ret != 0) {\n" |
| 820 |
" fprintf(stderr, \"getaddrinfo_a() failed: %s\\[rs]n\",\n" |
| 821 |
" gai_strerror(ret));\n" |
| 822 |
" exit(EXIT_FAILURE);\n" |
| 823 |
" }\n" |
| 824 |
"\\&\n" |
| 825 |
" for (size_t i = 0; i E<lt> argc - 1; i++) {\n" |
| 826 |
" printf(\"%s: \", reqs[i]-E<gt>ar_name);\n" |
| 827 |
" ret = gai_error(reqs[i]);\n" |
| 828 |
" if (ret == 0) {\n" |
| 829 |
" res = reqs[i]-E<gt>ar_result;\n" |
| 830 |
"\\&\n" |
| 831 |
" ret = getnameinfo(res-E<gt>ai_addr, res-E<gt>ai_addrlen,\n" |
| 832 |
" host, sizeof(host),\n" |
| 833 |
" NULL, 0, NI_NUMERICHOST);\n" |
| 834 |
" if (ret != 0) {\n" |
| 835 |
" fprintf(stderr, \"getnameinfo() failed: %s\\[rs]n\",\n" |
| 836 |
" gai_strerror(ret));\n" |
| 837 |
" exit(EXIT_FAILURE);\n" |
| 838 |
" }\n" |
| 839 |
" puts(host);\n" |
| 840 |
"\\&\n" |
| 841 |
" } else {\n" |
| 842 |
" puts(gai_strerror(ret));\n" |
| 843 |
" }\n" |
| 844 |
" }\n" |
| 845 |
" exit(EXIT_SUCCESS);\n" |
| 846 |
"}\n" |
| 847 |
msgstr "" |
| 848 |
"#define _GNU_SOURCE\n" |
| 849 |
"#include E<lt>err.hE<gt>\n" |
| 850 |
"#include E<lt>netdb.hE<gt>\n" |
| 851 |
"#include E<lt>stdio.hE<gt>\n" |
| 852 |
"#include E<lt>stdlib.hE<gt>\n" |
| 853 |
"#include E<lt>string.hE<gt>\n" |
| 854 |
"\\&\n" |
| 855 |
"#define MALLOC(n, type) ((type *) reallocarray(NULL, n, sizeof(type)))\n" |
| 856 |
"\\&\n" |
| 857 |
"int\n" |
| 858 |
"main(int argc, char *argv[])\n" |
| 859 |
"{\n" |
| 860 |
" int ret;\n" |
| 861 |
" struct gaicb *reqs[argc - 1];\n" |
| 862 |
" char host[NI_MAXHOST];\n" |
| 863 |
" struct addrinfo *res;\n" |
| 864 |
"\\&\n" |
| 865 |
" if (argc E<lt> 2) {\n" |
| 866 |
" fprintf(stderr, \"Utilisation : %s HOST...\\[rs]n\", argv[0]);\n" |
| 867 |
" exit(EXIT_FAILURE);\n" |
| 868 |
" }\n" |
| 869 |
"\\&\n" |
| 870 |
" for (size_t i = 0; i E<lt> argc - 1; i++) {\n" |
| 871 |
" reqs[i] = MALLOC(1, struct gaicb);\n" |
| 872 |
" if (reqs[i] == NULL)\n" |
| 873 |
" err(EXIT_FAILURE, \"malloc\");\n" |
| 874 |
"\\&\n" |
| 875 |
" memset(reqs[i], 0, sizeof(*reqs[0]));\n" |
| 876 |
" reqs[i]-E<gt>ar_name = argv[i + 1];\n" |
| 877 |
" }\n" |
| 878 |
"\\&\n" |
| 879 |
" ret = getaddrinfo_a(GAI_WAIT, reqs, argc - 1, NULL);\n" |
| 880 |
" if (ret != 0) {\n" |
| 881 |
" fprintf(stderr, \"getaddrinfo_a() a échoué : %s\\[rs]n\",\n" |
| 882 |
" gai_strerror(ret));\n" |
| 883 |
" exit(EXIT_FAILURE);\n" |
| 884 |
" }\n" |
| 885 |
"\\&\n" |
| 886 |
" for (size_t i = 0; i E<lt> argc - 1; i++) {\n" |
| 887 |
" printf(\"%s: \", reqs[i]-E<gt>ar_name);\n" |
| 888 |
" ret = gai_error(reqs[i]);\n" |
| 889 |
" if (ret == 0) {\n" |
| 890 |
" res = reqs[i]-E<gt>ar_result;\n" |
| 891 |
"\\&\n" |
| 892 |
" ret = getnameinfo(res-E<gt>ai_addr, res-E<gt>ai_addrlen,\n" |
| 893 |
" host, sizeof(host),\n" |
| 894 |
" NULL, 0, NI_NUMERICHOST);\n" |
| 895 |
" if (ret != 0) {\n" |
| 896 |
" fprintf(stderr, \"getnameinfo() a échoué : %s\\[rs]n\",\n" |
| 897 |
" gai_strerror(ret));\n" |
| 898 |
" exit(EXIT_FAILURE);\n" |
| 899 |
" }\n" |
| 900 |
" puts(host);\n" |
| 901 |
"\\&\n" |
| 902 |
" } else {\n" |
| 903 |
" puts(gai_strerror(ret));\n" |
| 904 |
" }\n" |
| 905 |
" }\n" |
| 906 |
" exit(EXIT_SUCCESS);\n" |
| 907 |
"}\n" |
| 908 |
|
| 909 |
#. SRC END |
| 910 |
#. type: SS |
| 911 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 912 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 913 |
#, no-wrap |
| 914 |
msgid "Asynchronous example" |
| 915 |
msgstr "Exemple asynchrone" |
| 916 |
|
| 917 |
#. type: Plain text |
| 918 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 919 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 920 |
msgid "" |
| 921 |
"This example shows a simple interactive B<getaddrinfo_a>() front-end. The " |
| 922 |
"notification facility is not demonstrated." |
| 923 |
msgstr "" |
| 924 |
"Cet exemple est une simple application interactive utilisant " |
| 925 |
"B<getaddrinfo_a>(). Les fonctionnalités de notification ne sont pas " |
| 926 |
"exploitées." |
| 927 |
|
| 928 |
#. type: Plain text |
| 929 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 930 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 931 |
msgid "An example session might look like this:" |
| 932 |
msgstr "Un exemple de session pourrait ressembler à ceci\\ :" |
| 933 |
|
| 934 |
#. type: Plain text |
| 935 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 936 |
#: opensuse-tumbleweed |
| 937 |
#, fuzzy, no-wrap |
| 938 |
#| msgid "" |
| 939 |
#| "$ B<./a.out>\n" |
| 940 |
#| "E<gt> a mirrors.kernel.org enoent.linuxfoundation.org gnu.org\n" |
| 941 |
#| "E<gt> c 2\n" |
| 942 |
#| "[2] gnu.org: Request not canceled\n" |
| 943 |
#| "E<gt> w 0 1\n" |
| 944 |
#| "[00] mirrors.kernel.org: Finished\n" |
| 945 |
#| "E<gt> l\n" |
| 946 |
#| "[00] mirrors.kernel.org: 139.178.88.99\n" |
| 947 |
#| "[01] enoent.linuxfoundation.org: Processing request in progress\n" |
| 948 |
#| "[02] gnu.org: 209.51.188.116\n" |
| 949 |
#| "E<gt> l\n" |
| 950 |
#| "[00] mirrors.kernel.org: 139.178.88.99\n" |
| 951 |
#| "[01] enoent.linuxfoundation.org: Name or service not known\n" |
| 952 |
#| "[02] gnu.org: 209.51.188.116\n" |
| 953 |
msgid "" |
| 954 |
"$B< ./a.out>;\n" |
| 955 |
"E<gt> a mirrors.kernel.org enoent.linuxfoundation.org gnu.org\n" |
| 956 |
"E<gt> c 2\n" |
| 957 |
"[2] gnu.org: Request not canceled\n" |
| 958 |
"E<gt> w 0 1\n" |
| 959 |
"[00] mirrors.kernel.org: Finished\n" |
| 960 |
"E<gt> l\n" |
| 961 |
"[00] mirrors.kernel.org: 139.178.88.99\n" |
| 962 |
"[01] enoent.linuxfoundation.org: Processing request in progress\n" |
| 963 |
"[02] gnu.org: 209.51.188.116\n" |
| 964 |
"E<gt> l\n" |
| 965 |
"[00] mirrors.kernel.org: 139.178.88.99\n" |
| 966 |
"[01] enoent.linuxfoundation.org: Name or service not known\n" |
| 967 |
"[02] gnu.org: 209.51.188.116\n" |
| 968 |
msgstr "" |
| 969 |
"$ B<./a.out>\n" |
| 970 |
"E<gt> a mirrors.kernel.org enoent.linuxfoundation.org gnu.org\n" |
| 971 |
"E<gt> c 2\n" |
| 972 |
"[2] gnu.org: Request not canceled\n" |
| 973 |
"E<gt> w 0 1\n" |
| 974 |
"[00] mirrors.kernel.org: Finished\n" |
| 975 |
"E<gt> l\n" |
| 976 |
"[00] mirrors.kernel.org: 139.178.88.99\n" |
| 977 |
"[01] enoent.linuxfoundation.org: Processing request in progress\n" |
| 978 |
"[02] gnu.org: 209.51.188.116\n" |
| 979 |
"E<gt> l\n" |
| 980 |
"[00] mirrors.kernel.org: 139.178.88.99\n" |
| 981 |
"[01] enoent.linuxfoundation.org: Name or service not known\n" |
| 982 |
"[02] gnu.org: 209.51.188.116\n" |
| 983 |
|
| 984 |
#. type: Plain text |
| 985 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 986 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 987 |
msgid "The program source is as follows:" |
| 988 |
msgstr "Le code source du programme est\\ :" |
| 989 |
|
| 990 |
#. type: Plain text |
| 991 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 992 |
#: opensuse-tumbleweed |
| 993 |
#, fuzzy, no-wrap |
| 994 |
#| msgid "" |
| 995 |
#| "#define _GNU_SOURCE\n" |
| 996 |
#| "#include E<lt>assert.hE<gt>\n" |
| 997 |
#| "#include E<lt>err.hE<gt>\n" |
| 998 |
#| "#include E<lt>netdb.hE<gt>\n" |
| 999 |
#| "#include E<lt>stdio.hE<gt>\n" |
| 1000 |
#| "#include E<lt>stdlib.hE<gt>\n" |
| 1001 |
#| "#include E<lt>string.hE<gt>\n" |
| 1002 |
#| "\\&\n" |
| 1003 |
#| "#define CALLOC(n, type) ((type *) calloc(n, sizeof(type)))\n" |
| 1004 |
#| "\\&\n" |
| 1005 |
#| "#define REALLOCF(ptr, n, type) \\[rs]\n" |
| 1006 |
#| "({ \\[rs]\n" |
| 1007 |
#| " static_assert(__builtin_types_compatible_p(typeof(ptr), type *)); \\[rs]\n" |
| 1008 |
#| " \\[rs]\n" |
| 1009 |
#| " (type *) reallocarrayf(ptr, n, sizeof(type)); \\[rs]\n" |
| 1010 |
#| "})\n" |
| 1011 |
#| "\\&\n" |
| 1012 |
#| "static struct gaicb **reqs = NULL;\n" |
| 1013 |
#| "static size_t nreqs = 0;\n" |
| 1014 |
#| "\\&\n" |
| 1015 |
#| "static inline void *\n" |
| 1016 |
#| "reallocarrayf(void *p, size_t n, size_t size)\n" |
| 1017 |
#| "{\n" |
| 1018 |
#| " void *q;\n" |
| 1019 |
#| "\\&\n" |
| 1020 |
#| " q = reallocarray(p, n, size);\n" |
| 1021 |
#| " if (q == NULL && n != 0 && size != 0)\n" |
| 1022 |
#| " free(p);\n" |
| 1023 |
#| " return q;\n" |
| 1024 |
#| "}\n" |
| 1025 |
#| "\\&\n" |
| 1026 |
#| "static char *\n" |
| 1027 |
#| "getcmd(void)\n" |
| 1028 |
#| "{\n" |
| 1029 |
#| " static char buf[256];\n" |
| 1030 |
#| "\\&\n" |
| 1031 |
#| " fputs(\"E<gt> \", stdout); fflush(stdout);\n" |
| 1032 |
#| " if (fgets(buf, sizeof(buf), stdin) == NULL)\n" |
| 1033 |
#| " return NULL;\n" |
| 1034 |
#| "\\&\n" |
| 1035 |
#| " if (buf[strlen(buf) - 1] == \\[aq]\\[rs]n\\[aq])\n" |
| 1036 |
#| " buf[strlen(buf) - 1] = 0;\n" |
| 1037 |
#| "\\&\n" |
| 1038 |
#| " return buf;\n" |
| 1039 |
#| "}\n" |
| 1040 |
#| "\\&\n" |
| 1041 |
#| "/* Add requests for specified hostnames. */\n" |
| 1042 |
#| "static void\n" |
| 1043 |
#| "add_requests(void)\n" |
| 1044 |
#| "{\n" |
| 1045 |
#| " size_t nreqs_base = nreqs;\n" |
| 1046 |
#| " char *host;\n" |
| 1047 |
#| " int ret;\n" |
| 1048 |
#| "\\&\n" |
| 1049 |
#| " while ((host = strtok(NULL, \" \"))) {\n" |
| 1050 |
#| " nreqs++;\n" |
| 1051 |
#| " reqs = REALLOCF(reqs, nreqs, struct gaicb *);\n" |
| 1052 |
#| " if (reqs == NULL)\n" |
| 1053 |
#| " err(EXIT_FAILURE, \"reallocf\");\n" |
| 1054 |
#| "\\&\n" |
| 1055 |
#| " reqs[nreqs - 1] = CALLOC(1, struct gaicb);\n" |
| 1056 |
#| " if (reqs[nreqs - 1] == NULL)\n" |
| 1057 |
#| " err(EXIT_FAILURE, \"calloc\");\n" |
| 1058 |
#| "\\&\n" |
| 1059 |
#| " reqs[nreqs - 1]-E<gt>ar_name = strdup(host);\n" |
| 1060 |
#| " }\n" |
| 1061 |
#| "\\&\n" |
| 1062 |
#| " /* Queue nreqs_base..nreqs requests. */\n" |
| 1063 |
#| "\\&\n" |
| 1064 |
#| " ret = getaddrinfo_a(GAI_NOWAIT, &reqs[nreqs_base],\n" |
| 1065 |
#| " nreqs - nreqs_base, NULL);\n" |
| 1066 |
#| " if (ret) {\n" |
| 1067 |
#| " fprintf(stderr, \"getaddrinfo_a() failed: %s\\[rs]n\",\n" |
| 1068 |
#| " gai_strerror(ret));\n" |
| 1069 |
#| " exit(EXIT_FAILURE);\n" |
| 1070 |
#| " }\n" |
| 1071 |
#| "}\n" |
| 1072 |
#| "\\&\n" |
| 1073 |
#| "/* Wait until at least one of specified requests completes. */\n" |
| 1074 |
#| "static void\n" |
| 1075 |
#| "wait_requests(void)\n" |
| 1076 |
#| "{\n" |
| 1077 |
#| " char *id;\n" |
| 1078 |
#| " int ret;\n" |
| 1079 |
#| " size_t n;\n" |
| 1080 |
#| " struct gaicb const **wait_reqs;\n" |
| 1081 |
#| "\\&\n" |
| 1082 |
#| " wait_reqs = CALLOC(nreqs, const struct gaicb *);\n" |
| 1083 |
#| " if (wait_reqs == NULL)\n" |
| 1084 |
#| " err(EXIT_FAILURE, \"calloc\");\n" |
| 1085 |
#| "\\&\n" |
| 1086 |
#| " /* NULL elements are ignored by gai_suspend(). */\n" |
| 1087 |
#| "\\&\n" |
| 1088 |
#| " while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 1089 |
#| " n = atoi(id);\n" |
| 1090 |
#| "\\&\n" |
| 1091 |
#| " if (n E<gt>= nreqs) {\n" |
| 1092 |
#| " printf(\"Bad request number: %s\\[rs]n\", id);\n" |
| 1093 |
#| " return;\n" |
| 1094 |
#| " }\n" |
| 1095 |
#| "\\&\n" |
| 1096 |
#| " wait_reqs[n] = reqs[n];\n" |
| 1097 |
#| " }\n" |
| 1098 |
#| "\\&\n" |
| 1099 |
#| " ret = gai_suspend(wait_reqs, nreqs, NULL);\n" |
| 1100 |
#| " if (ret) {\n" |
| 1101 |
#| " printf(\"gai_suspend(): %s\\[rs]n\", gai_strerror(ret));\n" |
| 1102 |
#| " return;\n" |
| 1103 |
#| " }\n" |
| 1104 |
#| "\\&\n" |
| 1105 |
#| " for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 1106 |
#| " if (wait_reqs[i] == NULL)\n" |
| 1107 |
#| " continue;\n" |
| 1108 |
#| "\\&\n" |
| 1109 |
#| " ret = gai_error(reqs[i]);\n" |
| 1110 |
#| " if (ret == EAI_INPROGRESS)\n" |
| 1111 |
#| " continue;\n" |
| 1112 |
#| "\\&\n" |
| 1113 |
#| " printf(\"[%02zu] %s: %s\\[rs]n\", i, reqs[i]-E<gt>ar_name,\n" |
| 1114 |
#| " ret == 0 ? \"Finished\" : gai_strerror(ret));\n" |
| 1115 |
#| " }\n" |
| 1116 |
#| "}\n" |
| 1117 |
#| "\\&\n" |
| 1118 |
#| "/* Cancel specified requests. */\n" |
| 1119 |
#| "static void\n" |
| 1120 |
#| "cancel_requests(void)\n" |
| 1121 |
#| "{\n" |
| 1122 |
#| " char *id;\n" |
| 1123 |
#| " int ret;\n" |
| 1124 |
#| " size_t n;\n" |
| 1125 |
#| "\\&\n" |
| 1126 |
#| " while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 1127 |
#| " n = atoi(id);\n" |
| 1128 |
#| "\\&\n" |
| 1129 |
#| " if (n E<gt>= nreqs) {\n" |
| 1130 |
#| " printf(\"Bad request number: %s\\[rs]n\", id);\n" |
| 1131 |
#| " return;\n" |
| 1132 |
#| " }\n" |
| 1133 |
#| "\\&\n" |
| 1134 |
#| " ret = gai_cancel(reqs[n]);\n" |
| 1135 |
#| " printf(\"[%s] %s: %s\\[rs]n\", id, reqs[atoi(id)]-E<gt>ar_name,\n" |
| 1136 |
#| " gai_strerror(ret));\n" |
| 1137 |
#| " }\n" |
| 1138 |
#| "}\n" |
| 1139 |
#| "\\&\n" |
| 1140 |
#| "/* List all requests. */\n" |
| 1141 |
#| "static void\n" |
| 1142 |
#| "list_requests(void)\n" |
| 1143 |
#| "{\n" |
| 1144 |
#| " int ret;\n" |
| 1145 |
#| " char host[NI_MAXHOST];\n" |
| 1146 |
#| " struct addrinfo *res;\n" |
| 1147 |
#| "\\&\n" |
| 1148 |
#| " for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 1149 |
#| " printf(\"[%02zu] %s: \", i, reqs[i]-E<gt>ar_name);\n" |
| 1150 |
#| " ret = gai_error(reqs[i]);\n" |
| 1151 |
#| "\\&\n" |
| 1152 |
#| " if (!ret) {\n" |
| 1153 |
#| " res = reqs[i]-E<gt>ar_result;\n" |
| 1154 |
#| "\\&\n" |
| 1155 |
#| " ret = getnameinfo(res-E<gt>ai_addr, res-E<gt>ai_addrlen,\n" |
| 1156 |
#| " host, sizeof(host),\n" |
| 1157 |
#| " NULL, 0, NI_NUMERICHOST);\n" |
| 1158 |
#| " if (ret) {\n" |
| 1159 |
#| " fprintf(stderr, \"getnameinfo() failed: %s\\[rs]n\",\n" |
| 1160 |
#| " gai_strerror(ret));\n" |
| 1161 |
#| " exit(EXIT_FAILURE);\n" |
| 1162 |
#| " }\n" |
| 1163 |
#| " puts(host);\n" |
| 1164 |
#| " } else {\n" |
| 1165 |
#| " puts(gai_strerror(ret));\n" |
| 1166 |
#| " }\n" |
| 1167 |
#| " }\n" |
| 1168 |
#| "}\n" |
| 1169 |
#| "\\&\n" |
| 1170 |
#| "int\n" |
| 1171 |
#| "main(void)\n" |
| 1172 |
#| "{\n" |
| 1173 |
#| " char *cmdline;\n" |
| 1174 |
#| " char *cmd;\n" |
| 1175 |
#| "\\&\n" |
| 1176 |
#| " while ((cmdline = getcmd()) != NULL) {\n" |
| 1177 |
#| " cmd = strtok(cmdline, \" \");\n" |
| 1178 |
#| "\\&\n" |
| 1179 |
#| " if (cmd == NULL) {\n" |
| 1180 |
#| " list_requests();\n" |
| 1181 |
#| " } else {\n" |
| 1182 |
#| " switch (cmd[0]) {\n" |
| 1183 |
#| " case \\[aq]a\\[aq]:\n" |
| 1184 |
#| " add_requests();\n" |
| 1185 |
#| " break;\n" |
| 1186 |
#| " case \\[aq]w\\[aq]:\n" |
| 1187 |
#| " wait_requests();\n" |
| 1188 |
#| " break;\n" |
| 1189 |
#| " case \\[aq]c\\[aq]:\n" |
| 1190 |
#| " cancel_requests();\n" |
| 1191 |
#| " break;\n" |
| 1192 |
#| " case \\[aq]l\\[aq]:\n" |
| 1193 |
#| " list_requests();\n" |
| 1194 |
#| " break;\n" |
| 1195 |
#| " default:\n" |
| 1196 |
#| " fprintf(stderr, \"Bad command: %c\\[rs]n\", cmd[0]);\n" |
| 1197 |
#| " break;\n" |
| 1198 |
#| " }\n" |
| 1199 |
#| " }\n" |
| 1200 |
#| " }\n" |
| 1201 |
#| " exit(EXIT_SUCCESS);\n" |
| 1202 |
#| "}\n" |
| 1203 |
msgid "" |
| 1204 |
"#define _GNU_SOURCE\n" |
| 1205 |
"#include E<lt>assert.hE<gt>\n" |
| 1206 |
"#include E<lt>err.hE<gt>\n" |
| 1207 |
"#include E<lt>netdb.hE<gt>\n" |
| 1208 |
"#include E<lt>stdio.hE<gt>\n" |
| 1209 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1210 |
"#include E<lt>string.hE<gt>\n" |
| 1211 |
"\\&\n" |
| 1212 |
"#define CALLOC(n, type) ((type *) calloc(n, sizeof(type)))\n" |
| 1213 |
"\\&\n" |
| 1214 |
"#define REALLOCF(ptr, n, type) \\[rs]\n" |
| 1215 |
"({ \\[rs]\n" |
| 1216 |
" static_assert(__builtin_types_compatible_p(typeof(ptr), type *)); \\[rs]\n" |
| 1217 |
" \\[rs]\n" |
| 1218 |
" (type *) reallocarrayf(ptr, n, sizeof(type)); \\[rs]\n" |
| 1219 |
"})\n" |
| 1220 |
"\\&\n" |
| 1221 |
"static struct gaicb **reqs = NULL;\n" |
| 1222 |
"static size_t nreqs = 0;\n" |
| 1223 |
"\\&\n" |
| 1224 |
"static inline void *\n" |
| 1225 |
"reallocarrayf(void *p, size_t n, size_t size)\n" |
| 1226 |
"{\n" |
| 1227 |
" void *q;\n" |
| 1228 |
"\\&\n" |
| 1229 |
" q = reallocarray(p, n, size);\n" |
| 1230 |
" if (q == NULL && n != 0 && size != 0)\n" |
| 1231 |
" free(p);\n" |
| 1232 |
" return q;\n" |
| 1233 |
"}\n" |
| 1234 |
"\\&\n" |
| 1235 |
"static char *\n" |
| 1236 |
"getcmd(void)\n" |
| 1237 |
"{\n" |
| 1238 |
" static char buf[256];\n" |
| 1239 |
"\\&\n" |
| 1240 |
" fputs(\"E<gt> \", stdout);\n" |
| 1241 |
" fflush(stdout);\n" |
| 1242 |
" if (fgets(buf, sizeof(buf), stdin) == NULL)\n" |
| 1243 |
" return NULL;\n" |
| 1244 |
"\\&\n" |
| 1245 |
" if (buf[strlen(buf) - 1] == \\[aq]\\[rs]n\\[aq])\n" |
| 1246 |
" buf[strlen(buf) - 1] = 0;\n" |
| 1247 |
"\\&\n" |
| 1248 |
" return buf;\n" |
| 1249 |
"}\n" |
| 1250 |
"\\&\n" |
| 1251 |
"/* Add requests for specified hostnames. */\n" |
| 1252 |
"static void\n" |
| 1253 |
"add_requests(void)\n" |
| 1254 |
"{\n" |
| 1255 |
" size_t nreqs_base = nreqs;\n" |
| 1256 |
" char *host;\n" |
| 1257 |
" int ret;\n" |
| 1258 |
"\\&\n" |
| 1259 |
" while ((host = strtok(NULL, \" \"))) {\n" |
| 1260 |
" nreqs++;\n" |
| 1261 |
" reqs = REALLOCF(reqs, nreqs, struct gaicb *);\n" |
| 1262 |
" if (reqs == NULL)\n" |
| 1263 |
" err(EXIT_FAILURE, \"reallocf\");\n" |
| 1264 |
"\\&\n" |
| 1265 |
" reqs[nreqs - 1] = CALLOC(1, struct gaicb);\n" |
| 1266 |
" if (reqs[nreqs - 1] == NULL)\n" |
| 1267 |
" err(EXIT_FAILURE, \"calloc\");\n" |
| 1268 |
"\\&\n" |
| 1269 |
" reqs[nreqs - 1]-E<gt>ar_name = strdup(host);\n" |
| 1270 |
" }\n" |
| 1271 |
"\\&\n" |
| 1272 |
" /* Queue nreqs_base..nreqs requests. */\n" |
| 1273 |
"\\&\n" |
| 1274 |
" ret = getaddrinfo_a(GAI_NOWAIT, &reqs[nreqs_base],\n" |
| 1275 |
" nreqs - nreqs_base, NULL);\n" |
| 1276 |
" if (ret) {\n" |
| 1277 |
" fprintf(stderr, \"getaddrinfo_a() failed: %s\\[rs]n\",\n" |
| 1278 |
" gai_strerror(ret));\n" |
| 1279 |
" exit(EXIT_FAILURE);\n" |
| 1280 |
" }\n" |
| 1281 |
"}\n" |
| 1282 |
"\\&\n" |
| 1283 |
"/* Wait until at least one of specified requests completes. */\n" |
| 1284 |
"static void\n" |
| 1285 |
"wait_requests(void)\n" |
| 1286 |
"{\n" |
| 1287 |
" char *id;\n" |
| 1288 |
" int ret;\n" |
| 1289 |
" size_t n;\n" |
| 1290 |
" struct gaicb const **wait_reqs;\n" |
| 1291 |
"\\&\n" |
| 1292 |
" wait_reqs = CALLOC(nreqs, const struct gaicb *);\n" |
| 1293 |
" if (wait_reqs == NULL)\n" |
| 1294 |
" err(EXIT_FAILURE, \"calloc\");\n" |
| 1295 |
"\\&\n" |
| 1296 |
" /* NULL elements are ignored by gai_suspend(). */\n" |
| 1297 |
"\\&\n" |
| 1298 |
" while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 1299 |
" n = atoi(id);\n" |
| 1300 |
"\\&\n" |
| 1301 |
" if (n E<gt>= nreqs) {\n" |
| 1302 |
" printf(\"Bad request number: %s\\[rs]n\", id);\n" |
| 1303 |
" return;\n" |
| 1304 |
" }\n" |
| 1305 |
"\\&\n" |
| 1306 |
" wait_reqs[n] = reqs[n];\n" |
| 1307 |
" }\n" |
| 1308 |
"\\&\n" |
| 1309 |
" ret = gai_suspend(wait_reqs, nreqs, NULL);\n" |
| 1310 |
" if (ret) {\n" |
| 1311 |
" printf(\"gai_suspend(): %s\\[rs]n\", gai_strerror(ret));\n" |
| 1312 |
" return;\n" |
| 1313 |
" }\n" |
| 1314 |
"\\&\n" |
| 1315 |
" for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 1316 |
" if (wait_reqs[i] == NULL)\n" |
| 1317 |
" continue;\n" |
| 1318 |
"\\&\n" |
| 1319 |
" ret = gai_error(reqs[i]);\n" |
| 1320 |
" if (ret == EAI_INPROGRESS)\n" |
| 1321 |
" continue;\n" |
| 1322 |
"\\&\n" |
| 1323 |
" printf(\"[%02zu] %s: %s\\[rs]n\", i, reqs[i]-E<gt>ar_name,\n" |
| 1324 |
" ret == 0 ? \"Finished\" : gai_strerror(ret));\n" |
| 1325 |
" }\n" |
| 1326 |
"}\n" |
| 1327 |
"\\&\n" |
| 1328 |
"/* Cancel specified requests. */\n" |
| 1329 |
"static void\n" |
| 1330 |
"cancel_requests(void)\n" |
| 1331 |
"{\n" |
| 1332 |
" char *id;\n" |
| 1333 |
" int ret;\n" |
| 1334 |
" size_t n;\n" |
| 1335 |
"\\&\n" |
| 1336 |
" while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 1337 |
" n = atoi(id);\n" |
| 1338 |
"\\&\n" |
| 1339 |
" if (n E<gt>= nreqs) {\n" |
| 1340 |
" printf(\"Bad request number: %s\\[rs]n\", id);\n" |
| 1341 |
" return;\n" |
| 1342 |
" }\n" |
| 1343 |
"\\&\n" |
| 1344 |
" ret = gai_cancel(reqs[n]);\n" |
| 1345 |
" printf(\"[%s] %s: %s\\[rs]n\", id, reqs[atoi(id)]-E<gt>ar_name,\n" |
| 1346 |
" gai_strerror(ret));\n" |
| 1347 |
" }\n" |
| 1348 |
"}\n" |
| 1349 |
"\\&\n" |
| 1350 |
"/* List all requests. */\n" |
| 1351 |
"static void\n" |
| 1352 |
"list_requests(void)\n" |
| 1353 |
"{\n" |
| 1354 |
" int ret;\n" |
| 1355 |
" char host[NI_MAXHOST];\n" |
| 1356 |
" struct addrinfo *res;\n" |
| 1357 |
"\\&\n" |
| 1358 |
" for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 1359 |
" printf(\"[%02zu] %s: \", i, reqs[i]-E<gt>ar_name);\n" |
| 1360 |
" ret = gai_error(reqs[i]);\n" |
| 1361 |
"\\&\n" |
| 1362 |
" if (!ret) {\n" |
| 1363 |
" res = reqs[i]-E<gt>ar_result;\n" |
| 1364 |
"\\&\n" |
| 1365 |
" ret = getnameinfo(res-E<gt>ai_addr, res-E<gt>ai_addrlen,\n" |
| 1366 |
" host, sizeof(host),\n" |
| 1367 |
" NULL, 0, NI_NUMERICHOST);\n" |
| 1368 |
" if (ret) {\n" |
| 1369 |
" fprintf(stderr, \"getnameinfo() failed: %s\\[rs]n\",\n" |
| 1370 |
" gai_strerror(ret));\n" |
| 1371 |
" exit(EXIT_FAILURE);\n" |
| 1372 |
" }\n" |
| 1373 |
" puts(host);\n" |
| 1374 |
" } else {\n" |
| 1375 |
" puts(gai_strerror(ret));\n" |
| 1376 |
" }\n" |
| 1377 |
" }\n" |
| 1378 |
"}\n" |
| 1379 |
"\\&\n" |
| 1380 |
"int\n" |
| 1381 |
"main(void)\n" |
| 1382 |
"{\n" |
| 1383 |
" char *cmdline;\n" |
| 1384 |
" char *cmd;\n" |
| 1385 |
"\\&\n" |
| 1386 |
" while ((cmdline = getcmd()) != NULL) {\n" |
| 1387 |
" cmd = strtok(cmdline, \" \");\n" |
| 1388 |
"\\&\n" |
| 1389 |
" if (cmd == NULL) {\n" |
| 1390 |
" list_requests();\n" |
| 1391 |
" } else {\n" |
| 1392 |
" switch (cmd[0]) {\n" |
| 1393 |
" case \\[aq]a\\[aq]:\n" |
| 1394 |
" add_requests();\n" |
| 1395 |
" break;\n" |
| 1396 |
" case \\[aq]w\\[aq]:\n" |
| 1397 |
" wait_requests();\n" |
| 1398 |
" break;\n" |
| 1399 |
" case \\[aq]c\\[aq]:\n" |
| 1400 |
" cancel_requests();\n" |
| 1401 |
" break;\n" |
| 1402 |
" case \\[aq]l\\[aq]:\n" |
| 1403 |
" list_requests();\n" |
| 1404 |
" break;\n" |
| 1405 |
" default:\n" |
| 1406 |
" fprintf(stderr, \"Bad command: %c\\[rs]n\", cmd[0]);\n" |
| 1407 |
" break;\n" |
| 1408 |
" }\n" |
| 1409 |
" }\n" |
| 1410 |
" }\n" |
| 1411 |
" exit(EXIT_SUCCESS);\n" |
| 1412 |
"}\n" |
| 1413 |
msgstr "" |
| 1414 |
"#define _GNU_SOURCE\n" |
| 1415 |
"#include E<lt>assert.hE<gt>\n" |
| 1416 |
"#include E<lt>err.hE<gt>\n" |
| 1417 |
"#include E<lt>netdb.hE<gt>\n" |
| 1418 |
"#include E<lt>stdio.hE<gt>\n" |
| 1419 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1420 |
"#include E<lt>string.hE<gt>\n" |
| 1421 |
"\\&\n" |
| 1422 |
"#define CALLOC(n, type) ((type *) calloc(n, sizeof(type)))\n" |
| 1423 |
"\\&\n" |
| 1424 |
"#define REALLOCF(ptr, n, type) \\[rs]\n" |
| 1425 |
"({ \\[rs]\n" |
| 1426 |
" static_assert(__builtin_types_compatible_p(typeof(ptr), type *)); \\[rs]\n" |
| 1427 |
" \\[rs]\n" |
| 1428 |
" (type *) reallocarrayf(ptr, n, sizeof(type)); \\[rs]\n" |
| 1429 |
"})\n" |
| 1430 |
"\\&\n" |
| 1431 |
"static struct gaicb **reqs = NULL;\n" |
| 1432 |
"static size_t nreqs = 0;\n" |
| 1433 |
"\\&\n" |
| 1434 |
"static inline void *\n" |
| 1435 |
"reallocarrayf(void *p, size_t n, size_t size)\n" |
| 1436 |
"{\n" |
| 1437 |
" void *q;\n" |
| 1438 |
"\\&\n" |
| 1439 |
" q = reallocarray(p, n, size);\n" |
| 1440 |
" if (q == NULL && n != 0 && size != 0)\n" |
| 1441 |
" free(p);\n" |
| 1442 |
" return q;\n" |
| 1443 |
"}\n" |
| 1444 |
"\\&\n" |
| 1445 |
"static char *\n" |
| 1446 |
"getcmd(void)\n" |
| 1447 |
"{\n" |
| 1448 |
" static char buf[256];\n" |
| 1449 |
"\\&\n" |
| 1450 |
" fputs(\"E<gt> \", stdout); fflush(stdout);\n" |
| 1451 |
" if (fgets(buf, sizeof(buf), stdin) == NULL)\n" |
| 1452 |
" return NULL;\n" |
| 1453 |
"\\&\n" |
| 1454 |
" if (buf[strlen(buf) - 1] == \\[aq]\\[rs]n\\[aq])\n" |
| 1455 |
" buf[strlen(buf) - 1] = 0;\n" |
| 1456 |
"\\&\n" |
| 1457 |
" return buf;\n" |
| 1458 |
"}\n" |
| 1459 |
"\\&\n" |
| 1460 |
"/* Ajout des requêtes pour les noms d'hôte spécifiés. */\n" |
| 1461 |
"static void\n" |
| 1462 |
"add_requests(void)\n" |
| 1463 |
"{\n" |
| 1464 |
" size_t nreqs_base = nreqs;\n" |
| 1465 |
" char *host;\n" |
| 1466 |
" int ret;\n" |
| 1467 |
"\\&\n" |
| 1468 |
" while ((host = strtok(NULL, \" \"))) {\n" |
| 1469 |
" nreqs++;\n" |
| 1470 |
" reqs = REALLOCF(reqs, nreqs, struct gaicb *);\n" |
| 1471 |
" if (reqs == NULL)\n" |
| 1472 |
" err(EXIT_FAILURE, \"reallocf\");\n" |
| 1473 |
"\\&\n" |
| 1474 |
" reqs[nreqs - 1] = CALLOC(1, struct gaicb);\n" |
| 1475 |
" if (reqs[nreqs - 1] == NULL)\n" |
| 1476 |
" err(EXIT_FAILURE, \"calloc\");\n" |
| 1477 |
"\\&\n" |
| 1478 |
" reqs[nreqs - 1]-E<gt>ar_name = strdup(host);\n" |
| 1479 |
" }\n" |
| 1480 |
"\\&\n" |
| 1481 |
" /* Mettre en file d'attente les requêtes nreqs_base..nreqs. */\n" |
| 1482 |
"\\&\n" |
| 1483 |
" ret = getaddrinfo_a(GAI_NOWAIT, &reqs[nreqs_base],\n" |
| 1484 |
" nreqs - nreqs_base, NULL);\n" |
| 1485 |
" if (ret) {\n" |
| 1486 |
" fprintf(stderr, \"getaddrinfo_a() a échoué : %s\\[rs]n\",\n" |
| 1487 |
" gai_strerror(ret));\n" |
| 1488 |
" exit(EXIT_FAILURE);\n" |
| 1489 |
" }\n" |
| 1490 |
"}\n" |
| 1491 |
"\\&\n" |
| 1492 |
"/* Attendre qu'au moins une des requêtes spécifiées soit achevée. */\n" |
| 1493 |
"static void\n" |
| 1494 |
"wait_requests(void)\n" |
| 1495 |
"{\n" |
| 1496 |
" char *id;\n" |
| 1497 |
" int ret;\n" |
| 1498 |
" size_t n;\n" |
| 1499 |
" struct gaicb const **wait_reqs;\n" |
| 1500 |
"\\&\n" |
| 1501 |
" wait_reqs = CALLOC(nreqs, const struct gaicb *);\n" |
| 1502 |
" if (wait_reqs == NULL)\n" |
| 1503 |
" err(EXIT_FAILURE, \"calloc\");\n" |
| 1504 |
"\\&\n" |
| 1505 |
" /* Les éléments NULL sont ignorés par gai_suspend(). */\n" |
| 1506 |
"\\&\n" |
| 1507 |
" while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 1508 |
" n = atoi(id);\n" |
| 1509 |
"\\&\n" |
| 1510 |
" if (n E<gt>= nreqs) {\n" |
| 1511 |
" printf(\"Mauvais nombre de requêtes : %s\\[rs]n\", id);\n" |
| 1512 |
" return;\n" |
| 1513 |
" }\n" |
| 1514 |
"\\&\n" |
| 1515 |
" wait_reqs[n] = reqs[n];\n" |
| 1516 |
" }\n" |
| 1517 |
"\\&\n" |
| 1518 |
" ret = gai_suspend(wait_reqs, nreqs, NULL);\n" |
| 1519 |
" if (ret) {\n" |
| 1520 |
" printf(\"gai_suspend(): %s\\[rs]n\", gai_strerror(ret));\n" |
| 1521 |
" return;\n" |
| 1522 |
" }\n" |
| 1523 |
"\\&\n" |
| 1524 |
" for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 1525 |
" if (wait_reqs[i] == NULL)\n" |
| 1526 |
" continue;\n" |
| 1527 |
"\\&\n" |
| 1528 |
" ret = gai_error(reqs[i]);\n" |
| 1529 |
" if (ret == EAI_INPROGRESS)\n" |
| 1530 |
" continue;\n" |
| 1531 |
"\\&\n" |
| 1532 |
" printf(\"[%02zu] %s: %s\\[rs]n\", i, reqs[i]-E<gt>ar_name,\n" |
| 1533 |
" ret == 0 ? \"Terminé\" : gai_strerror(ret));\n" |
| 1534 |
" }\n" |
| 1535 |
"}\n" |
| 1536 |
"\\&\n" |
| 1537 |
"/* Annuler les requêtes spécifiées. */\n" |
| 1538 |
"static void\n" |
| 1539 |
"cancel_requests(void)\n" |
| 1540 |
"{\n" |
| 1541 |
" char *id;\n" |
| 1542 |
" int ret;\n" |
| 1543 |
" size_t n;\n" |
| 1544 |
"\\&\n" |
| 1545 |
" while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 1546 |
" n = atoi(id);\n" |
| 1547 |
"\\&\n" |
| 1548 |
" if (n E<gt>= nreqs) {\n" |
| 1549 |
" printf(\"Mauvais nombre de requêtes : %s\\[rs]n\", id);\n" |
| 1550 |
" return;\n" |
| 1551 |
" }\n" |
| 1552 |
"\\&\n" |
| 1553 |
" ret = gai_cancel(reqs[n]);\n" |
| 1554 |
" printf(\"[%s] %s: %s\\[rs]n\", id, reqs[atoi(id)]-E<gt>ar_name,\n" |
| 1555 |
" gai_strerror(ret));\n" |
| 1556 |
" }\n" |
| 1557 |
"}\n" |
| 1558 |
"\\&\n" |
| 1559 |
"/* Lister toutes les requêtes. */\n" |
| 1560 |
"static void\n" |
| 1561 |
"list_requests(void)\n" |
| 1562 |
"{\n" |
| 1563 |
" int ret;\n" |
| 1564 |
" char host[NI_MAXHOST];\n" |
| 1565 |
" struct addrinfo *res;\n" |
| 1566 |
"\\&\n" |
| 1567 |
" for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 1568 |
" printf(\"[%02zu] %s: \", i, reqs[i]-E<gt>ar_name);\n" |
| 1569 |
" ret = gai_error(reqs[i]);\n" |
| 1570 |
"\\&\n" |
| 1571 |
" if (!ret) {\n" |
| 1572 |
" res = reqs[i]-E<gt>ar_result;\n" |
| 1573 |
"\\&\n" |
| 1574 |
" ret = getnameinfo(res-E<gt>ai_addr, res-E<gt>ai_addrlen,\n" |
| 1575 |
" host, sizeof(host),\n" |
| 1576 |
" NULL, 0, NI_NUMERICHOST);\n" |
| 1577 |
" if (ret) {\n" |
| 1578 |
" fprintf(stderr, \"getnameinfo() a échoué : %s\\[rs]n\",\n" |
| 1579 |
" gai_strerror(ret));\n" |
| 1580 |
" exit(EXIT_FAILURE);\n" |
| 1581 |
" }\n" |
| 1582 |
" puts(host);\n" |
| 1583 |
" } else {\n" |
| 1584 |
" puts(gai_strerror(ret));\n" |
| 1585 |
" }\n" |
| 1586 |
" }\n" |
| 1587 |
"}\n" |
| 1588 |
"\\&\n" |
| 1589 |
"int\n" |
| 1590 |
"main(void)\n" |
| 1591 |
"{\n" |
| 1592 |
" char *cmdline;\n" |
| 1593 |
" char *cmd;\n" |
| 1594 |
"\\&\n" |
| 1595 |
" while ((cmdline = getcmd()) != NULL) {\n" |
| 1596 |
" cmd = strtok(cmdline, \" \");\n" |
| 1597 |
"\\&\n" |
| 1598 |
" if (cmd == NULL) {\n" |
| 1599 |
" list_requests();\n" |
| 1600 |
" } else {\n" |
| 1601 |
" switch (cmd[0]) {\n" |
| 1602 |
" case \\[aq]a\\[aq]:\n" |
| 1603 |
" add_requests();\n" |
| 1604 |
" break;\n" |
| 1605 |
" case \\[aq]w\\[aq]:\n" |
| 1606 |
" wait_requests();\n" |
| 1607 |
" break;\n" |
| 1608 |
" case \\[aq]c\\[aq]:\n" |
| 1609 |
" cancel_requests();\n" |
| 1610 |
" break;\n" |
| 1611 |
" case \\[aq]l\\[aq]:\n" |
| 1612 |
" list_requests();\n" |
| 1613 |
" break;\n" |
| 1614 |
" default:\n" |
| 1615 |
" fprintf(stderr, \"Mauvaise commande : %c\\[rs]n\", cmd[0]);\n" |
| 1616 |
" break;\n" |
| 1617 |
" }\n" |
| 1618 |
" }\n" |
| 1619 |
" }\n" |
| 1620 |
" exit(EXIT_SUCCESS);\n" |
| 1621 |
"}\n" |
| 1622 |
|
| 1623 |
#. SRC END |
| 1624 |
#. type: SH |
| 1625 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1626 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1627 |
#, no-wrap |
| 1628 |
msgid "SEE ALSO" |
| 1629 |
msgstr "VOIR AUSSI" |
| 1630 |
|
| 1631 |
#. type: Plain text |
| 1632 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1633 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1634 |
msgid "" |
| 1635 |
"B<getaddrinfo>(3), B<inet>(3), B<lio_listio>(3), B<hostname>(7), B<ip>(7), " |
| 1636 |
"B<sigevent>(3type)" |
| 1637 |
msgstr "" |
| 1638 |
"B<getaddrinfo>(3), B<inet>(3), B<lio_listio>(3), B<hostname>(7), B<ip>(7), " |
| 1639 |
"B<sigevent>(3type)" |
| 1640 |
|
| 1641 |
#. type: TH |
| 1642 |
#: debian-trixie |
| 1643 |
#, no-wrap |
| 1644 |
msgid "2024-06-15" |
| 1645 |
msgstr "15 juin 2024" |
| 1646 |
|
| 1647 |
#. type: TH |
| 1648 |
#: debian-trixie |
| 1649 |
#, no-wrap |
| 1650 |
msgid "Linux man-pages 6.9.1" |
| 1651 |
msgstr "Pages du manuel de Linux 6.9.1" |
| 1652 |
|
| 1653 |
#. type: Plain text |
| 1654 |
#: debian-trixie |
| 1655 |
msgid "Asynchronous name lookup library (I<libanl>, I<-lanl>)" |
| 1656 |
msgstr "Bibliothèque de résolution de noms asynchrone (I<libanl>, I<-lanl>)" |
| 1657 |
|
| 1658 |
#. type: Plain text |
| 1659 |
#: debian-trixie |
| 1660 |
#, no-wrap |
| 1661 |
msgid "" |
| 1662 |
"B<int getaddrinfo_a(int >I<mode>B<, struct gaicb *>I<list>B<[restrict],>\n" |
| 1663 |
"B< int >I<nitems>B<, struct sigevent *restrict >I<sevp>B<);>\n" |
| 1664 |
"B<int gai_suspend(const struct gaicb *const >I<list>B<[], int >I<nitems>B<,>\n" |
| 1665 |
"B< const struct timespec *>I<timeout>B<);>\n" |
| 1666 |
msgstr "" |
| 1667 |
"B<int getaddrinfo_a(int >I<mode>B<, struct gaicb *>I<list>B<[restrict],>\n" |
| 1668 |
"B< int >I<nitems>B<, struct sigevent *restrict >I<sevp>B<);>\n" |
| 1669 |
"B<int gai_suspend(const struct gaicb *const >I<list>B<[], int >I<nitems>B<,>\n" |
| 1670 |
"B< const struct timespec *>I<timeout>B<);>\n" |
| 1671 |
|
| 1672 |
#. type: Plain text |
| 1673 |
#: debian-trixie |
| 1674 |
msgid "" |
| 1675 |
"The array I<list> specifies the look-up requests to process. The I<nitems> " |
| 1676 |
"argument specifies the number of elements in I<list>. The requested look-up " |
| 1677 |
"operations are started in parallel. NULL elements in I<list> are ignored. " |
| 1678 |
"Each request is described by a I<gaicb> structure, defined as follows:" |
| 1679 |
msgstr "" |
| 1680 |
"Le tableau I<list> indique les requêtes de recherche à traiter. Le paramètre " |
| 1681 |
"I<nitems> indique le nombre d'éléments dans I<list>. Les opérations de " |
| 1682 |
"recherche demandées sont lancées en parallèle. Les éléments égal à NULL de " |
| 1683 |
"I<list> sont ignorés. Chaque requête est décrite par une structure I<gaicb> " |
| 1684 |
"définie ci-dessous\\ :" |
| 1685 |
|
| 1686 |
#. type: Plain text |
| 1687 |
#: debian-trixie |
| 1688 |
msgid "" |
| 1689 |
"The B<gai_suspend>() function suspends execution of the calling thread, " |
| 1690 |
"waiting for the completion of one or more requests in the array I<list>. " |
| 1691 |
"The I<nitems> argument specifies the size of the array I<list>. The call " |
| 1692 |
"blocks until one of the following occurs:" |
| 1693 |
msgstr "" |
| 1694 |
"La fonction B<gai_suspend>() suspend l'exécution du processus léger " |
| 1695 |
"appelant, attendant la fin d'une ou plusieurs requêtes du tableau I<list>. " |
| 1696 |
"L'argument I<nitems> indique la taille du tableau I<list>. L'appel est " |
| 1697 |
"bloquant tant que l'un des événements suivants ne se produisent :" |
| 1698 |
|
| 1699 |
#. type: Plain text |
| 1700 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1701 |
#, no-wrap |
| 1702 |
msgid "" |
| 1703 |
"$ B<./a.out mirrors.kernel.org enoent.linuxfoundation.org gnu.org>\n" |
| 1704 |
"mirrors.kernel.org: 139.178.88.99\n" |
| 1705 |
"enoent.linuxfoundation.org: Name or service not known\n" |
| 1706 |
"gnu.org: 209.51.188.116\n" |
| 1707 |
msgstr "" |
| 1708 |
"$ B<./a.out mirrors.kernel.org enoent.linuxfoundation.org gnu.org>\n" |
| 1709 |
"mirrors.kernel.org: 139.178.88.99\n" |
| 1710 |
"enoent.linuxfoundation.org: Name or service not known\n" |
| 1711 |
"gnu.org: 209.51.188.116\n" |
| 1712 |
|
| 1713 |
#. type: Plain text |
| 1714 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1715 |
#, no-wrap |
| 1716 |
msgid "" |
| 1717 |
"$ B<./a.out>\n" |
| 1718 |
"E<gt> a mirrors.kernel.org enoent.linuxfoundation.org gnu.org\n" |
| 1719 |
"E<gt> c 2\n" |
| 1720 |
"[2] gnu.org: Request not canceled\n" |
| 1721 |
"E<gt> w 0 1\n" |
| 1722 |
"[00] mirrors.kernel.org: Finished\n" |
| 1723 |
"E<gt> l\n" |
| 1724 |
"[00] mirrors.kernel.org: 139.178.88.99\n" |
| 1725 |
"[01] enoent.linuxfoundation.org: Processing request in progress\n" |
| 1726 |
"[02] gnu.org: 209.51.188.116\n" |
| 1727 |
"E<gt> l\n" |
| 1728 |
"[00] mirrors.kernel.org: 139.178.88.99\n" |
| 1729 |
"[01] enoent.linuxfoundation.org: Name or service not known\n" |
| 1730 |
"[02] gnu.org: 209.51.188.116\n" |
| 1731 |
msgstr "" |
| 1732 |
"$ B<./a.out>\n" |
| 1733 |
"E<gt> a mirrors.kernel.org enoent.linuxfoundation.org gnu.org\n" |
| 1734 |
"E<gt> c 2\n" |
| 1735 |
"[2] gnu.org: Request not canceled\n" |
| 1736 |
"E<gt> w 0 1\n" |
| 1737 |
"[00] mirrors.kernel.org: Finished\n" |
| 1738 |
"E<gt> l\n" |
| 1739 |
"[00] mirrors.kernel.org: 139.178.88.99\n" |
| 1740 |
"[01] enoent.linuxfoundation.org: Processing request in progress\n" |
| 1741 |
"[02] gnu.org: 209.51.188.116\n" |
| 1742 |
"E<gt> l\n" |
| 1743 |
"[00] mirrors.kernel.org: 139.178.88.99\n" |
| 1744 |
"[01] enoent.linuxfoundation.org: Name or service not known\n" |
| 1745 |
"[02] gnu.org: 209.51.188.116\n" |
| 1746 |
|
| 1747 |
#. type: Plain text |
| 1748 |
#: debian-trixie |
| 1749 |
#, no-wrap |
| 1750 |
msgid "" |
| 1751 |
"#define _GNU_SOURCE\n" |
| 1752 |
"#include E<lt>assert.hE<gt>\n" |
| 1753 |
"#include E<lt>err.hE<gt>\n" |
| 1754 |
"#include E<lt>netdb.hE<gt>\n" |
| 1755 |
"#include E<lt>stdio.hE<gt>\n" |
| 1756 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1757 |
"#include E<lt>string.hE<gt>\n" |
| 1758 |
"\\&\n" |
| 1759 |
"#define CALLOC(n, type) ((type *) calloc(n, sizeof(type)))\n" |
| 1760 |
"\\&\n" |
| 1761 |
"#define REALLOCF(ptr, n, type) \\[rs]\n" |
| 1762 |
"({ \\[rs]\n" |
| 1763 |
" static_assert(__builtin_types_compatible_p(typeof(ptr), type *)); \\[rs]\n" |
| 1764 |
" \\[rs]\n" |
| 1765 |
" (type *) reallocarrayf(ptr, n, sizeof(type)); \\[rs]\n" |
| 1766 |
"})\n" |
| 1767 |
"\\&\n" |
| 1768 |
"static struct gaicb **reqs = NULL;\n" |
| 1769 |
"static size_t nreqs = 0;\n" |
| 1770 |
"\\&\n" |
| 1771 |
"static inline void *\n" |
| 1772 |
"reallocarrayf(void *p, size_t nmemb, size_t size)\n" |
| 1773 |
"{\n" |
| 1774 |
" void *q;\n" |
| 1775 |
"\\&\n" |
| 1776 |
" q = reallocarray(p, nmemb, size);\n" |
| 1777 |
" if (q == NULL && nmemb != 0 && size != 0)\n" |
| 1778 |
" free(p);\n" |
| 1779 |
" return q;\n" |
| 1780 |
"}\n" |
| 1781 |
"\\&\n" |
| 1782 |
"static char *\n" |
| 1783 |
"getcmd(void)\n" |
| 1784 |
"{\n" |
| 1785 |
" static char buf[256];\n" |
| 1786 |
"\\&\n" |
| 1787 |
" fputs(\"E<gt> \", stdout); fflush(stdout);\n" |
| 1788 |
" if (fgets(buf, sizeof(buf), stdin) == NULL)\n" |
| 1789 |
" return NULL;\n" |
| 1790 |
"\\&\n" |
| 1791 |
" if (buf[strlen(buf) - 1] == \\[aq]\\[rs]n\\[aq])\n" |
| 1792 |
" buf[strlen(buf) - 1] = 0;\n" |
| 1793 |
"\\&\n" |
| 1794 |
" return buf;\n" |
| 1795 |
"}\n" |
| 1796 |
"\\&\n" |
| 1797 |
"/* Add requests for specified hostnames. */\n" |
| 1798 |
"static void\n" |
| 1799 |
"add_requests(void)\n" |
| 1800 |
"{\n" |
| 1801 |
" size_t nreqs_base = nreqs;\n" |
| 1802 |
" char *host;\n" |
| 1803 |
" int ret;\n" |
| 1804 |
"\\&\n" |
| 1805 |
" while ((host = strtok(NULL, \" \"))) {\n" |
| 1806 |
" nreqs++;\n" |
| 1807 |
" reqs = REALLOCF(reqs, nreqs, struct gaicb *);\n" |
| 1808 |
" if (reqs == NULL)\n" |
| 1809 |
" err(EXIT_FAILURE, \"reallocf\");\n" |
| 1810 |
"\\&\n" |
| 1811 |
" reqs[nreqs - 1] = CALLOC(1, struct gaicb);\n" |
| 1812 |
" if (reqs[nreqs - 1] == NULL)\n" |
| 1813 |
" err(EXIT_FAILURE, \"calloc\");\n" |
| 1814 |
"\\&\n" |
| 1815 |
" reqs[nreqs - 1]-E<gt>ar_name = strdup(host);\n" |
| 1816 |
" }\n" |
| 1817 |
"\\&\n" |
| 1818 |
" /* Queue nreqs_base..nreqs requests. */\n" |
| 1819 |
"\\&\n" |
| 1820 |
" ret = getaddrinfo_a(GAI_NOWAIT, &reqs[nreqs_base],\n" |
| 1821 |
" nreqs - nreqs_base, NULL);\n" |
| 1822 |
" if (ret) {\n" |
| 1823 |
" fprintf(stderr, \"getaddrinfo_a() failed: %s\\[rs]n\",\n" |
| 1824 |
" gai_strerror(ret));\n" |
| 1825 |
" exit(EXIT_FAILURE);\n" |
| 1826 |
" }\n" |
| 1827 |
"}\n" |
| 1828 |
"\\&\n" |
| 1829 |
"/* Wait until at least one of specified requests completes. */\n" |
| 1830 |
"static void\n" |
| 1831 |
"wait_requests(void)\n" |
| 1832 |
"{\n" |
| 1833 |
" char *id;\n" |
| 1834 |
" int ret;\n" |
| 1835 |
" size_t n;\n" |
| 1836 |
" struct gaicb const **wait_reqs;\n" |
| 1837 |
"\\&\n" |
| 1838 |
" wait_reqs = CALLOC(nreqs, const struct gaicb *);\n" |
| 1839 |
" if (wait_reqs == NULL)\n" |
| 1840 |
" err(EXIT_FAILURE, \"calloc\");\n" |
| 1841 |
"\\&\n" |
| 1842 |
" /* NULL elements are ignored by gai_suspend(). */\n" |
| 1843 |
"\\&\n" |
| 1844 |
" while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 1845 |
" n = atoi(id);\n" |
| 1846 |
"\\&\n" |
| 1847 |
" if (n E<gt>= nreqs) {\n" |
| 1848 |
" printf(\"Bad request number: %s\\[rs]n\", id);\n" |
| 1849 |
" return;\n" |
| 1850 |
" }\n" |
| 1851 |
"\\&\n" |
| 1852 |
" wait_reqs[n] = reqs[n];\n" |
| 1853 |
" }\n" |
| 1854 |
"\\&\n" |
| 1855 |
" ret = gai_suspend(wait_reqs, nreqs, NULL);\n" |
| 1856 |
" if (ret) {\n" |
| 1857 |
" printf(\"gai_suspend(): %s\\[rs]n\", gai_strerror(ret));\n" |
| 1858 |
" return;\n" |
| 1859 |
" }\n" |
| 1860 |
"\\&\n" |
| 1861 |
" for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 1862 |
" if (wait_reqs[i] == NULL)\n" |
| 1863 |
" continue;\n" |
| 1864 |
"\\&\n" |
| 1865 |
" ret = gai_error(reqs[i]);\n" |
| 1866 |
" if (ret == EAI_INPROGRESS)\n" |
| 1867 |
" continue;\n" |
| 1868 |
"\\&\n" |
| 1869 |
" printf(\"[%02zu] %s: %s\\[rs]n\", i, reqs[i]-E<gt>ar_name,\n" |
| 1870 |
" ret == 0 ? \"Finished\" : gai_strerror(ret));\n" |
| 1871 |
" }\n" |
| 1872 |
"}\n" |
| 1873 |
"\\&\n" |
| 1874 |
"/* Cancel specified requests. */\n" |
| 1875 |
"static void\n" |
| 1876 |
"cancel_requests(void)\n" |
| 1877 |
"{\n" |
| 1878 |
" char *id;\n" |
| 1879 |
" int ret;\n" |
| 1880 |
" size_t n;\n" |
| 1881 |
"\\&\n" |
| 1882 |
" while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 1883 |
" n = atoi(id);\n" |
| 1884 |
"\\&\n" |
| 1885 |
" if (n E<gt>= nreqs) {\n" |
| 1886 |
" printf(\"Bad request number: %s\\[rs]n\", id);\n" |
| 1887 |
" return;\n" |
| 1888 |
" }\n" |
| 1889 |
"\\&\n" |
| 1890 |
" ret = gai_cancel(reqs[n]);\n" |
| 1891 |
" printf(\"[%s] %s: %s\\[rs]n\", id, reqs[atoi(id)]-E<gt>ar_name,\n" |
| 1892 |
" gai_strerror(ret));\n" |
| 1893 |
" }\n" |
| 1894 |
"}\n" |
| 1895 |
"\\&\n" |
| 1896 |
"/* List all requests. */\n" |
| 1897 |
"static void\n" |
| 1898 |
"list_requests(void)\n" |
| 1899 |
"{\n" |
| 1900 |
" int ret;\n" |
| 1901 |
" char host[NI_MAXHOST];\n" |
| 1902 |
" struct addrinfo *res;\n" |
| 1903 |
"\\&\n" |
| 1904 |
" for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 1905 |
" printf(\"[%02zu] %s: \", i, reqs[i]-E<gt>ar_name);\n" |
| 1906 |
" ret = gai_error(reqs[i]);\n" |
| 1907 |
"\\&\n" |
| 1908 |
" if (!ret) {\n" |
| 1909 |
" res = reqs[i]-E<gt>ar_result;\n" |
| 1910 |
"\\&\n" |
| 1911 |
" ret = getnameinfo(res-E<gt>ai_addr, res-E<gt>ai_addrlen,\n" |
| 1912 |
" host, sizeof(host),\n" |
| 1913 |
" NULL, 0, NI_NUMERICHOST);\n" |
| 1914 |
" if (ret) {\n" |
| 1915 |
" fprintf(stderr, \"getnameinfo() failed: %s\\[rs]n\",\n" |
| 1916 |
" gai_strerror(ret));\n" |
| 1917 |
" exit(EXIT_FAILURE);\n" |
| 1918 |
" }\n" |
| 1919 |
" puts(host);\n" |
| 1920 |
" } else {\n" |
| 1921 |
" puts(gai_strerror(ret));\n" |
| 1922 |
" }\n" |
| 1923 |
" }\n" |
| 1924 |
"}\n" |
| 1925 |
"\\&\n" |
| 1926 |
"int\n" |
| 1927 |
"main(void)\n" |
| 1928 |
"{\n" |
| 1929 |
" char *cmdline;\n" |
| 1930 |
" char *cmd;\n" |
| 1931 |
"\\&\n" |
| 1932 |
" while ((cmdline = getcmd()) != NULL) {\n" |
| 1933 |
" cmd = strtok(cmdline, \" \");\n" |
| 1934 |
"\\&\n" |
| 1935 |
" if (cmd == NULL) {\n" |
| 1936 |
" list_requests();\n" |
| 1937 |
" } else {\n" |
| 1938 |
" switch (cmd[0]) {\n" |
| 1939 |
" case \\[aq]a\\[aq]:\n" |
| 1940 |
" add_requests();\n" |
| 1941 |
" break;\n" |
| 1942 |
" case \\[aq]w\\[aq]:\n" |
| 1943 |
" wait_requests();\n" |
| 1944 |
" break;\n" |
| 1945 |
" case \\[aq]c\\[aq]:\n" |
| 1946 |
" cancel_requests();\n" |
| 1947 |
" break;\n" |
| 1948 |
" case \\[aq]l\\[aq]:\n" |
| 1949 |
" list_requests();\n" |
| 1950 |
" break;\n" |
| 1951 |
" default:\n" |
| 1952 |
" fprintf(stderr, \"Bad command: %c\\[rs]n\", cmd[0]);\n" |
| 1953 |
" break;\n" |
| 1954 |
" }\n" |
| 1955 |
" }\n" |
| 1956 |
" }\n" |
| 1957 |
" exit(EXIT_SUCCESS);\n" |
| 1958 |
"}\n" |
| 1959 |
msgstr "" |
| 1960 |
"#define _GNU_SOURCE\n" |
| 1961 |
"#include E<lt>assert.hE<gt>\n" |
| 1962 |
"#include E<lt>err.hE<gt>\n" |
| 1963 |
"#include E<lt>netdb.hE<gt>\n" |
| 1964 |
"#include E<lt>stdio.hE<gt>\n" |
| 1965 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1966 |
"#include E<lt>string.hE<gt>\n" |
| 1967 |
"\\&\n" |
| 1968 |
"#define CALLOC(n, type) ((type *) calloc(n, sizeof(type)))\n" |
| 1969 |
"\\&\n" |
| 1970 |
"#define REALLOCF(ptr, n, type) \\[rs]\n" |
| 1971 |
"({ \\[rs]\n" |
| 1972 |
" static_assert(__builtin_types_compatible_p(typeof(ptr), type *)); \\[rs]\n" |
| 1973 |
" \\[rs]\n" |
| 1974 |
" (type *) reallocarrayf(ptr, n, sizeof(type)); \\[rs]\n" |
| 1975 |
"})\n" |
| 1976 |
"\\&\n" |
| 1977 |
"static struct gaicb **reqs = NULL;\n" |
| 1978 |
"static size_t nreqs = 0;\n" |
| 1979 |
"\\&\n" |
| 1980 |
"static inline void *\n" |
| 1981 |
"reallocarrayf(void *p, size_t nmemb, size_t size)\n" |
| 1982 |
"{\n" |
| 1983 |
" void *q;\n" |
| 1984 |
"\\&\n" |
| 1985 |
" q = reallocarray(p, nmemb, size);\n" |
| 1986 |
" if (q == NULL && nmemb != 0 && size != 0)\n" |
| 1987 |
" free(p);\n" |
| 1988 |
" return q;\n" |
| 1989 |
"}\n" |
| 1990 |
"\\&\n" |
| 1991 |
"static char *\n" |
| 1992 |
"getcmd(void)\n" |
| 1993 |
"{\n" |
| 1994 |
" static char buf[256];\n" |
| 1995 |
"\\&\n" |
| 1996 |
" fputs(\"E<gt> \", stdout); fflush(stdout);\n" |
| 1997 |
" if (fgets(buf, sizeof(buf), stdin) == NULL)\n" |
| 1998 |
" return NULL;\n" |
| 1999 |
"\\&\n" |
| 2000 |
" if (buf[strlen(buf) - 1] == \\[aq]\\[rs]n\\[aq])\n" |
| 2001 |
" buf[strlen(buf) - 1] = 0;\n" |
| 2002 |
"\\&\n" |
| 2003 |
" return buf;\n" |
| 2004 |
"}\n" |
| 2005 |
"\\&\n" |
| 2006 |
"/* Ajout des requêtes pour les noms d'hôte spécifiés. */\n" |
| 2007 |
"static void\n" |
| 2008 |
"add_requests(void)\n" |
| 2009 |
"{\n" |
| 2010 |
" size_t nreqs_base = nreqs;\n" |
| 2011 |
" char *host;\n" |
| 2012 |
" int ret;\n" |
| 2013 |
"\\&\n" |
| 2014 |
" while ((host = strtok(NULL, \" \"))) {\n" |
| 2015 |
" nreqs++;\n" |
| 2016 |
" reqs = REALLOCF(reqs, nreqs, struct gaicb *);\n" |
| 2017 |
" if (reqs == NULL)\n" |
| 2018 |
" err(EXIT_FAILURE, \"reallocf\");\n" |
| 2019 |
"\\&\n" |
| 2020 |
" reqs[nreqs - 1] = CALLOC(1, struct gaicb);\n" |
| 2021 |
" if (reqs[nreqs - 1] == NULL)\n" |
| 2022 |
" err(EXIT_FAILURE, \"calloc\");\n" |
| 2023 |
"\\&\n" |
| 2024 |
" reqs[nreqs - 1]-E<gt>ar_name = strdup(host);\n" |
| 2025 |
" }\n" |
| 2026 |
"\\&\n" |
| 2027 |
" /* Mettre en file d'attente les requêtes nreqs_base..nreqs. */\n" |
| 2028 |
"\\&\n" |
| 2029 |
" ret = getaddrinfo_a(GAI_NOWAIT, &reqs[nreqs_base],\n" |
| 2030 |
" nreqs - nreqs_base, NULL);\n" |
| 2031 |
" if (ret) {\n" |
| 2032 |
" fprintf(stderr, \"getaddrinfo_a() a échoué : %s\\[rs]n\",\n" |
| 2033 |
" gai_strerror(ret));\n" |
| 2034 |
" exit(EXIT_FAILURE);\n" |
| 2035 |
" }\n" |
| 2036 |
"}\n" |
| 2037 |
"\\&\n" |
| 2038 |
"/* Attendre qu'au moins une des requêtes spécifiées soit achevée. */\n" |
| 2039 |
"static void\n" |
| 2040 |
"wait_requests(void)\n" |
| 2041 |
"{\n" |
| 2042 |
" char *id;\n" |
| 2043 |
" int ret;\n" |
| 2044 |
" size_t n;\n" |
| 2045 |
" struct gaicb const **wait_reqs;\n" |
| 2046 |
"\\&\n" |
| 2047 |
" wait_reqs = CALLOC(nreqs, const struct gaicb *);\n" |
| 2048 |
" if (wait_reqs == NULL)\n" |
| 2049 |
" err(EXIT_FAILURE, \"calloc\");\n" |
| 2050 |
"\\&\n" |
| 2051 |
" /* Les éléments NULL sont ignorés par gai_suspend(). */\n" |
| 2052 |
"\\&\n" |
| 2053 |
" while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 2054 |
" n = atoi(id);\n" |
| 2055 |
"\\&\n" |
| 2056 |
" if (n E<gt>= nreqs) {\n" |
| 2057 |
" printf(\"Mauvais nombre de requêtes : %s\\[rs]n\", id);\n" |
| 2058 |
" return;\n" |
| 2059 |
" }\n" |
| 2060 |
"\\&\n" |
| 2061 |
" wait_reqs[n] = reqs[n];\n" |
| 2062 |
" }\n" |
| 2063 |
"\\&\n" |
| 2064 |
" ret = gai_suspend(wait_reqs, nreqs, NULL);\n" |
| 2065 |
" if (ret) {\n" |
| 2066 |
" printf(\"gai_suspend(): %s\\[rs]n\", gai_strerror(ret));\n" |
| 2067 |
" return;\n" |
| 2068 |
" }\n" |
| 2069 |
"\\&\n" |
| 2070 |
" for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 2071 |
" if (wait_reqs[i] == NULL)\n" |
| 2072 |
" continue;\n" |
| 2073 |
"\\&\n" |
| 2074 |
" ret = gai_error(reqs[i]);\n" |
| 2075 |
" if (ret == EAI_INPROGRESS)\n" |
| 2076 |
" continue;\n" |
| 2077 |
"\\&\n" |
| 2078 |
" printf(\"[%02zu] %s: %s\\[rs]n\", i, reqs[i]-E<gt>ar_name,\n" |
| 2079 |
" ret == 0 ? \"Terminé\" : gai_strerror(ret));\n" |
| 2080 |
" }\n" |
| 2081 |
"}\n" |
| 2082 |
"\\&\n" |
| 2083 |
"/* Annuler les requêtes spécifiées. */\n" |
| 2084 |
"static void\n" |
| 2085 |
"cancel_requests(void)\n" |
| 2086 |
"{\n" |
| 2087 |
" char *id;\n" |
| 2088 |
" int ret;\n" |
| 2089 |
" size_t n;\n" |
| 2090 |
"\\&\n" |
| 2091 |
" while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 2092 |
" n = atoi(id);\n" |
| 2093 |
"\\&\n" |
| 2094 |
" if (n E<gt>= nreqs) {\n" |
| 2095 |
" printf(\"Mauvais nombre de requêtes : %s\\[rs]n\", id);\n" |
| 2096 |
" return;\n" |
| 2097 |
" }\n" |
| 2098 |
"\\&\n" |
| 2099 |
" ret = gai_cancel(reqs[n]);\n" |
| 2100 |
" printf(\"[%s] %s: %s\\[rs]n\", id, reqs[atoi(id)]-E<gt>ar_name,\n" |
| 2101 |
" gai_strerror(ret));\n" |
| 2102 |
" }\n" |
| 2103 |
"}\n" |
| 2104 |
"\\&\n" |
| 2105 |
"/* Lister toutes les requêtes. */\n" |
| 2106 |
"static void\n" |
| 2107 |
"list_requests(void)\n" |
| 2108 |
"{\n" |
| 2109 |
" int ret;\n" |
| 2110 |
" char host[NI_MAXHOST];\n" |
| 2111 |
" struct addrinfo *res;\n" |
| 2112 |
"\\&\n" |
| 2113 |
" for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 2114 |
" printf(\"[%02zu] %s: \", i, reqs[i]-E<gt>ar_name);\n" |
| 2115 |
" ret = gai_error(reqs[i]);\n" |
| 2116 |
"\\&\n" |
| 2117 |
" if (!ret) {\n" |
| 2118 |
" res = reqs[i]-E<gt>ar_result;\n" |
| 2119 |
"\\&\n" |
| 2120 |
" ret = getnameinfo(res-E<gt>ai_addr, res-E<gt>ai_addrlen,\n" |
| 2121 |
" host, sizeof(host),\n" |
| 2122 |
" NULL, 0, NI_NUMERICHOST);\n" |
| 2123 |
" if (ret) {\n" |
| 2124 |
" fprintf(stderr, \"getnameinfo() a échoué : %s\\[rs]n\",\n" |
| 2125 |
" gai_strerror(ret));\n" |
| 2126 |
" exit(EXIT_FAILURE);\n" |
| 2127 |
" }\n" |
| 2128 |
" puts(host);\n" |
| 2129 |
" } else {\n" |
| 2130 |
" puts(gai_strerror(ret));\n" |
| 2131 |
" }\n" |
| 2132 |
" }\n" |
| 2133 |
"}\n" |
| 2134 |
"\\&\n" |
| 2135 |
"int\n" |
| 2136 |
"main(void)\n" |
| 2137 |
"{\n" |
| 2138 |
" char *cmdline;\n" |
| 2139 |
" char *cmd;\n" |
| 2140 |
"\\&\n" |
| 2141 |
" while ((cmdline = getcmd()) != NULL) {\n" |
| 2142 |
" cmd = strtok(cmdline, \" \");\n" |
| 2143 |
"\\&\n" |
| 2144 |
" if (cmd == NULL) {\n" |
| 2145 |
" list_requests();\n" |
| 2146 |
" } else {\n" |
| 2147 |
" switch (cmd[0]) {\n" |
| 2148 |
" case \\[aq]a\\[aq]:\n" |
| 2149 |
" add_requests();\n" |
| 2150 |
" break;\n" |
| 2151 |
" case \\[aq]w\\[aq]:\n" |
| 2152 |
" wait_requests();\n" |
| 2153 |
" break;\n" |
| 2154 |
" case \\[aq]c\\[aq]:\n" |
| 2155 |
" cancel_requests();\n" |
| 2156 |
" break;\n" |
| 2157 |
" case \\[aq]l\\[aq]:\n" |
| 2158 |
" list_requests();\n" |
| 2159 |
" break;\n" |
| 2160 |
" default:\n" |
| 2161 |
" fprintf(stderr, \"Mauvaise commande : %c\\[rs]n\", cmd[0]);\n" |
| 2162 |
" break;\n" |
| 2163 |
" }\n" |
| 2164 |
" }\n" |
| 2165 |
" }\n" |
| 2166 |
" exit(EXIT_SUCCESS);\n" |
| 2167 |
"}\n" |
| 2168 |
|
| 2169 |
#. type: TH |
| 2170 |
#: fedora-44 fedora-rawhide |
| 2171 |
#, no-wrap |
| 2172 |
msgid "2024-11-17" |
| 2173 |
msgstr "17 novembre 2024" |
| 2174 |
|
| 2175 |
#. type: TH |
| 2176 |
#: fedora-44 fedora-rawhide |
| 2177 |
#, no-wrap |
| 2178 |
msgid "Linux man-pages 6.13" |
| 2179 |
msgstr "Pages du manuel de Linux 6.13" |
| 2180 |
|
| 2181 |
#. type: Plain text |
| 2182 |
#: fedora-44 fedora-rawhide |
| 2183 |
#, no-wrap |
| 2184 |
msgid "" |
| 2185 |
"B<int getaddrinfo_a(int >I<mode>B<, struct gaicb *>I<list>B<[restrict],>\n" |
| 2186 |
"B< int >I<n>B<, struct sigevent *restrict >I<sevp>B<);>\n" |
| 2187 |
"B<int gai_suspend(const struct gaicb *const >I<list>B<[], int >I<n>B<,>\n" |
| 2188 |
"B< const struct timespec *>I<timeout>B<);>\n" |
| 2189 |
msgstr "" |
| 2190 |
"B<int getaddrinfo_a(int >I<mode>B<, struct gaicb *>I<list>B<[restrict],>\n" |
| 2191 |
"B< int >I<n>B<, struct sigevent *restrict >I<sevp>B<);>\n" |
| 2192 |
"B<int gai_suspend(const struct gaicb *const >I<list>B<[], int >I<n>B<,>\n" |
| 2193 |
"B< const struct timespec *>I<timeout>B<);>\n" |
| 2194 |
|
| 2195 |
#. type: Plain text |
| 2196 |
#: fedora-44 fedora-rawhide |
| 2197 |
#, no-wrap |
| 2198 |
msgid "" |
| 2199 |
"#define _GNU_SOURCE\n" |
| 2200 |
"#include E<lt>assert.hE<gt>\n" |
| 2201 |
"#include E<lt>err.hE<gt>\n" |
| 2202 |
"#include E<lt>netdb.hE<gt>\n" |
| 2203 |
"#include E<lt>stdio.hE<gt>\n" |
| 2204 |
"#include E<lt>stdlib.hE<gt>\n" |
| 2205 |
"#include E<lt>string.hE<gt>\n" |
| 2206 |
"\\&\n" |
| 2207 |
"#define CALLOC(n, type) ((type *) calloc(n, sizeof(type)))\n" |
| 2208 |
"\\&\n" |
| 2209 |
"#define REALLOCF(ptr, n, type) \\[rs]\n" |
| 2210 |
"({ \\[rs]\n" |
| 2211 |
" static_assert(__builtin_types_compatible_p(typeof(ptr), type *)); \\[rs]\n" |
| 2212 |
" \\[rs]\n" |
| 2213 |
" (type *) reallocarrayf(ptr, n, sizeof(type)); \\[rs]\n" |
| 2214 |
"})\n" |
| 2215 |
"\\&\n" |
| 2216 |
"static struct gaicb **reqs = NULL;\n" |
| 2217 |
"static size_t nreqs = 0;\n" |
| 2218 |
"\\&\n" |
| 2219 |
"static inline void *\n" |
| 2220 |
"reallocarrayf(void *p, size_t n, size_t size)\n" |
| 2221 |
"{\n" |
| 2222 |
" void *q;\n" |
| 2223 |
"\\&\n" |
| 2224 |
" q = reallocarray(p, n, size);\n" |
| 2225 |
" if (q == NULL && n != 0 && size != 0)\n" |
| 2226 |
" free(p);\n" |
| 2227 |
" return q;\n" |
| 2228 |
"}\n" |
| 2229 |
"\\&\n" |
| 2230 |
"static char *\n" |
| 2231 |
"getcmd(void)\n" |
| 2232 |
"{\n" |
| 2233 |
" static char buf[256];\n" |
| 2234 |
"\\&\n" |
| 2235 |
" fputs(\"E<gt> \", stdout); fflush(stdout);\n" |
| 2236 |
" if (fgets(buf, sizeof(buf), stdin) == NULL)\n" |
| 2237 |
" return NULL;\n" |
| 2238 |
"\\&\n" |
| 2239 |
" if (buf[strlen(buf) - 1] == \\[aq]\\[rs]n\\[aq])\n" |
| 2240 |
" buf[strlen(buf) - 1] = 0;\n" |
| 2241 |
"\\&\n" |
| 2242 |
" return buf;\n" |
| 2243 |
"}\n" |
| 2244 |
"\\&\n" |
| 2245 |
"/* Add requests for specified hostnames. */\n" |
| 2246 |
"static void\n" |
| 2247 |
"add_requests(void)\n" |
| 2248 |
"{\n" |
| 2249 |
" size_t nreqs_base = nreqs;\n" |
| 2250 |
" char *host;\n" |
| 2251 |
" int ret;\n" |
| 2252 |
"\\&\n" |
| 2253 |
" while ((host = strtok(NULL, \" \"))) {\n" |
| 2254 |
" nreqs++;\n" |
| 2255 |
" reqs = REALLOCF(reqs, nreqs, struct gaicb *);\n" |
| 2256 |
" if (reqs == NULL)\n" |
| 2257 |
" err(EXIT_FAILURE, \"reallocf\");\n" |
| 2258 |
"\\&\n" |
| 2259 |
" reqs[nreqs - 1] = CALLOC(1, struct gaicb);\n" |
| 2260 |
" if (reqs[nreqs - 1] == NULL)\n" |
| 2261 |
" err(EXIT_FAILURE, \"calloc\");\n" |
| 2262 |
"\\&\n" |
| 2263 |
" reqs[nreqs - 1]-E<gt>ar_name = strdup(host);\n" |
| 2264 |
" }\n" |
| 2265 |
"\\&\n" |
| 2266 |
" /* Queue nreqs_base..nreqs requests. */\n" |
| 2267 |
"\\&\n" |
| 2268 |
" ret = getaddrinfo_a(GAI_NOWAIT, &reqs[nreqs_base],\n" |
| 2269 |
" nreqs - nreqs_base, NULL);\n" |
| 2270 |
" if (ret) {\n" |
| 2271 |
" fprintf(stderr, \"getaddrinfo_a() failed: %s\\[rs]n\",\n" |
| 2272 |
" gai_strerror(ret));\n" |
| 2273 |
" exit(EXIT_FAILURE);\n" |
| 2274 |
" }\n" |
| 2275 |
"}\n" |
| 2276 |
"\\&\n" |
| 2277 |
"/* Wait until at least one of specified requests completes. */\n" |
| 2278 |
"static void\n" |
| 2279 |
"wait_requests(void)\n" |
| 2280 |
"{\n" |
| 2281 |
" char *id;\n" |
| 2282 |
" int ret;\n" |
| 2283 |
" size_t n;\n" |
| 2284 |
" struct gaicb const **wait_reqs;\n" |
| 2285 |
"\\&\n" |
| 2286 |
" wait_reqs = CALLOC(nreqs, const struct gaicb *);\n" |
| 2287 |
" if (wait_reqs == NULL)\n" |
| 2288 |
" err(EXIT_FAILURE, \"calloc\");\n" |
| 2289 |
"\\&\n" |
| 2290 |
" /* NULL elements are ignored by gai_suspend(). */\n" |
| 2291 |
"\\&\n" |
| 2292 |
" while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 2293 |
" n = atoi(id);\n" |
| 2294 |
"\\&\n" |
| 2295 |
" if (n E<gt>= nreqs) {\n" |
| 2296 |
" printf(\"Bad request number: %s\\[rs]n\", id);\n" |
| 2297 |
" return;\n" |
| 2298 |
" }\n" |
| 2299 |
"\\&\n" |
| 2300 |
" wait_reqs[n] = reqs[n];\n" |
| 2301 |
" }\n" |
| 2302 |
"\\&\n" |
| 2303 |
" ret = gai_suspend(wait_reqs, nreqs, NULL);\n" |
| 2304 |
" if (ret) {\n" |
| 2305 |
" printf(\"gai_suspend(): %s\\[rs]n\", gai_strerror(ret));\n" |
| 2306 |
" return;\n" |
| 2307 |
" }\n" |
| 2308 |
"\\&\n" |
| 2309 |
" for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 2310 |
" if (wait_reqs[i] == NULL)\n" |
| 2311 |
" continue;\n" |
| 2312 |
"\\&\n" |
| 2313 |
" ret = gai_error(reqs[i]);\n" |
| 2314 |
" if (ret == EAI_INPROGRESS)\n" |
| 2315 |
" continue;\n" |
| 2316 |
"\\&\n" |
| 2317 |
" printf(\"[%02zu] %s: %s\\[rs]n\", i, reqs[i]-E<gt>ar_name,\n" |
| 2318 |
" ret == 0 ? \"Finished\" : gai_strerror(ret));\n" |
| 2319 |
" }\n" |
| 2320 |
"}\n" |
| 2321 |
"\\&\n" |
| 2322 |
"/* Cancel specified requests. */\n" |
| 2323 |
"static void\n" |
| 2324 |
"cancel_requests(void)\n" |
| 2325 |
"{\n" |
| 2326 |
" char *id;\n" |
| 2327 |
" int ret;\n" |
| 2328 |
" size_t n;\n" |
| 2329 |
"\\&\n" |
| 2330 |
" while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 2331 |
" n = atoi(id);\n" |
| 2332 |
"\\&\n" |
| 2333 |
" if (n E<gt>= nreqs) {\n" |
| 2334 |
" printf(\"Bad request number: %s\\[rs]n\", id);\n" |
| 2335 |
" return;\n" |
| 2336 |
" }\n" |
| 2337 |
"\\&\n" |
| 2338 |
" ret = gai_cancel(reqs[n]);\n" |
| 2339 |
" printf(\"[%s] %s: %s\\[rs]n\", id, reqs[atoi(id)]-E<gt>ar_name,\n" |
| 2340 |
" gai_strerror(ret));\n" |
| 2341 |
" }\n" |
| 2342 |
"}\n" |
| 2343 |
"\\&\n" |
| 2344 |
"/* List all requests. */\n" |
| 2345 |
"static void\n" |
| 2346 |
"list_requests(void)\n" |
| 2347 |
"{\n" |
| 2348 |
" int ret;\n" |
| 2349 |
" char host[NI_MAXHOST];\n" |
| 2350 |
" struct addrinfo *res;\n" |
| 2351 |
"\\&\n" |
| 2352 |
" for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 2353 |
" printf(\"[%02zu] %s: \", i, reqs[i]-E<gt>ar_name);\n" |
| 2354 |
" ret = gai_error(reqs[i]);\n" |
| 2355 |
"\\&\n" |
| 2356 |
" if (!ret) {\n" |
| 2357 |
" res = reqs[i]-E<gt>ar_result;\n" |
| 2358 |
"\\&\n" |
| 2359 |
" ret = getnameinfo(res-E<gt>ai_addr, res-E<gt>ai_addrlen,\n" |
| 2360 |
" host, sizeof(host),\n" |
| 2361 |
" NULL, 0, NI_NUMERICHOST);\n" |
| 2362 |
" if (ret) {\n" |
| 2363 |
" fprintf(stderr, \"getnameinfo() failed: %s\\[rs]n\",\n" |
| 2364 |
" gai_strerror(ret));\n" |
| 2365 |
" exit(EXIT_FAILURE);\n" |
| 2366 |
" }\n" |
| 2367 |
" puts(host);\n" |
| 2368 |
" } else {\n" |
| 2369 |
" puts(gai_strerror(ret));\n" |
| 2370 |
" }\n" |
| 2371 |
" }\n" |
| 2372 |
"}\n" |
| 2373 |
"\\&\n" |
| 2374 |
"int\n" |
| 2375 |
"main(void)\n" |
| 2376 |
"{\n" |
| 2377 |
" char *cmdline;\n" |
| 2378 |
" char *cmd;\n" |
| 2379 |
"\\&\n" |
| 2380 |
" while ((cmdline = getcmd()) != NULL) {\n" |
| 2381 |
" cmd = strtok(cmdline, \" \");\n" |
| 2382 |
"\\&\n" |
| 2383 |
" if (cmd == NULL) {\n" |
| 2384 |
" list_requests();\n" |
| 2385 |
" } else {\n" |
| 2386 |
" switch (cmd[0]) {\n" |
| 2387 |
" case \\[aq]a\\[aq]:\n" |
| 2388 |
" add_requests();\n" |
| 2389 |
" break;\n" |
| 2390 |
" case \\[aq]w\\[aq]:\n" |
| 2391 |
" wait_requests();\n" |
| 2392 |
" break;\n" |
| 2393 |
" case \\[aq]c\\[aq]:\n" |
| 2394 |
" cancel_requests();\n" |
| 2395 |
" break;\n" |
| 2396 |
" case \\[aq]l\\[aq]:\n" |
| 2397 |
" list_requests();\n" |
| 2398 |
" break;\n" |
| 2399 |
" default:\n" |
| 2400 |
" fprintf(stderr, \"Bad command: %c\\[rs]n\", cmd[0]);\n" |
| 2401 |
" break;\n" |
| 2402 |
" }\n" |
| 2403 |
" }\n" |
| 2404 |
" }\n" |
| 2405 |
" exit(EXIT_SUCCESS);\n" |
| 2406 |
"}\n" |
| 2407 |
msgstr "" |
| 2408 |
"#define _GNU_SOURCE\n" |
| 2409 |
"#include E<lt>assert.hE<gt>\n" |
| 2410 |
"#include E<lt>err.hE<gt>\n" |
| 2411 |
"#include E<lt>netdb.hE<gt>\n" |
| 2412 |
"#include E<lt>stdio.hE<gt>\n" |
| 2413 |
"#include E<lt>stdlib.hE<gt>\n" |
| 2414 |
"#include E<lt>string.hE<gt>\n" |
| 2415 |
"\\&\n" |
| 2416 |
"#define CALLOC(n, type) ((type *) calloc(n, sizeof(type)))\n" |
| 2417 |
"\\&\n" |
| 2418 |
"#define REALLOCF(ptr, n, type) \\[rs]\n" |
| 2419 |
"({ \\[rs]\n" |
| 2420 |
" static_assert(__builtin_types_compatible_p(typeof(ptr), type *)); \\[rs]\n" |
| 2421 |
" \\[rs]\n" |
| 2422 |
" (type *) reallocarrayf(ptr, n, sizeof(type)); \\[rs]\n" |
| 2423 |
"})\n" |
| 2424 |
"\\&\n" |
| 2425 |
"static struct gaicb **reqs = NULL;\n" |
| 2426 |
"static size_t nreqs = 0;\n" |
| 2427 |
"\\&\n" |
| 2428 |
"static inline void *\n" |
| 2429 |
"reallocarrayf(void *p, size_t n, size_t size)\n" |
| 2430 |
"{\n" |
| 2431 |
" void *q;\n" |
| 2432 |
"\\&\n" |
| 2433 |
" q = reallocarray(p, n, size);\n" |
| 2434 |
" if (q == NULL && n != 0 && size != 0)\n" |
| 2435 |
" free(p);\n" |
| 2436 |
" return q;\n" |
| 2437 |
"}\n" |
| 2438 |
"\\&\n" |
| 2439 |
"static char *\n" |
| 2440 |
"getcmd(void)\n" |
| 2441 |
"{\n" |
| 2442 |
" static char buf[256];\n" |
| 2443 |
"\\&\n" |
| 2444 |
" fputs(\"E<gt> \", stdout); fflush(stdout);\n" |
| 2445 |
" if (fgets(buf, sizeof(buf), stdin) == NULL)\n" |
| 2446 |
" return NULL;\n" |
| 2447 |
"\\&\n" |
| 2448 |
" if (buf[strlen(buf) - 1] == \\[aq]\\[rs]n\\[aq])\n" |
| 2449 |
" buf[strlen(buf) - 1] = 0;\n" |
| 2450 |
"\\&\n" |
| 2451 |
" return buf;\n" |
| 2452 |
"}\n" |
| 2453 |
"\\&\n" |
| 2454 |
"/* Ajout des requêtes pour les noms d'hôte spécifiés. */\n" |
| 2455 |
"static void\n" |
| 2456 |
"add_requests(void)\n" |
| 2457 |
"{\n" |
| 2458 |
" size_t nreqs_base = nreqs;\n" |
| 2459 |
" char *host;\n" |
| 2460 |
" int ret;\n" |
| 2461 |
"\\&\n" |
| 2462 |
" while ((host = strtok(NULL, \" \"))) {\n" |
| 2463 |
" nreqs++;\n" |
| 2464 |
" reqs = REALLOCF(reqs, nreqs, struct gaicb *);\n" |
| 2465 |
" if (reqs == NULL)\n" |
| 2466 |
" err(EXIT_FAILURE, \"reallocf\");\n" |
| 2467 |
"\\&\n" |
| 2468 |
" reqs[nreqs - 1] = CALLOC(1, struct gaicb);\n" |
| 2469 |
" if (reqs[nreqs - 1] == NULL)\n" |
| 2470 |
" err(EXIT_FAILURE, \"calloc\");\n" |
| 2471 |
"\\&\n" |
| 2472 |
" reqs[nreqs - 1]-E<gt>ar_name = strdup(host);\n" |
| 2473 |
" }\n" |
| 2474 |
"\\&\n" |
| 2475 |
" /* Mettre en file d'attente les requêtes nreqs_base..nreqs. */\n" |
| 2476 |
"\\&\n" |
| 2477 |
" ret = getaddrinfo_a(GAI_NOWAIT, &reqs[nreqs_base],\n" |
| 2478 |
" nreqs - nreqs_base, NULL);\n" |
| 2479 |
" if (ret) {\n" |
| 2480 |
" fprintf(stderr, \"getaddrinfo_a() a échoué : %s\\[rs]n\",\n" |
| 2481 |
" gai_strerror(ret));\n" |
| 2482 |
" exit(EXIT_FAILURE);\n" |
| 2483 |
" }\n" |
| 2484 |
"}\n" |
| 2485 |
"\\&\n" |
| 2486 |
"/* Attendre qu'au moins une des requêtes spécifiées soit achevée. */\n" |
| 2487 |
"static void\n" |
| 2488 |
"wait_requests(void)\n" |
| 2489 |
"{\n" |
| 2490 |
" char *id;\n" |
| 2491 |
" int ret;\n" |
| 2492 |
" size_t n;\n" |
| 2493 |
" struct gaicb const **wait_reqs;\n" |
| 2494 |
"\\&\n" |
| 2495 |
" wait_reqs = CALLOC(nreqs, const struct gaicb *);\n" |
| 2496 |
" if (wait_reqs == NULL)\n" |
| 2497 |
" err(EXIT_FAILURE, \"calloc\");\n" |
| 2498 |
"\\&\n" |
| 2499 |
" /* Les éléments NULL sont ignorés par gai_suspend(). */\n" |
| 2500 |
"\\&\n" |
| 2501 |
" while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 2502 |
" n = atoi(id);\n" |
| 2503 |
"\\&\n" |
| 2504 |
" if (n E<gt>= nreqs) {\n" |
| 2505 |
" printf(\"Mauvais nombre de requêtes : %s\\[rs]n\", id);\n" |
| 2506 |
" return;\n" |
| 2507 |
" }\n" |
| 2508 |
"\\&\n" |
| 2509 |
" wait_reqs[n] = reqs[n];\n" |
| 2510 |
" }\n" |
| 2511 |
"\\&\n" |
| 2512 |
" ret = gai_suspend(wait_reqs, nreqs, NULL);\n" |
| 2513 |
" if (ret) {\n" |
| 2514 |
" printf(\"gai_suspend(): %s\\[rs]n\", gai_strerror(ret));\n" |
| 2515 |
" return;\n" |
| 2516 |
" }\n" |
| 2517 |
"\\&\n" |
| 2518 |
" for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 2519 |
" if (wait_reqs[i] == NULL)\n" |
| 2520 |
" continue;\n" |
| 2521 |
"\\&\n" |
| 2522 |
" ret = gai_error(reqs[i]);\n" |
| 2523 |
" if (ret == EAI_INPROGRESS)\n" |
| 2524 |
" continue;\n" |
| 2525 |
"\\&\n" |
| 2526 |
" printf(\"[%02zu] %s: %s\\[rs]n\", i, reqs[i]-E<gt>ar_name,\n" |
| 2527 |
" ret == 0 ? \"Terminé\" : gai_strerror(ret));\n" |
| 2528 |
" }\n" |
| 2529 |
"}\n" |
| 2530 |
"\\&\n" |
| 2531 |
"/* Annuler les requêtes spécifiées. */\n" |
| 2532 |
"static void\n" |
| 2533 |
"cancel_requests(void)\n" |
| 2534 |
"{\n" |
| 2535 |
" char *id;\n" |
| 2536 |
" int ret;\n" |
| 2537 |
" size_t n;\n" |
| 2538 |
"\\&\n" |
| 2539 |
" while ((id = strtok(NULL, \" \")) != NULL) {\n" |
| 2540 |
" n = atoi(id);\n" |
| 2541 |
"\\&\n" |
| 2542 |
" if (n E<gt>= nreqs) {\n" |
| 2543 |
" printf(\"Mauvais nombre de requêtes : %s\\[rs]n\", id);\n" |
| 2544 |
" return;\n" |
| 2545 |
" }\n" |
| 2546 |
"\\&\n" |
| 2547 |
" ret = gai_cancel(reqs[n]);\n" |
| 2548 |
" printf(\"[%s] %s: %s\\[rs]n\", id, reqs[atoi(id)]-E<gt>ar_name,\n" |
| 2549 |
" gai_strerror(ret));\n" |
| 2550 |
" }\n" |
| 2551 |
"}\n" |
| 2552 |
"\\&\n" |
| 2553 |
"/* Lister toutes les requêtes. */\n" |
| 2554 |
"static void\n" |
| 2555 |
"list_requests(void)\n" |
| 2556 |
"{\n" |
| 2557 |
" int ret;\n" |
| 2558 |
" char host[NI_MAXHOST];\n" |
| 2559 |
" struct addrinfo *res;\n" |
| 2560 |
"\\&\n" |
| 2561 |
" for (size_t i = 0; i E<lt> nreqs; i++) {\n" |
| 2562 |
" printf(\"[%02zu] %s: \", i, reqs[i]-E<gt>ar_name);\n" |
| 2563 |
" ret = gai_error(reqs[i]);\n" |
| 2564 |
"\\&\n" |
| 2565 |
" if (!ret) {\n" |
| 2566 |
" res = reqs[i]-E<gt>ar_result;\n" |
| 2567 |
"\\&\n" |
| 2568 |
" ret = getnameinfo(res-E<gt>ai_addr, res-E<gt>ai_addrlen,\n" |
| 2569 |
" host, sizeof(host),\n" |
| 2570 |
" NULL, 0, NI_NUMERICHOST);\n" |
| 2571 |
" if (ret) {\n" |
| 2572 |
" fprintf(stderr, \"getnameinfo() a échoué : %s\\[rs]n\",\n" |
| 2573 |
" gai_strerror(ret));\n" |
| 2574 |
" exit(EXIT_FAILURE);\n" |
| 2575 |
" }\n" |
| 2576 |
" puts(host);\n" |
| 2577 |
" } else {\n" |
| 2578 |
" puts(gai_strerror(ret));\n" |
| 2579 |
" }\n" |
| 2580 |
" }\n" |
| 2581 |
"}\n" |
| 2582 |
"\\&\n" |
| 2583 |
"int\n" |
| 2584 |
"main(void)\n" |
| 2585 |
"{\n" |
| 2586 |
" char *cmdline;\n" |
| 2587 |
" char *cmd;\n" |
| 2588 |
"\\&\n" |
| 2589 |
" while ((cmdline = getcmd()) != NULL) {\n" |
| 2590 |
" cmd = strtok(cmdline, \" \");\n" |
| 2591 |
"\\&\n" |
| 2592 |
" if (cmd == NULL) {\n" |
| 2593 |
" list_requests();\n" |
| 2594 |
" } else {\n" |
| 2595 |
" switch (cmd[0]) {\n" |
| 2596 |
" case \\[aq]a\\[aq]:\n" |
| 2597 |
" add_requests();\n" |
| 2598 |
" break;\n" |
| 2599 |
" case \\[aq]w\\[aq]:\n" |
| 2600 |
" wait_requests();\n" |
| 2601 |
" break;\n" |
| 2602 |
" case \\[aq]c\\[aq]:\n" |
| 2603 |
" cancel_requests();\n" |
| 2604 |
" break;\n" |
| 2605 |
" case \\[aq]l\\[aq]:\n" |
| 2606 |
" list_requests();\n" |
| 2607 |
" break;\n" |
| 2608 |
" default:\n" |
| 2609 |
" fprintf(stderr, \"Mauvaise commande : %c\\[rs]n\", cmd[0]);\n" |
| 2610 |
" break;\n" |
| 2611 |
" }\n" |
| 2612 |
" }\n" |
| 2613 |
" }\n" |
| 2614 |
" exit(EXIT_SUCCESS);\n" |
| 2615 |
"}\n" |
| 2616 |
|
| 2617 |
#. type: TH |
| 2618 |
#: mageia-cauldron |
| 2619 |
#, no-wrap |
| 2620 |
msgid "Linux man-pages 6.17" |
| 2621 |
msgstr "Pages du manuel de Linux 6.17" |
| 2622 |
|
| 2623 |
#. type: TH |
| 2624 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 2625 |
#, no-wrap |
| 2626 |
msgid "Linux man-pages (unreleased)" |
| 2627 |
msgstr "Pages du manuel de Linux (non publiées)" |