Debian Codegraph @

po/ro/man3/getservent_r.3.po

raw
1 # Romanian translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Remus-Gabriel Chelu <[email protected]>, 2024, 2025, 2026.
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: manpages-l10n 4.21.0\n"
8 "POT-Creation-Date: 2026-06-05 06:26+0200\n"
9 "PO-Revision-Date: 2026-05-07 01:05+0200\n"
10 "Last-Translator: Remus-Gabriel Chelu <[email protected]>\n"
11 "Language-Team: Romanian <[email protected]>\n"
12 "Language: ro\n"
13 "MIME-Version: 1.0\n"
14 "Content-Type: text/plain; charset=UTF-8\n"
15 "Content-Transfer-Encoding: 8bit\n"
16 "Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < "
17 "20)) ? 1 : 2;\n"
18 "X-Generator: Poedit 3.8\n"
19
20 #. type: TH
21 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
22 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
23 #, no-wrap
24 msgid "getservent_r"
25 msgstr "getservent_r"
26
27 #. type: TH
28 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
29 #, no-wrap
30 msgid "2026-02-22"
31 msgstr "22 februarie 2026"
32
33 #. type: TH
34 #: archlinux debian-unstable
35 #, no-wrap
36 msgid "Linux man-pages 6.18"
37 msgstr "Pagini de manual de Linux 6.18"
38
39 #. type: SH
40 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
41 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
42 #, no-wrap
43 msgid "NAME"
44 msgstr "NUME"
45
46 #. type: Plain text
47 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
48 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
49 msgid ""
50 "getservent_r, getservbyname_r, getservbyport_r - get service entry "
51 "(reentrant)"
52 msgstr ""
53 "getservent_r, getservbyname_r, getservbyport_r - obține intrarea serviciului "
54 "(reentrant)"
55
56 #. type: SH
57 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
58 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
59 #, no-wrap
60 msgid "LIBRARY"
61 msgstr "BIBLIOTECA"
62
63 #. type: Plain text
64 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
65 #: opensuse-leap-16-1 opensuse-tumbleweed
66 msgid "Standard C library (I<libc>,\\ I<-lc>)"
67 msgstr "Biblioteca C standard (I<libc>, I<-lc>)"
68
69 #. type: SH
70 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
71 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
72 #, no-wrap
73 msgid "SYNOPSIS"
74 msgstr "SINOPSIS"
75
76 #. type: Plain text
77 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
78 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
79 #, no-wrap
80 msgid "B<#include E<lt>netdb.hE<gt>>\n"
81 msgstr "B<#include E<lt>netdb.hE<gt>>\n"
82
83 #. type: Plain text
84 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
85 #: opensuse-tumbleweed
86 #, no-wrap
87 msgid ""
88 "B<int getservent_r(>size_t size;\n"
89 "B< struct servent *restrict >I<result_buf>B<,>\n"
90 "B< char >I<buf>B<[restrict >I<size>B<], size_t >I<size>B<,>\n"
91 "B< struct servent **restrict >I<result>B<);>\n"
92 "B<int getservbyname_r(>size_t size;\n"
93 "B< const char *restrict >I<name>B<,>\n"
94 "B< const char *restrict >I<proto>B<,>\n"
95 "B< struct servent *restrict >I<result_buf>B<,>\n"
96 "B< char >I<buf>B<[restrict >I<size>B<], size_t >I<size>B<,>\n"
97 "B< struct servent **restrict >I<result>B<);>\n"
98 "B<int getservbyport_r(>size_t size;\n"
99 "B< int >I<port>B<,>\n"
100 "B< const char *restrict >I<proto>B<,>\n"
101 "B< struct servent *restrict >I<result_buf>B<,>\n"
102 "B< char >I<buf>B<[restrict >I<size>B<], size_t >I<size>B<,>\n"
103 "B< struct servent **restrict >I<result>B<);>\n"
104 msgstr ""
105 "B<int getservent_r(>size_t size;\n"
106 "B< struct servent *restrict >I<result_buf>B<,>\n"
107 "B< char >I<buf>B<[restrict >I<size>B<], size_t >I<size>B<,>\n"
108 "B< struct servent **restrict >I<result>B<);>\n"
109 "B<int getservbyname_r(>size_t size;\n"
110 "B< const char *restrict >I<name>B<,>\n"
111 "B< const char *restrict >I<proto>B<,>\n"
112 "B< struct servent *restrict >I<result_buf>B<,>\n"
113 "B< char >I<buf>B<[restrict >I<size>B<], size_t >I<size>B<,>\n"
114 "B< struct servent **restrict >I<result>B<);>\n"
115 "B<int getservbyport_r(>size_t size;\n"
116 "B< int >I<port>B<,>\n"
117 "B< const char *restrict >I<proto>B<,>\n"
118 "B< struct servent *restrict >I<result_buf>B<,>\n"
119 "B< char >I<buf>B<[restrict >I<size>B<], size_t >I<size>B<,>\n"
120 "B< struct servent **restrict >I<result>B<);>\n"
121
122 #. type: Plain text
123 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
124 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
125 msgid ""
126 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
127 msgstr ""
128 "Cerințe pentru macrocomenzi de testare a caracteristicilor pentru glibc "
129 "(consultați B<feature_test_macros>(7)):"
130
131 #. type: Plain text
132 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
133 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
134 msgid "B<getservent_r>(), B<getservbyname_r>(), B<getservbyport_r>():"
135 msgstr "B<getservent_r>(), B<getservbyname_r>(), B<getservbyport_r>():"
136
137 #. type: Plain text
138 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
139 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
140 #, no-wrap
141 msgid ""
142 " Since glibc 2.19:\n"
143 " _DEFAULT_SOURCE\n"
144 " glibc 2.19 and earlier:\n"
145 " _BSD_SOURCE || _SVID_SOURCE\n"
146 msgstr ""
147 " Începând cu glibc 2.19:\n"
148 " _DEFAULT_SOURCE\n"
149 " glibc 2.19 și versiunile anterioare:\n"
150 " _BSD_SOURCE || _SVID_SOURCE\n"
151
152 #. type: SH
153 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
154 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
155 #, no-wrap
156 msgid "DESCRIPTION"
157 msgstr "DESCRIERE"
158
159 #. type: Plain text
160 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
161 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
162 msgid ""
163 "The B<getservent_r>(), B<getservbyname_r>(), and B<getservbyport_r>() "
164 "functions are the reentrant equivalents of, respectively, B<getservent>(3), "
165 "B<getservbyname>(3), and B<getservbyport>(3). They differ in the way that "
166 "the I<servent> structure is returned, and in the function calling signature "
167 "and return value. This manual page describes just the differences from the "
168 "nonreentrant functions."
169 msgstr ""
170 "Funcțiile B<getservent_r>(), B<getservbyname_r>() și B<getservbyport_r>() "
171 "sunt echivalentele reentrante ale funcțiilor B<getservent>(3), "
172 "B<getservbyname>(3) și B<getservbyport>(3). Ele diferă prin modul în care "
173 "este returnată structura I<servent>, precum și prin semnătura de apelare a "
174 "funcției și valoarea de returnare. Această pagină de manual descrie doar "
175 "diferențele față de funcțiile ne reentrante."
176
177 #. type: Plain text
178 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
179 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
180 msgid ""
181 "Instead of returning a pointer to a statically allocated I<servent> "
182 "structure as the function result, these functions copy the structure into "
183 "the location pointed to by I<result_buf>."
184 msgstr ""
185 "În loc să returneze un indicator la o structură I<servent> alocată static ca "
186 "rezultat al funcției, aceste funcții copiază structura în locația indicată "
187 "de I<result_buf>."
188
189 #. I can find no information on the required/recommended buffer size;
190 #. the nonreentrant functions use a 1024 byte buffer -- mtk.
191 #. type: Plain text
192 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
193 #: opensuse-leap-16-1 opensuse-tumbleweed
194 msgid ""
195 "The I<buf> array is used to store the string fields pointed to by the "
196 "returned I<servent> structure. (The nonreentrant functions allocate these "
197 "strings in static storage.) The size of this array is specified in "
198 "I<size>. If I<buf> is too small, the call fails with the error B<ERANGE>, "
199 "and the caller must try again with a larger buffer. (A buffer of size 1024 "
200 "bytes should be sufficient for most applications.)"
201 msgstr ""
202 "Matricea I<buf> este utilizată pentru a stoca câmpurile de șiruri de "
203 "caractere indicate de structura I<servent> returnată; (funcțiile "
204 "nereentrante alocă aceste șiruri de caractere în memoria statică). "
205 "Dimensiunea acestei matrice este specificată în I<size>. Dacă I<buf> este "
206 "prea mică, apelul eșuează cu eroarea B<ERANGE>, iar apelantul trebuie să "
207 "încerce din nou cu o memorie tampon mai mare; (un buffer cu o lungime de "
208 "1024 octeți ar trebui să fie suficient pentru majoritatea aplicațiilor)."
209
210 #. type: Plain text
211 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
212 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
213 msgid ""
214 "If the function call successfully obtains a service record, then I<*result> "
215 "is set pointing to I<result_buf>; otherwise, I<*result> is set to NULL."
216 msgstr ""
217 "Dacă apelul funcției obține cu succes o evidență a serviciului, atunci "
218 "I<*result> este stabilit la I<result_buf>; în caz contrar, I<*result> este "
219 "stabilit la NULL."
220
221 #. type: SH
222 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
223 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
224 #, no-wrap
225 msgid "RETURN VALUE"
226 msgstr "VALOAREA RETURNATĂ"
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 "On success, these functions return 0. On error, they return one of the "
233 "positive error numbers listed in errors."
234 msgstr ""
235 "În caz de succes, aceste funcții returnează 0. În caz de eroare, acestea "
236 "returnează unul dintre numerele pozitive de eroare enumerate în secțiunea "
237 "ERORI-IEȘIRE."
238
239 #. type: Plain text
240 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
241 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
242 msgid ""
243 "On error, record not found (B<getservbyname_r>(), B<getservbyport_r>()), or "
244 "end of input (B<getservent_r>()) I<result> is set to NULL."
245 msgstr ""
246 "În caz de eroare, înregistrare nedescoperită (B<getservbyname_r>(), "
247 "B<getservbyport_r>()) sau sfârșit de intrare (B<getservent_r>()), I<result> "
248 "este stabilit la NULL."
249
250 #. type: SH
251 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
252 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
253 #, no-wrap
254 msgid "ERRORS"
255 msgstr "ERORI-IEȘIRE"
256
257 #. type: TP
258 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
259 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
260 #, no-wrap
261 msgid "B<ENOENT>"
262 msgstr "B<ENOENT>"
263
264 #. type: Plain text
265 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
266 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
267 msgid "(B<getservent_r>()) No more records in database."
268 msgstr "(B<getservent_r>()) Nu mai există înregistrări în baza de date."
269
270 #. type: TP
271 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
272 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
273 #, no-wrap
274 msgid "B<ERANGE>"
275 msgstr "B<ERANGE>"
276
277 #. type: Plain text
278 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
279 #: opensuse-leap-16-1 opensuse-tumbleweed
280 msgid ""
281 "I<buf> is too small. Try again with a larger buffer (and increased I<size>)."
282 msgstr ""
283 "I<buf> este prea mic. Încercați din nou cu o memorie tampon mai mare (și cu "
284 "I<size> mărită)."
285
286 #. type: SH
287 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
288 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
289 #, no-wrap
290 msgid "ATTRIBUTES"
291 msgstr "ATRIBUTE"
292
293 #. type: Plain text
294 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
295 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
296 msgid ""
297 "For an explanation of the terms used in this section, see B<attributes>(7)."
298 msgstr ""
299 "Pentru o explicație a termenilor folosiți în această secțiune, a se vedea "
300 "B<attributes>(7)."
301
302 #. type: tbl table
303 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
304 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
305 #, no-wrap
306 msgid "Interface"
307 msgstr "Interfață"
308
309 #. type: tbl table
310 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
311 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
312 #, no-wrap
313 msgid "Attribute"
314 msgstr "Atribut"
315
316 #. type: tbl table
317 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
318 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
319 #, no-wrap
320 msgid "Value"
321 msgstr "Valoare"
322
323 #. type: tbl table
324 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
325 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
326 #, no-wrap
327 msgid ".na\n"
328 msgstr ".na\n"
329
330 #. type: tbl table
331 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
332 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
333 #, no-wrap
334 msgid ".nh\n"
335 msgstr ".nh\n"
336
337 #. type: tbl table
338 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
339 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
340 #, no-wrap
341 msgid ""
342 "B<getservent_r>(),\n"
343 "B<getservbyname_r>(),\n"
344 "B<getservbyport_r>()"
345 msgstr ""
346 "B<getservent_r>(),\n"
347 "B<getservbyname_r>(),\n"
348 "B<getservbyport_r>()"
349
350 #. type: tbl table
351 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
352 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
353 #, no-wrap
354 msgid "Thread safety"
355 msgstr "Siguranța firelor"
356
357 #. type: tbl table
358 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
359 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
360 #, no-wrap
361 msgid "MT-Safe locale"
362 msgstr "MT-Safe locale"
363
364 #. type: SH
365 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
366 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
367 #, no-wrap
368 msgid "VERSIONS"
369 msgstr "VERSIUNI"
370
371 #. type: Plain text
372 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
373 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
374 msgid ""
375 "Functions with similar names exist on some other systems, though typically "
376 "with different calling signatures."
377 msgstr ""
378 "Funcții cu nume similare există și pe alte sisteme, deși, de obicei, cu "
379 "semnături de apelare diferite."
380
381 #. type: SH
382 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
383 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
384 #, no-wrap
385 msgid "STANDARDS"
386 msgstr "STANDARDE"
387
388 #. type: Plain text
389 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
390 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
391 msgid "GNU."
392 msgstr "GNU."
393
394 #. type: SH
395 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
396 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
397 #, no-wrap
398 msgid "EXAMPLES"
399 msgstr "EXEMPLE"
400
401 #. type: Plain text
402 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
403 #: opensuse-leap-16-1 opensuse-tumbleweed
404 msgid ""
405 "The program below uses B<getservbyport_r>() to retrieve the service record "
406 "for the port and protocol named in its first command-line argument. If a "
407 "third (integer) command-line argument is supplied, it is used as the initial "
408 "value for I<size>; if B<getservbyport_r>() fails with the error B<ERANGE>, "
409 "the program retries with larger buffer sizes. The following shell session "
410 "shows a couple of sample runs:"
411 msgstr ""
412 "Programul de mai jos utilizează B<getservbyport_r>() pentru a prelua "
413 "înregistrarea serviciului pentru portul și protocolul menționate în primul "
414 "său argument de linie de comandă. În cazul în care se furnizează un al "
415 "treilea argument de linie de comandă (număr întreg), acesta este utilizat ca "
416 "valoare inițială pentru I<size>; dacă B<getservbyport_r>() eșuează cu "
417 "eroarea B<ERANGE>, programul încearcă din nou cu dimensiuni mai mari ale "
418 "memoriei tampon. Următoarea sesiune shell prezintă câteva exemple de "
419 "execuție:"
420
421 #. type: Plain text
422 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
423 #: opensuse-leap-16-1 opensuse-tumbleweed
424 #, no-wrap
425 msgid ""
426 "$B< ./a.out 7 tcp 1>\n"
427 "ERANGE! Retrying with larger buffer\n"
428 "getservbyport_r() returned: 0 (success) (size=87)\n"
429 "s_name=echo; s_proto=tcp; s_port=7; aliases=\n"
430 "$B< ./a.out 77777 tcp>\n"
431 "getservbyport_r() returned: 0 (success) (size=1024)\n"
432 "Call failed/record not found\n"
433 msgstr ""
434 "$B< ./a.out 7 tcp 1>\n"
435 "ERANGE! Se reîncearcă cu o memorie tampon mai mare\n"
436 "getservbyport_r() returned: 0 (success) (size=87)\n"
437 "s_name=echo; s_proto=tcp; s_port=7; aliases=\n"
438 "$B< ./a.out 77777 tcp>\n"
439 "getservbyport_r() returned: 0 (success) (size=1024)\n"
440 "Apel eșuat/înregistrarea nu a fost găsită\n"
441
442 #. type: SS
443 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
444 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
445 #, no-wrap
446 msgid "Program source"
447 msgstr "Sursa programului"
448
449 #. type: Plain text
450 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
451 #, no-wrap
452 msgid ""
453 "#define _GNU_SOURCE\n"
454 "#include E<lt>ctype.hE<gt>\n"
455 "#include E<lt>errno.hE<gt>\n"
456 "#include E<lt>netdb.hE<gt>\n"
457 "#include E<lt>stdio.hE<gt>\n"
458 "#include E<lt>stdlib.hE<gt>\n"
459 "#include E<lt>string.hE<gt>\n"
460 "\\&\n"
461 "#define MAX_BUF 10000\n"
462 "\\&\n"
463 "#define streq(...) (strcmp(__VA_ARGS__) == 0)\n"
464 "\\&\n"
465 "int\n"
466 "main(int argc, char *argv[])\n"
467 "{\n"
468 " int size, erange_cnt, port, s;\n"
469 " struct servent result_buf;\n"
470 " struct servent *result;\n"
471 " char buf[MAX_BUF];\n"
472 " char *protop;\n"
473 "\\&\n"
474 " if (argc E<lt> 3) {\n"
475 " printf(\"Usage: %s port-num proto-name [size]\\[rs]n\", argv[0]);\n"
476 " exit(EXIT_FAILURE);\n"
477 " }\n"
478 "\\&\n"
479 " port = htons(atoi(argv[1]));\n"
480 " protop = (streq(argv[2], \"null\") ||\n"
481 " streq(argv[2], \"NULL\")) ? NULL : argv[2];\n"
482 "\\&\n"
483 " size = 1024;\n"
484 " if (argc E<gt> 3)\n"
485 " size = atoi(argv[3]);\n"
486 "\\&\n"
487 " if (size E<gt> MAX_BUF) {\n"
488 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
489 " exit(EXIT_FAILURE);\n"
490 " }\n"
491 "\\&\n"
492 " erange_cnt = 0;\n"
493 " do {\n"
494 " s = getservbyport_r(port, protop, &result_buf,\n"
495 " buf, size, &result);\n"
496 " if (s == ERANGE) {\n"
497 " if (erange_cnt == 0)\n"
498 " printf(\"ERANGE! Retrying with larger buffer\\[rs]n\");\n"
499 " erange_cnt++;\n"
500 "\\&\n"
501 " /* Increment a byte at a time so we can see exactly\n"
502 " what size buffer was required. */\n"
503 "\\&\n"
504 " size++;\n"
505 "\\&\n"
506 " if (size E<gt> MAX_BUF) {\n"
507 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
508 " exit(EXIT_FAILURE);\n"
509 " }\n"
510 " }\n"
511 " } while (s == ERANGE);\n"
512 "\\&\n"
513 " printf(\"getservbyport_r() returned: %s (size=%d)\\[rs]n\",\n"
514 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
515 " strerror(s), size);\n"
516 "\\&\n"
517 " if (s != 0 || result == NULL) {\n"
518 " printf(\"Call failed/record not found\\[rs]n\");\n"
519 " exit(EXIT_FAILURE);\n"
520 " }\n"
521 "\\&\n"
522 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
523 " result_buf.s_name, result_buf.s_proto,\n"
524 " ntohs(result_buf.s_port));\n"
525 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
526 " printf(\"%s \", *p);\n"
527 " printf(\"\\[rs]n\");\n"
528 "\\&\n"
529 " exit(EXIT_SUCCESS);\n"
530 "}\n"
531 msgstr ""
532 "#define _GNU_SOURCE\n"
533 "#include E<lt>ctype.hE<gt>\n"
534 "#include E<lt>errno.hE<gt>\n"
535 "#include E<lt>netdb.hE<gt>\n"
536 "#include E<lt>stdio.hE<gt>\n"
537 "#include E<lt>stdlib.hE<gt>\n"
538 "#include E<lt>string.hE<gt>\n"
539 "\\&\n"
540 "#define MAX_BUF 10000\n"
541 "\n"
542 "\\&\n"
543 "#define streq(...) (strcmp(__VA_ARGS__) == 0)\n"
544 "\\&\n"
545 "int\n"
546 "main(int argc, char *argv[])\n"
547 "{\n"
548 " int size, erange_cnt, port, s;\n"
549 " struct servent result_buf;\n"
550 " struct servent *result;\n"
551 " char buf[MAX_BUF];\n"
552 " char *protop;\n"
553 "\\&\n"
554 " if (argc E<lt> 3) {\n"
555 " printf(\"Utilizare: %s port-num proto-name [size]\\[rs]n\", argv[0]);\n"
556 " exit(EXIT_FAILURE);\n"
557 " }\n"
558 "\\&\n"
559 " port = htons(atoi(argv[1]));\n"
560 " protop = (streq(argv[2], \"null\") ||\n"
561 " streq(argv[2], \"NULL\")) ? NULL : argv[2];\n"
562 "\\&\n"
563 " size = 1024;\n"
564 " if (argc E<gt> 3)\n"
565 " size = atoi(argv[3]);\n"
566 "\\&\n"
567 " if (size E<gt> MAX_BUF) {\n"
568 " printf(\"Limita memoriei tampon a fost depășită (%d)\\[rs]n\", MAX_BUF);\n"
569 " exit(EXIT_FAILURE);\n"
570 " }\n"
571 "\\&\n"
572 " erange_cnt = 0;\n"
573 " do {\n"
574 " s = getservbyport_r(port, protop, &result_buf,\n"
575 " buf, size, &result);\n"
576 " if (s == ERANGE) {\n"
577 " if (erange_cnt == 0)\n"
578 " printf(\"ERANGE! Se reîncearcă cu o memorie tampon mai mare\\[rs]n\");\n"
579 " erange_cnt++;\n"
580 "\\&\n"
581 " /* Incrementăm câte un octet pe rând ca să vedem exact\n"
582 " ce dimensiune a fost necesară pentru memoria tampon. */\n"
583 "\\&\n"
584 " size++;\n"
585 "\\&\n"
586 " if (size E<gt> MAX_BUF) {\n"
587 " printf(\"Limita memoriei tampon a fost depășită (%d)\\[rs]n\", MAX_BUF);\n"
588 " exit(EXIT_FAILURE);\n"
589 " }\n"
590 " }\n"
591 " } while (s == ERANGE);\n"
592 "\\&\n"
593 " printf(\"getservbyport_r() returned: %s (size=%d)\\[rs]n\",\n"
594 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
595 " strerror(s), size);\n"
596 "\\&\n"
597 " if (s != 0 || result == NULL) {\n"
598 " printf(\"Apel eșuat/înregistrarea nu a fost găsită\\[rs]n\");\n"
599 " exit(EXIT_FAILURE);\n"
600 " }\n"
601 "\\&\n"
602 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
603 " result_buf.s_name, result_buf.s_proto,\n"
604 " ntohs(result_buf.s_port));\n"
605 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
606 " printf(\"%s \", *p);\n"
607 " printf(\"\\[rs]n\");\n"
608 "\\&\n"
609 " exit(EXIT_SUCCESS);\n"
610 "}\n"
611
612 #. SRC END
613 #. type: SH
614 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
615 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
616 #, no-wrap
617 msgid "SEE ALSO"
618 msgstr "CONSULTAȚI ȘI"
619
620 #. type: Plain text
621 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
622 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
623 msgid "B<getservent>(3), B<services>(5)"
624 msgstr "B<getservent>(3), B<services>(5)"
625
626 #. type: TH
627 #: debian-trixie
628 #, no-wrap
629 msgid "2024-06-15"
630 msgstr "15 iunie 2024"
631
632 #. type: TH
633 #: debian-trixie
634 #, no-wrap
635 msgid "Linux man-pages 6.9.1"
636 msgstr "Pagini de manual de Linux 6.9.1"
637
638 #. type: Plain text
639 #: debian-trixie
640 msgid "Standard C library (I<libc>, I<-lc>)"
641 msgstr "Biblioteca C standard (I<libc>, I<-lc>)"
642
643 #. type: Plain text
644 #: debian-trixie
645 #, no-wrap
646 msgid ""
647 "B<int getservent_r(struct servent *restrict >I<result_buf>B<,>\n"
648 "B< char >I<buf>B<[restrict .>I<buflen>B<], size_t >I<buflen>B<,>\n"
649 "B< struct servent **restrict >I<result>B<);>\n"
650 "B<int getservbyname_r(const char *restrict >I<name>B<,>\n"
651 "B< const char *restrict >I<proto>B<,>\n"
652 "B< struct servent *restrict >I<result_buf>B<,>\n"
653 "B< char >I<buf>B<[restrict .>I<buflen>B<], size_t >I<buflen>B<,>\n"
654 "B< struct servent **restrict >I<result>B<);>\n"
655 "B<int getservbyport_r(int >I<port>B<,>\n"
656 "B< const char *restrict >I<proto>B<,>\n"
657 "B< struct servent *restrict >I<result_buf>B<,>\n"
658 "B< char >I<buf>B<[restrict .>I<buflen>B<], size_t >I<buflen>B<,>\n"
659 "B< struct servent **restrict >I<result>B<);>\n"
660 msgstr ""
661 "B<int getservent_r(struct servent *restrict >I<result_buf>B<,>\n"
662 "B< char >I<buf>B<[restrict .>I<buflen>B<], size_t >I<buflen>B<,>\n"
663 "B< struct servent **restrict >I<result>B<);>\n"
664 "B<int getservbyname_r(const char *restrict >I<name>B<,>\n"
665 "B< const char *restrict >I<proto>B<,>\n"
666 "B< struct servent *restrict >I<result_buf>B<,>\n"
667 "B< char >I<buf>B<[restrict .>I<buflen>B<], size_t >I<buflen>B<,>\n"
668 "B< struct servent **restrict >I<result>B<);>\n"
669 "B<int getservbyport_r(int >I<port>B<,>\n"
670 "B< const char *restrict >I<proto>B<,>\n"
671 "B< struct servent *restrict >I<result_buf>B<,>\n"
672 "B< char >I<buf>B<[restrict .>I<buflen>B<], size_t >I<buflen>B<,>\n"
673 "B< struct servent **restrict >I<result>B<);>\n"
674
675 #. I can find no information on the required/recommended buffer size;
676 #. the nonreentrant functions use a 1024 byte buffer -- mtk.
677 #. type: Plain text
678 #: debian-trixie
679 msgid ""
680 "The I<buf> array is used to store the string fields pointed to by the "
681 "returned I<servent> structure. (The nonreentrant functions allocate these "
682 "strings in static storage.) The size of this array is specified in "
683 "I<buflen>. If I<buf> is too small, the call fails with the error B<ERANGE>, "
684 "and the caller must try again with a larger buffer. (A buffer of length "
685 "1024 bytes should be sufficient for most applications.)"
686 msgstr ""
687 "Matricea I<buf> este utilizată pentru a stoca câmpurile de șiruri de "
688 "caractere indicate de structura I<servent> returnată; (funcțiile "
689 "nereturnante alocă aceste șiruri de caractere în memoria statică). "
690 "Dimensiunea acestei matrice este specificată în I<buflen>. Dacă I<buf> este "
691 "prea mică, apelul eșuează cu eroarea B<ERANGE>, iar apelantul trebuie să "
692 "încerce din nou cu o memorie tampon mai mare; (un buffer cu o lungime de "
693 "1024 octeți ar trebui să fie suficient pentru majoritatea aplicațiilor)."
694
695 #. type: Plain text
696 #: debian-trixie
697 msgid ""
698 "I<buf> is too small. Try again with a larger buffer (and increased "
699 "I<buflen>)."
700 msgstr ""
701 "I<buf> este prea mic. Încercați din nou cu o memorie tampon mai mare (și cu "
702 "I<buflen> mărit)."
703
704 #. type: Plain text
705 #: debian-trixie
706 msgid ""
707 "The program below uses B<getservbyport_r>() to retrieve the service record "
708 "for the port and protocol named in its first command-line argument. If a "
709 "third (integer) command-line argument is supplied, it is used as the initial "
710 "value for I<buflen>; if B<getservbyport_r>() fails with the error "
711 "B<ERANGE>, the program retries with larger buffer sizes. The following "
712 "shell session shows a couple of sample runs:"
713 msgstr ""
714 "Programul de mai jos utilizează B<getservbyport_r>() pentru a prelua "
715 "înregistrarea serviciului pentru portul și protocolul menționate în primul "
716 "său argument de linie de comandă. În cazul în care se furnizează un al "
717 "treilea argument de linie de comandă (număr întreg), acesta este utilizat ca "
718 "valoare inițială pentru I<buflen>; dacă B<getservbyport_r>() eșuează cu "
719 "eroarea B<ERANGE>, programul încearcă din nou cu dimensiuni mai mari ale "
720 "memoriei tampon. Următoarea sesiune shell prezintă câteva exemple de "
721 "execuție:"
722
723 #. type: Plain text
724 #: debian-trixie
725 #, no-wrap
726 msgid ""
727 "$B< ./a.out 7 tcp 1>\n"
728 "ERANGE! Retrying with larger buffer\n"
729 "getservbyport_r() returned: 0 (success) (buflen=87)\n"
730 "s_name=echo; s_proto=tcp; s_port=7; aliases=\n"
731 "$B< ./a.out 77777 tcp>\n"
732 "getservbyport_r() returned: 0 (success) (buflen=1024)\n"
733 "Call failed/record not found\n"
734 msgstr ""
735 "$B< ./a.out 7 tcp 1>\n"
736 "ERANGE! Se reîncearcă cu o memorie tampon mai mare\n"
737 "getservbyport_r() returned: 0 (success) (buflen=87)\n"
738 "s_name=echo; s_proto=tcp; s_port=7; aliases=\n"
739 "$B< ./a.out 77777 tcp>\n"
740 "getservbyport_r() returned: 0 (success) (buflen=1024)\n"
741 "Apel eșuat/înregistrarea nu a fost găsită\n"
742
743 #. type: Plain text
744 #: debian-trixie
745 #, no-wrap
746 msgid ""
747 "#define _GNU_SOURCE\n"
748 "#include E<lt>ctype.hE<gt>\n"
749 "#include E<lt>errno.hE<gt>\n"
750 "#include E<lt>netdb.hE<gt>\n"
751 "#include E<lt>stdio.hE<gt>\n"
752 "#include E<lt>stdlib.hE<gt>\n"
753 "#include E<lt>string.hE<gt>\n"
754 "\\&\n"
755 "#define MAX_BUF 10000\n"
756 "\\&\n"
757 "int\n"
758 "main(int argc, char *argv[])\n"
759 "{\n"
760 " int buflen, erange_cnt, port, s;\n"
761 " struct servent result_buf;\n"
762 " struct servent *result;\n"
763 " char buf[MAX_BUF];\n"
764 " char *protop;\n"
765 "\\&\n"
766 " if (argc E<lt> 3) {\n"
767 " printf(\"Usage: %s port-num proto-name [buflen]\\[rs]n\", argv[0]);\n"
768 " exit(EXIT_FAILURE);\n"
769 " }\n"
770 "\\&\n"
771 " port = htons(atoi(argv[1]));\n"
772 " protop = (strcmp(argv[2], \"null\") == 0 ||\n"
773 " strcmp(argv[2], \"NULL\") == 0) ? NULL : argv[2];\n"
774 "\\&\n"
775 " buflen = 1024;\n"
776 " if (argc E<gt> 3)\n"
777 " buflen = atoi(argv[3]);\n"
778 "\\&\n"
779 " if (buflen E<gt> MAX_BUF) {\n"
780 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
781 " exit(EXIT_FAILURE);\n"
782 " }\n"
783 "\\&\n"
784 " erange_cnt = 0;\n"
785 " do {\n"
786 " s = getservbyport_r(port, protop, &result_buf,\n"
787 " buf, buflen, &result);\n"
788 " if (s == ERANGE) {\n"
789 " if (erange_cnt == 0)\n"
790 " printf(\"ERANGE! Retrying with larger buffer\\[rs]n\");\n"
791 " erange_cnt++;\n"
792 "\\&\n"
793 " /* Increment a byte at a time so we can see exactly\n"
794 " what size buffer was required. */\n"
795 "\\&\n"
796 " buflen++;\n"
797 "\\&\n"
798 " if (buflen E<gt> MAX_BUF) {\n"
799 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
800 " exit(EXIT_FAILURE);\n"
801 " }\n"
802 " }\n"
803 " } while (s == ERANGE);\n"
804 "\\&\n"
805 " printf(\"getservbyport_r() returned: %s (buflen=%d)\\[rs]n\",\n"
806 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
807 " strerror(s), buflen);\n"
808 "\\&\n"
809 " if (s != 0 || result == NULL) {\n"
810 " printf(\"Call failed/record not found\\[rs]n\");\n"
811 " exit(EXIT_FAILURE);\n"
812 " }\n"
813 "\\&\n"
814 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
815 " result_buf.s_name, result_buf.s_proto,\n"
816 " ntohs(result_buf.s_port));\n"
817 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
818 " printf(\"%s \", *p);\n"
819 " printf(\"\\[rs]n\");\n"
820 "\\&\n"
821 " exit(EXIT_SUCCESS);\n"
822 "}\n"
823 msgstr ""
824 "#define _GNU_SOURCE\n"
825 "#include E<lt>ctype.hE<gt>\n"
826 "#include E<lt>errno.hE<gt>\n"
827 "#include E<lt>netdb.hE<gt>\n"
828 "#include E<lt>stdio.hE<gt>\n"
829 "#include E<lt>stdlib.hE<gt>\n"
830 "#include E<lt>string.hE<gt>\n"
831 "\\&\n"
832 "#define MAX_BUF 10000\n"
833 "\\&\n"
834 "int\n"
835 "main(int argc, char *argv[])\n"
836 "{\n"
837 " int buflen, erange_cnt, port, s;\n"
838 " struct servent result_buf;\n"
839 " struct servent *result;\n"
840 " char buf[MAX_BUF];\n"
841 " char *protop;\n"
842 "\\&\n"
843 " if (argc E<lt> 3) {\n"
844 " printf(\"Utilizare: %s port-num proto-name [buflen]\\[rs]n\", argv[0]);\n"
845 " exit(EXIT_FAILURE);\n"
846 " }\n"
847 "\\&\n"
848 " port = htons(atoi(argv[1]));\n"
849 " protop = (strcmp(argv[2], \"null\") == 0 ||\n"
850 " strcmp(argv[2], \"NULL\") == 0) ? NULL : argv[2];\n"
851 "\\&\n"
852 " buflen = 1024;\n"
853 " if (argc E<gt> 3)\n"
854 " buflen = atoi(argv[3]);\n"
855 "\\&\n"
856 " if (buflen E<gt> MAX_BUF) {\n"
857 " printf(\"Limita memoriei tampon a fost depășită (%d)\\[rs]n\", MAX_BUF);\n"
858 " exit(EXIT_FAILURE);\n"
859 " }\n"
860 "\\&\n"
861 " erange_cnt = 0;\n"
862 " do {\n"
863 " s = getservbyport_r(port, protop, &result_buf,\n"
864 " buf, buflen, &result);\n"
865 " if (s == ERANGE) {\n"
866 " if (erange_cnt == 0)\n"
867 " printf(\"ERANGE! Se reîncearcă cu o memorie tampon mai mare\\[rs]n\");\n"
868 " erange_cnt++;\n"
869 "\\&\n"
870 " /* Incrementăm câte un octet pe rând ca să vedem exact\n"
871 " ce dimensiune a fost necesară pentru memoria tampon. */\n"
872 "\\&\n"
873 " buflen++;\n"
874 "\\&\n"
875 " if (buflen E<gt> MAX_BUF) {\n"
876 " printf(\"Limita memoriei tampon a fost depășită (%d)\\[rs]n\", MAX_BUF);\n"
877 " exit(EXIT_FAILURE);\n"
878 " }\n"
879 " }\n"
880 " } while (s == ERANGE);\n"
881 "\\&\n"
882 " printf(\"getservbyport_r() returned: %s (buflen=%d)\\[rs]n\",\n"
883 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
884 " strerror(s), buflen);\n"
885 "\\&\n"
886 " if (s != 0 || result == NULL) {\n"
887 " printf(\"Apel eșuat/înregistrarea nu a fost găsită\\[rs]n\");\n"
888 " exit(EXIT_FAILURE);\n"
889 " }\n"
890 "\\&\n"
891 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
892 " result_buf.s_name, result_buf.s_proto,\n"
893 " ntohs(result_buf.s_port));\n"
894 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
895 " printf(\"%s \", *p);\n"
896 " printf(\"\\[rs]n\");\n"
897 "\\&\n"
898 " exit(EXIT_SUCCESS);\n"
899 "}\n"
900
901 #. type: TH
902 #: fedora-44 fedora-rawhide
903 #, no-wrap
904 msgid "2024-12-24"
905 msgstr "24 decembrie 2024"
906
907 #. type: TH
908 #: fedora-44 fedora-rawhide
909 #, no-wrap
910 msgid "Linux man-pages 6.13"
911 msgstr "Pagini de manual de Linux 6.13"
912
913 #. type: Plain text
914 #: fedora-44 fedora-rawhide
915 #, no-wrap
916 msgid ""
917 "B<int getservent_r(struct servent *restrict >I<result_buf>B<,>\n"
918 "B< char >I<buf>B<[restrict .>I<size>B<], size_t >I<size>B<,>\n"
919 "B< struct servent **restrict >I<result>B<);>\n"
920 "B<int getservbyname_r(const char *restrict >I<name>B<,>\n"
921 "B< const char *restrict >I<proto>B<,>\n"
922 "B< struct servent *restrict >I<result_buf>B<,>\n"
923 "B< char >I<buf>B<[restrict .>I<size>B<], size_t >I<size>B<,>\n"
924 "B< struct servent **restrict >I<result>B<);>\n"
925 "B<int getservbyport_r(int >I<port>B<,>\n"
926 "B< const char *restrict >I<proto>B<,>\n"
927 "B< struct servent *restrict >I<result_buf>B<,>\n"
928 "B< char >I<buf>B<[restrict .>I<size>B<], size_t >I<size>B<,>\n"
929 "B< struct servent **restrict >I<result>B<);>\n"
930 msgstr ""
931 "B<int getservent_r(struct servent *restrict >I<result_buf>B<,>\n"
932 "B< char >I<buf>B<[restrict .>I<size>B<], size_t >I<size>B<,>\n"
933 "B< struct servent **restrict >I<result>B<);>\n"
934 "B<int getservbyname_r(const char *restrict >I<name>B<,>\n"
935 "B< const char *restrict >I<proto>B<,>\n"
936 "B< struct servent *restrict >I<result_buf>B<,>\n"
937 "B< char >I<buf>B<[restrict .>I<size>B<], size_t >I<size>B<,>\n"
938 "B< struct servent **restrict >I<result>B<);>\n"
939 "B<int getservbyport_r(int >I<port>B<,>\n"
940 "B< const char *restrict >I<proto>B<,>\n"
941 "B< struct servent *restrict >I<result_buf>B<,>\n"
942 "B< char >I<buf>B<[restrict .>I<size>B<], size_t >I<size>B<,>\n"
943 "B< struct servent **restrict >I<result>B<);>\n"
944
945 #. type: Plain text
946 #: fedora-44 fedora-rawhide
947 #, no-wrap
948 msgid ""
949 "#define _GNU_SOURCE\n"
950 "#include E<lt>ctype.hE<gt>\n"
951 "#include E<lt>errno.hE<gt>\n"
952 "#include E<lt>netdb.hE<gt>\n"
953 "#include E<lt>stdio.hE<gt>\n"
954 "#include E<lt>stdlib.hE<gt>\n"
955 "#include E<lt>string.hE<gt>\n"
956 "\\&\n"
957 "#define MAX_BUF 10000\n"
958 "\\&\n"
959 "int\n"
960 "main(int argc, char *argv[])\n"
961 "{\n"
962 " int size, erange_cnt, port, s;\n"
963 " struct servent result_buf;\n"
964 " struct servent *result;\n"
965 " char buf[MAX_BUF];\n"
966 " char *protop;\n"
967 "\\&\n"
968 " if (argc E<lt> 3) {\n"
969 " printf(\"Usage: %s port-num proto-name [size]\\[rs]n\", argv[0]);\n"
970 " exit(EXIT_FAILURE);\n"
971 " }\n"
972 "\\&\n"
973 " port = htons(atoi(argv[1]));\n"
974 " protop = (strcmp(argv[2], \"null\") == 0 ||\n"
975 " strcmp(argv[2], \"NULL\") == 0) ? NULL : argv[2];\n"
976 "\\&\n"
977 " size = 1024;\n"
978 " if (argc E<gt> 3)\n"
979 " size = atoi(argv[3]);\n"
980 "\\&\n"
981 " if (size E<gt> MAX_BUF) {\n"
982 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
983 " exit(EXIT_FAILURE);\n"
984 " }\n"
985 "\\&\n"
986 " erange_cnt = 0;\n"
987 " do {\n"
988 " s = getservbyport_r(port, protop, &result_buf,\n"
989 " buf, size, &result);\n"
990 " if (s == ERANGE) {\n"
991 " if (erange_cnt == 0)\n"
992 " printf(\"ERANGE! Retrying with larger buffer\\[rs]n\");\n"
993 " erange_cnt++;\n"
994 "\\&\n"
995 " /* Increment a byte at a time so we can see exactly\n"
996 " what size buffer was required. */\n"
997 "\\&\n"
998 " size++;\n"
999 "\\&\n"
1000 " if (size E<gt> MAX_BUF) {\n"
1001 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
1002 " exit(EXIT_FAILURE);\n"
1003 " }\n"
1004 " }\n"
1005 " } while (s == ERANGE);\n"
1006 "\\&\n"
1007 " printf(\"getservbyport_r() returned: %s (size=%d)\\[rs]n\",\n"
1008 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
1009 " strerror(s), size);\n"
1010 "\\&\n"
1011 " if (s != 0 || result == NULL) {\n"
1012 " printf(\"Call failed/record not found\\[rs]n\");\n"
1013 " exit(EXIT_FAILURE);\n"
1014 " }\n"
1015 "\\&\n"
1016 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
1017 " result_buf.s_name, result_buf.s_proto,\n"
1018 " ntohs(result_buf.s_port));\n"
1019 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
1020 " printf(\"%s \", *p);\n"
1021 " printf(\"\\[rs]n\");\n"
1022 "\\&\n"
1023 " exit(EXIT_SUCCESS);\n"
1024 "}\n"
1025 msgstr ""
1026 "#define _GNU_SOURCE\n"
1027 "#include E<lt>ctype.hE<gt>\n"
1028 "#include E<lt>errno.hE<gt>\n"
1029 "#include E<lt>netdb.hE<gt>\n"
1030 "#include E<lt>stdio.hE<gt>\n"
1031 "#include E<lt>stdlib.hE<gt>\n"
1032 "#include E<lt>string.hE<gt>\n"
1033 "\\&\n"
1034 "#define MAX_BUF 10000\n"
1035 "\\&\n"
1036 "int\n"
1037 "main(int argc, char *argv[])\n"
1038 "{\n"
1039 " int size, erange_cnt, port, s;\n"
1040 " struct servent result_buf;\n"
1041 " struct servent *result;\n"
1042 " char buf[MAX_BUF];\n"
1043 " char *protop;\n"
1044 "\\&\n"
1045 " if (argc E<lt> 3) {\n"
1046 " printf(\"Utilizare: %s port-num proto-name [size]\\[rs]n\", argv[0]);\n"
1047 " exit(EXIT_FAILURE);\n"
1048 " }\n"
1049 "\\&\n"
1050 " port = htons(atoi(argv[1]));\n"
1051 " protop = (strcmp(argv[2], \"null\") == 0 ||\n"
1052 " strcmp(argv[2], \"NULL\") == 0) ? NULL : argv[2];\n"
1053 "\\&\n"
1054 " size = 1024;\n"
1055 " if (argc E<gt> 3)\n"
1056 " size = atoi(argv[3]);\n"
1057 "\\&\n"
1058 " if (size E<gt> MAX_BUF) {\n"
1059 " printf(\"Limita memoriei tampon a fost depășită (%d)\\[rs]n\", MAX_BUF);\n"
1060 " exit(EXIT_FAILURE);\n"
1061 " }\n"
1062 "\\&\n"
1063 " erange_cnt = 0;\n"
1064 " do {\n"
1065 " s = getservbyport_r(port, protop, &result_buf,\n"
1066 " buf, size, &result);\n"
1067 " if (s == ERANGE) {\n"
1068 " if (erange_cnt == 0)\n"
1069 " printf(\"ERANGE! Se reîncearcă cu o memorie tampon mai mare\\[rs]n\");\n"
1070 " erange_cnt++;\n"
1071 "\\&\n"
1072 " /* Incrementăm câte un octet pe rând ca să vedem exact\n"
1073 " ce dimensiune a fost necesară pentru memoria tampon. */\n"
1074 "\\&\n"
1075 " size++;\n"
1076 "\\&\n"
1077 " if (size E<gt> MAX_BUF) {\n"
1078 " printf(\"Limita memoriei tampon a fost depășită (%d)\\[rs]n\", MAX_BUF);\n"
1079 " exit(EXIT_FAILURE);\n"
1080 " }\n"
1081 " }\n"
1082 " } while (s == ERANGE);\n"
1083 "\\&\n"
1084 " printf(\"getservbyport_r() returned: %s (size=%d)\\[rs]n\",\n"
1085 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
1086 " strerror(s), size);\n"
1087 "\\&\n"
1088 " if (s != 0 || result == NULL) {\n"
1089 " printf(\"Apel eșuat/înregistrarea nu a fost găsită\\[rs]n\");\n"
1090 " exit(EXIT_FAILURE);\n"
1091 " }\n"
1092 "\\&\n"
1093 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
1094 " result_buf.s_name, result_buf.s_proto,\n"
1095 " ntohs(result_buf.s_port));\n"
1096 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
1097 " printf(\"%s \", *p);\n"
1098 " printf(\"\\[rs]n\");\n"
1099 "\\&\n"
1100 " exit(EXIT_SUCCESS);\n"
1101 "}\n"
1102
1103 #. type: TH
1104 #: mageia-cauldron
1105 #, no-wrap
1106 msgid "2025-09-21"
1107 msgstr "21 septembrie 2025"
1108
1109 #. type: TH
1110 #: mageia-cauldron
1111 #, no-wrap
1112 msgid "Linux man-pages 6.17"
1113 msgstr "Pagini de manual de Linux 6.17"
1114
1115 #. type: Plain text
1116 #: mageia-cauldron
1117 #, no-wrap
1118 msgid ""
1119 "#define _GNU_SOURCE\n"
1120 "#include E<lt>ctype.hE<gt>\n"
1121 "#include E<lt>errno.hE<gt>\n"
1122 "#include E<lt>netdb.hE<gt>\n"
1123 "#include E<lt>stdio.hE<gt>\n"
1124 "#include E<lt>stdlib.hE<gt>\n"
1125 "#include E<lt>string.hE<gt>\n"
1126 "\\&\n"
1127 "#define MAX_BUF 10000\n"
1128 "\\&\n"
1129 "int\n"
1130 "main(int argc, char *argv[])\n"
1131 "{\n"
1132 " int size, erange_cnt, port, s;\n"
1133 " struct servent result_buf;\n"
1134 " struct servent *result;\n"
1135 " char buf[MAX_BUF];\n"
1136 " char *protop;\n"
1137 "\\&\n"
1138 " if (argc E<lt> 3) {\n"
1139 " printf(\"Usage: %s port-num proto-name [size]\\[rs]n\", argv[0]);\n"
1140 " exit(EXIT_FAILURE);\n"
1141 " }\n"
1142 "\\&\n"
1143 " port = htons(atoi(argv[1]));\n"
1144 " protop = (strcmp(argv[2], \"null\") == 0 ||\n"
1145 " strcmp(argv[2], \"NULL\") == 0) ? NULL : argv[2];\n"
1146 "\\&\n"
1147 " size = 1024;\n"
1148 " if (argc E<gt> 3)\n"
1149 " size = atoi(argv[3]);\n"
1150 "\\&\n"
1151 " if (size E<gt> MAX_BUF) {\n"
1152 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
1153 " exit(EXIT_FAILURE);\n"
1154 " }\n"
1155 "\\&\n"
1156 " erange_cnt = 0;\n"
1157 " do {\n"
1158 " s = getservbyport_r(port, protop, &result_buf,\n"
1159 " buf, size, &result);\n"
1160 " if (s == ERANGE) {\n"
1161 " if (erange_cnt == 0)\n"
1162 " printf(\"ERANGE! Retrying with larger buffer\\[rs]n\");\n"
1163 " erange_cnt++;\n"
1164 "\\&\n"
1165 " /* Increment a byte at a time so we can see exactly\n"
1166 " what size buffer was required. */\n"
1167 "\\&\n"
1168 " size++;\n"
1169 "\\&\n"
1170 " if (size E<gt> MAX_BUF) {\n"
1171 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
1172 " exit(EXIT_FAILURE);\n"
1173 " }\n"
1174 " }\n"
1175 " } while (s == ERANGE);\n"
1176 "\\&\n"
1177 " printf(\"getservbyport_r() returned: %s (size=%d)\\[rs]n\",\n"
1178 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
1179 " strerror(s), size);\n"
1180 "\\&\n"
1181 " if (s != 0 || result == NULL) {\n"
1182 " printf(\"Call failed/record not found\\[rs]n\");\n"
1183 " exit(EXIT_FAILURE);\n"
1184 " }\n"
1185 "\\&\n"
1186 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
1187 " result_buf.s_name, result_buf.s_proto,\n"
1188 " ntohs(result_buf.s_port));\n"
1189 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
1190 " printf(\"%s \", *p);\n"
1191 " printf(\"\\[rs]n\");\n"
1192 "\\&\n"
1193 " exit(EXIT_SUCCESS);\n"
1194 "}\n"
1195 msgstr ""
1196 "#define _GNU_SOURCE\n"
1197 "#include E<lt>ctype.hE<gt>\n"
1198 "#include E<lt>errno.hE<gt>\n"
1199 "#include E<lt>netdb.hE<gt>\n"
1200 "#include E<lt>stdio.hE<gt>\n"
1201 "#include E<lt>stdlib.hE<gt>\n"
1202 "#include E<lt>string.hE<gt>\n"
1203 "\\&\n"
1204 "#define MAX_BUF 10000\n"
1205 "\\&\n"
1206 "int\n"
1207 "main(int argc, char *argv[])\n"
1208 "{\n"
1209 " int size, erange_cnt, port, s;\n"
1210 " struct servent result_buf;\n"
1211 " struct servent *result;\n"
1212 " char buf[MAX_BUF];\n"
1213 " char *protop;\n"
1214 "\\&\n"
1215 " if (argc E<lt> 3) {\n"
1216 " printf(\"Utilizare: %s port-num proto-name [size]\\[rs]n\", argv[0]);\n"
1217 " exit(EXIT_FAILURE);\n"
1218 " }\n"
1219 "\\&\n"
1220 " port = htons(atoi(argv[1]));\n"
1221 " protop = (strcmp(argv[2], \"null\") == 0 ||\n"
1222 " strcmp(argv[2], \"NULL\") == 0) ? NULL : argv[2];\n"
1223 "\\&\n"
1224 " size = 1024;\n"
1225 " if (argc E<gt> 3)\n"
1226 " size = atoi(argv[3]);\n"
1227 "\\&\n"
1228 " if (size E<gt> MAX_BUF) {\n"
1229 " printf(\"Limita memoriei tampon a fost depășită (%d)\\[rs]n\", MAX_BUF);\n"
1230 " exit(EXIT_FAILURE);\n"
1231 " }\n"
1232 "\\&\n"
1233 " erange_cnt = 0;\n"
1234 " do {\n"
1235 " s = getservbyport_r(port, protop, &result_buf,\n"
1236 " buf, size, &result);\n"
1237 " if (s == ERANGE) {\n"
1238 " if (erange_cnt == 0)\n"
1239 " printf(\"ERANGE! Se reîncearcă cu o memorie tampon mai mare\\[rs]n\");\n"
1240 " erange_cnt++;\n"
1241 "\\&\n"
1242 " /* Incrementăm câte un octet pe rând ca să vedem exact\n"
1243 " ce dimensiune a fost necesară pentru memoria tampon. */\n"
1244 "\\&\n"
1245 " size++;\n"
1246 "\\&\n"
1247 " if (size E<gt> MAX_BUF) {\n"
1248 " printf(\"Limita memoriei tampon a fost depășită (%d)\\[rs]n\", MAX_BUF);\n"
1249 " exit(EXIT_FAILURE);\n"
1250 " }\n"
1251 " }\n"
1252 " } while (s == ERANGE);\n"
1253 "\\&\n"
1254 " printf(\"getservbyport_r() returned: %s (size=%d)\\[rs]n\",\n"
1255 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
1256 " strerror(s), size);\n"
1257 "\\&\n"
1258 " if (s != 0 || result == NULL) {\n"
1259 " printf(\"Apel eșuat/înregistrarea nu a fost găsită\\[rs]n\");\n"
1260 " exit(EXIT_FAILURE);\n"
1261 " }\n"
1262 "\\&\n"
1263 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
1264 " result_buf.s_name, result_buf.s_proto,\n"
1265 " ntohs(result_buf.s_port));\n"
1266 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
1267 " printf(\"%s \", *p);\n"
1268 " printf(\"\\[rs]n\");\n"
1269 "\\&\n"
1270 " exit(EXIT_SUCCESS);\n"
1271 "}\n"
1272
1273 #. type: TH
1274 #: opensuse-leap-16-1 opensuse-tumbleweed
1275 #, no-wrap
1276 msgid "Linux man-pages (unreleased)"
1277 msgstr "Pagini de manual Linux (nepublicate)"