Debian Codegraph @

po/ro/man3/getgrouplist.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.
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: manpages-l10n 4.21.0\n"
8 "POT-Creation-Date: 2026-06-05 06:25+0200\n"
9 "PO-Revision-Date: 2025-11-05 12:53+0100\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.6\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 "getgrouplist"
25 msgstr "getgrouplist"
26
27 #. type: TH
28 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
29 #: opensuse-tumbleweed
30 #, no-wrap
31 msgid "2025-09-21"
32 msgstr "21 septembrie 2025"
33
34 #. type: TH
35 #: archlinux debian-unstable
36 #, no-wrap
37 msgid "Linux man-pages 6.18"
38 msgstr "Pagini de manual de Linux 6.18"
39
40 #. type: SH
41 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
42 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
43 #, no-wrap
44 msgid "NAME"
45 msgstr "NUME"
46
47 #. type: Plain text
48 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
49 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
50 msgid "getgrouplist - get list of groups to which a user belongs"
51 msgstr ""
52 "getgrouplist - obține lista de grupuri din care face parte un utilizator"
53
54 #. type: SH
55 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
56 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
57 #, no-wrap
58 msgid "LIBRARY"
59 msgstr "BIBLIOTECA"
60
61 #. type: Plain text
62 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
63 #: opensuse-leap-16-1 opensuse-tumbleweed
64 msgid "Standard C library (I<libc>,\\ I<-lc>)"
65 msgstr "Biblioteca C standard (I<libc>, I<-lc>)"
66
67 #. type: SH
68 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
69 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
70 #, no-wrap
71 msgid "SYNOPSIS"
72 msgstr "SINOPSIS"
73
74 #. type: Plain text
75 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
76 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
77 #, no-wrap
78 msgid "B<#include E<lt>grp.hE<gt>>\n"
79 msgstr "B<#include E<lt>grp.hE<gt>>\n"
80
81 #. type: Plain text
82 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
83 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
84 #, no-wrap
85 msgid ""
86 "B<int getgrouplist(const char *>I<user>B<, gid_t >I<group>B<,>\n"
87 "B< gid_t *>I<groups>B<, int *>I<ngroups>B<);>\n"
88 msgstr ""
89 "B<int getgrouplist(const char *>I<user>B<, gid_t >I<group>B<,>\n"
90 "B< gid_t *>I<groups>B<, int *>I<ngroups>B<);>\n"
91
92 #. type: Plain text
93 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
94 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
95 msgid ""
96 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
97 msgstr ""
98 "Cerințe pentru macrocomenzi de testare a caracteristicilor pentru glibc "
99 "(consultați B<feature_test_macros>(7)):"
100
101 #. type: Plain text
102 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
103 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
104 msgid "B<getgrouplist>():"
105 msgstr "B<getgrouplist>():"
106
107 #. type: Plain text
108 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
109 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
110 #, no-wrap
111 msgid ""
112 " Since glibc 2.19:\n"
113 " _DEFAULT_SOURCE\n"
114 " glibc 2.19 and earlier:\n"
115 " _BSD_SOURCE\n"
116 msgstr ""
117 " Începând cu glibc 2.19:\n"
118 " _DEFAULT_SOURCE\n"
119 " glibc 2.19 și versiunile anterioare:\n"
120 " _BSD_SOURCE\n"
121
122 #. type: SH
123 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
124 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
125 #, no-wrap
126 msgid "DESCRIPTION"
127 msgstr "DESCRIERE"
128
129 #. type: Plain text
130 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
131 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
132 msgid ""
133 "The B<getgrouplist>() function scans the group database (see B<group>(5)) "
134 "to obtain the list of groups that I<user> belongs to. Up to I<*ngroups> of "
135 "these groups are returned in the array I<groups>."
136 msgstr ""
137 "Funcția B<getgrouplist>() analizează baza de date a grupurilor (a se vedea "
138 "B<group>(5)) pentru a obține lista grupurilor din care face parte I<user>. "
139 "Până la I<*ngroups> din aceste grupuri sunt returnate în matricea I<groups>."
140
141 #. type: Plain text
142 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
143 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
144 msgid ""
145 "If it was not among the groups defined for I<user> in the group database, "
146 "then I<group> is included in the list of groups returned by "
147 "B<getgrouplist>(); typically this argument is specified as the group ID from "
148 "the password record for I<user>."
149 msgstr ""
150 "Dacă nu se află printre grupurile definite pentru I<user> în baza de date a "
151 "grupurilor, atunci I<group> este inclus în lista de grupuri returnată de "
152 "B<getgrouplist>(); de obicei, acest argument este specificat ca fiind ID-ul "
153 "grupului din înregistrarea parolei pentru I<user>."
154
155 #. type: Plain text
156 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
157 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
158 msgid ""
159 "The I<ngroups> argument is a value-result argument: on return it always "
160 "contains the number of groups found for I<user>, including I<group>; this "
161 "value may be greater than the number of groups stored in I<groups>."
162 msgstr ""
163 "Argumentul I<ngroups> este un argument valoare-rezultat: la returnare "
164 "conține întotdeauna numărul de grupuri găsite pentru I<user>, inclusiv "
165 "I<group>; această valoare poate fi mai mare decât numărul de grupuri stocate "
166 "în I<groups>."
167
168 #. type: SH
169 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
170 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
171 #, no-wrap
172 msgid "RETURN VALUE"
173 msgstr "VALOAREA RETURNATĂ"
174
175 #. type: Plain text
176 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
177 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
178 msgid ""
179 "If the number of groups of which I<user> is a member is less than or equal "
180 "to I<*ngroups>, then the value I<*ngroups> is returned."
181 msgstr ""
182 "Dacă numărul de grupuri din care face parte I<user> este mai mic sau egal cu "
183 "I<*ngroups>, atunci se returnează valoarea I<*ngroups>."
184
185 #. type: Plain text
186 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
187 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
188 msgid ""
189 "If the user is a member of more than I<*ngroups> groups, then "
190 "B<getgrouplist>() returns -1. In this case, the value returned in "
191 "I<*ngroups> can be used to resize the buffer passed to a further call to "
192 "B<getgrouplist>()."
193 msgstr ""
194 "Dacă utilizatorul este membru a mai mult de I<*ngroups> grupuri, atunci "
195 "B<getgrouplist>() returnează -1. În acest caz, valoarea returnată în "
196 "I<*ngroups> poate fi utilizată pentru a redimensiona memoria tampon pasată "
197 "la un apel ulterior la B<getgrouplist>()."
198
199 #. type: SH
200 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
201 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
202 #, no-wrap
203 msgid "ATTRIBUTES"
204 msgstr "ATRIBUTE"
205
206 #. type: Plain text
207 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
208 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
209 msgid ""
210 "For an explanation of the terms used in this section, see B<attributes>(7)."
211 msgstr ""
212 "Pentru o explicație a termenilor folosiți în această secțiune, a se vedea "
213 "B<attributes>(7)."
214
215 #. type: tbl table
216 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
217 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
218 #, no-wrap
219 msgid "Interface"
220 msgstr "Interfață"
221
222 #. type: tbl table
223 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
224 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
225 #, no-wrap
226 msgid "Attribute"
227 msgstr "Atribut"
228
229 #. type: tbl table
230 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
231 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
232 #, no-wrap
233 msgid "Value"
234 msgstr "Valoare"
235
236 #. type: tbl table
237 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
238 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
239 #, no-wrap
240 msgid ".na\n"
241 msgstr ".na\n"
242
243 #. type: tbl table
244 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
245 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
246 #, no-wrap
247 msgid ".nh\n"
248 msgstr ".nh\n"
249
250 #. type: tbl table
251 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
252 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
253 #, no-wrap
254 msgid "B<getgrouplist>()"
255 msgstr "B<getgrouplist>()"
256
257 #. type: tbl table
258 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
259 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
260 #, no-wrap
261 msgid "Thread safety"
262 msgstr "Siguranța firelor"
263
264 #. type: tbl table
265 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
266 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
267 #, no-wrap
268 msgid "MT-Safe locale"
269 msgstr "MT-Safe locale"
270
271 #. type: SH
272 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
273 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
274 #, no-wrap
275 msgid "STANDARDS"
276 msgstr "STANDARDE"
277
278 #. type: Plain text
279 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
280 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
281 msgid "None."
282 msgstr "Niciunul."
283
284 #. type: SH
285 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
286 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
287 #, no-wrap
288 msgid "HISTORY"
289 msgstr "ISTORIC"
290
291 #. type: Plain text
292 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
293 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
294 msgid "glibc 2.2.4."
295 msgstr "glibc 2.2.4."
296
297 #. type: SH
298 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
299 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
300 #, no-wrap
301 msgid "BUGS"
302 msgstr "ERORI"
303
304 #. type: Plain text
305 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
306 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
307 msgid ""
308 "Before glibc 2.3.3, the implementation of this function contains a buffer-"
309 "overrun bug: it returns the complete list of groups for I<user> in the array "
310 "I<groups>, even when the number of groups exceeds I<*ngroups>."
311 msgstr ""
312 "Înainte de glibc 2.3.3, implementarea acestei funcții conține o eroare de "
313 "depășire a memoriei tampon: aceasta returnează lista completă a grupurilor "
314 "pentru utilizatorul I<user> în matricea I<groups>, chiar și atunci când "
315 "numărul de grupuri depășește I<*ngroups>."
316
317 #. type: SH
318 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
319 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
320 #, no-wrap
321 msgid "EXAMPLES"
322 msgstr "EXEMPLE"
323
324 #. type: Plain text
325 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
326 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
327 msgid ""
328 "The program below displays the group list for the user named in its first "
329 "command-line argument. The second command-line argument specifies the "
330 "I<ngroups> value to be supplied to B<getgrouplist>(). The following shell "
331 "session shows examples of the use of this program:"
332 msgstr ""
333 "Programul de mai jos afișează lista de grupuri pentru utilizatorul menționat "
334 "în primul său argument de linie de comandă. Al doilea argument din linia de "
335 "comandă specifică valoarea lui I<ngroups> care trebuie furnizată lui "
336 "B<getgrouplist>(). Următoarea sesiune shell prezintă exemple de utilizare a "
337 "acestui program:"
338
339 #. type: Plain text
340 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
341 #: opensuse-tumbleweed
342 #, no-wrap
343 msgid ""
344 "$B< ./a.out cecilia 0>\n"
345 "getgrouplist() returned -1\n"
346 "ngroups = 3\n"
347 "$B< ./a.out cecilia 3>\n"
348 "ngroups = 3\n"
349 "16 (dialout)\n"
350 "33 (video)\n"
351 "100 (users)\n"
352 msgstr ""
353 "$B< ./a.out cecilia 0>\n"
354 "getgrouplist() returned -1\n"
355 "ngroups = 3\n"
356 "$B< ./a.out cecilia 3>\n"
357 "ngroups = 3\n"
358 "16 (dialout)\n"
359 "33 (video)\n"
360 "100 (users)\n"
361
362 #. type: SS
363 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
364 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
365 #, no-wrap
366 msgid "Program source"
367 msgstr "Sursa programului"
368
369 #. type: Plain text
370 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
371 #: opensuse-tumbleweed
372 #, no-wrap
373 msgid ""
374 "#include E<lt>errno.hE<gt>\n"
375 "#include E<lt>grp.hE<gt>\n"
376 "#include E<lt>pwd.hE<gt>\n"
377 "#include E<lt>stdio.hE<gt>\n"
378 "#include E<lt>stdlib.hE<gt>\n"
379 "\\&\n"
380 "int\n"
381 "main(int argc, char *argv[])\n"
382 "{\n"
383 " int ngroups;\n"
384 " gid_t *groups;\n"
385 " struct group *gr;\n"
386 " struct passwd *pw;\n"
387 "\\&\n"
388 " if (argc != 3) {\n"
389 " fprintf(stderr, \"Usage: %s E<lt>userE<gt> E<lt>ngroupsE<gt>\\[rs]n\", argv[0]);\n"
390 " exit(EXIT_FAILURE);\n"
391 " }\n"
392 "\\&\n"
393 " ngroups = atoi(argv[2]);\n"
394 "\\&\n"
395 " groups = malloc(sizeof(*groups) * ngroups);\n"
396 " if (groups == NULL) {\n"
397 " perror(\"malloc\");\n"
398 " exit(EXIT_FAILURE);\n"
399 " }\n"
400 "\\&\n"
401 " /* Fetch passwd structure (contains first group ID for user). */\n"
402 "\\&\n"
403 " errno = 0;\n"
404 " pw = getpwnam(argv[1]);\n"
405 " if (pw == NULL) {\n"
406 " if (errno)\n"
407 " perror(\"getpwnam\");\n"
408 " else\n"
409 " fprintf(stderr, \"no such user\\[rs]n\");\n"
410 " exit(EXIT_FAILURE);\n"
411 " }\n"
412 "\\&\n"
413 " /* Retrieve group list. */\n"
414 "\\&\n"
415 " if (getgrouplist(argv[1], pw-E<gt>pw_gid, groups, &ngroups) == -1) {\n"
416 " fprintf(stderr, \"getgrouplist() returned -1\\[rs]n\");\n"
417 " fprintf(stderr, \"ngroups = %d\\[rs]n\", ngroups);\n"
418 " exit(EXIT_FAILURE);\n"
419 " }\n"
420 "\\&\n"
421 " /* Display list of retrieved groups, along with group names. */\n"
422 "\\&\n"
423 " fprintf(stderr, \"ngroups = %d\\[rs]n\", ngroups);\n"
424 " for (int j = 0; j E<lt> ngroups; j++) {\n"
425 " printf(\"%d\", groups[j]);\n"
426 " gr = getgrgid(groups[j]);\n"
427 " if (gr != NULL)\n"
428 " printf(\" (%s)\", gr-E<gt>gr_name);\n"
429 " printf(\"\\[rs]n\");\n"
430 " }\n"
431 "\\&\n"
432 " exit(EXIT_SUCCESS);\n"
433 "}\n"
434 msgstr ""
435 "#include E<lt>errno.hE<gt>\n"
436 "#include E<lt>grp.hE<gt>\n"
437 "#include E<lt>pwd.hE<gt>\n"
438 "#include E<lt>stdio.hE<gt>\n"
439 "#include E<lt>stdlib.hE<gt>\n"
440 "\\&\n"
441 "int\n"
442 "main(int argc, char *argv[])\n"
443 "{\n"
444 " int ngroups;\n"
445 " gid_t *groups;\n"
446 " struct group *gr;\n"
447 " struct passwd *pw;\n"
448 "\\&\n"
449 " if (argc != 3) {\n"
450 " fprintf(stderr, \"Utilizare: %s E<lt>userE<gt> E<lt>ngroupsE<gt>\\[rs]n\", argv[0]);\n"
451 " exit(EXIT_FAILURE);\n"
452 " }\n"
453 "\\&\n"
454 " ngroups = atoi(argv[2]);\n"
455 "\\&\n"
456 " groups = malloc(sizeof(*groups) * ngroups);\n"
457 " if (groups == NULL) {\n"
458 " perror(\"malloc\");\n"
459 " exit(EXIT_FAILURE);\n"
460 " }\n"
461 "\\&\n"
462 " /* Obține structura passwd (conține primul ID de grup pentru utilizator). */\n"
463 "\\&\n"
464 " errno = 0\n"
465 " pw = getpwnam(argv[1]);\n"
466 " if (pw == NULL) {\n"
467 " if (errno)\n"
468 " perror(\"getpwnam\");\n"
469 " else\n"
470 " fprintf(stderr, \"nu există un astfel de utilizator\\[rs]n\");\n"
471 " exit(EXIT_FAILURE);\n"
472 " }\n"
473 "\\&\n"
474 " /* Preluarea listei de grupuri. */\n"
475 "\\&\n"
476 " if (getgrouplist(argv[1], pw-E<gt>pw_gid, groups, &ngroups) == -1) {\n"
477 " fprintf(stderr, \"getgrouplist() returned -1; ngroups = %d\\[rs]n\",\n"
478 " ngroups);\n"
479 " exit(EXIT_FAILURE);\n"
480 " }\n"
481 "\\&\n"
482 " /* Afișează lista grupurilor recuperate, împreună cu numele grupurilor. */\n"
483 "\\&\n"
484 " fprintf(stderr, \"ngroups = %d\\[rs]n\", ngroups);\n"
485 " for (size_t j = 0; j E<lt> ngroups; j++) {\n"
486 " printf(\"%d\", groups[j]);\n"
487 " gr = getgrgid(groups[j]);\n"
488 " if (gr != NULL)\n"
489 " printf(\" (%s)\", gr-E<gt>gr_name);\n"
490 " printf(\"\\[rs]n\");\n"
491 " }\n"
492 "\\&\n"
493 " exit(EXIT_SUCCESS);\n"
494 "}\n"
495
496 #. SRC END
497 #. type: SH
498 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
499 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
500 #, no-wrap
501 msgid "SEE ALSO"
502 msgstr "CONSULTAȚI ȘI"
503
504 #. type: Plain text
505 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
506 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
507 msgid ""
508 "B<getgroups>(2), B<setgroups>(2), B<getgrent>(3), B<group_member>(3), "
509 "B<group>(5), B<passwd>(5)"
510 msgstr ""
511 "B<getgroups>(2), B<setgroups>(2), B<getgrent>(3), B<group_member>(3), "
512 "B<group>(5), B<passwd>(5)"
513
514 #. type: TH
515 #: debian-trixie
516 #, no-wrap
517 msgid "2024-06-15"
518 msgstr "15 iunie 2024"
519
520 #. type: TH
521 #: debian-trixie
522 #, no-wrap
523 msgid "Linux man-pages 6.9.1"
524 msgstr "Pagini de manual de Linux 6.9.1"
525
526 #. type: Plain text
527 #: debian-trixie
528 msgid "Standard C library (I<libc>, I<-lc>)"
529 msgstr "Biblioteca C standard (I<libc>, I<-lc>)"
530
531 #. type: Plain text
532 #: debian-trixie fedora-44 fedora-rawhide
533 #, no-wrap
534 msgid ""
535 "$B< ./a.out cecilia 0>\n"
536 "getgrouplist() returned -1; ngroups = 3\n"
537 "$B< ./a.out cecilia 3>\n"
538 "ngroups = 3\n"
539 "16 (dialout)\n"
540 "33 (video)\n"
541 "100 (users)\n"
542 msgstr ""
543 "$B< ./a.out cecilia 0>\n"
544 "getgrouplist() returned -1; ngroups = 3\n"
545 "$B< ./a.out cecilia 3>\n"
546 "ngroups = 3\n"
547 "16 (dialout)\n"
548 "33 (video)\n"
549 "100 (users)\n"
550
551 #. type: Plain text
552 #: debian-trixie fedora-44 fedora-rawhide
553 #, no-wrap
554 msgid ""
555 "#include E<lt>errno.hE<gt>\n"
556 "#include E<lt>grp.hE<gt>\n"
557 "#include E<lt>pwd.hE<gt>\n"
558 "#include E<lt>stdio.hE<gt>\n"
559 "#include E<lt>stdlib.hE<gt>\n"
560 "\\&\n"
561 "int\n"
562 "main(int argc, char *argv[])\n"
563 "{\n"
564 " int ngroups;\n"
565 " gid_t *groups;\n"
566 " struct group *gr;\n"
567 " struct passwd *pw;\n"
568 "\\&\n"
569 " if (argc != 3) {\n"
570 " fprintf(stderr, \"Usage: %s E<lt>userE<gt> E<lt>ngroupsE<gt>\\[rs]n\", argv[0]);\n"
571 " exit(EXIT_FAILURE);\n"
572 " }\n"
573 "\\&\n"
574 " ngroups = atoi(argv[2]);\n"
575 "\\&\n"
576 " groups = malloc(sizeof(*groups) * ngroups);\n"
577 " if (groups == NULL) {\n"
578 " perror(\"malloc\");\n"
579 " exit(EXIT_FAILURE);\n"
580 " }\n"
581 "\\&\n"
582 " /* Fetch passwd structure (contains first group ID for user). */\n"
583 "\\&\n"
584 " errno = 0;\n"
585 " pw = getpwnam(argv[1]);\n"
586 " if (pw == NULL) {\n"
587 " if (errno)\n"
588 " perror(\"getpwnam\");\n"
589 " else\n"
590 " fprintf(stderr, \"no such user\\[rs]n\");\n"
591 " exit(EXIT_FAILURE);\n"
592 " }\n"
593 "\\&\n"
594 " /* Retrieve group list. */\n"
595 "\\&\n"
596 " if (getgrouplist(argv[1], pw-E<gt>pw_gid, groups, &ngroups) == -1) {\n"
597 " fprintf(stderr, \"getgrouplist() returned -1; ngroups = %d\\[rs]n\",\n"
598 " ngroups);\n"
599 " exit(EXIT_FAILURE);\n"
600 " }\n"
601 "\\&\n"
602 " /* Display list of retrieved groups, along with group names. */\n"
603 "\\&\n"
604 " fprintf(stderr, \"ngroups = %d\\[rs]n\", ngroups);\n"
605 " for (int j = 0; j E<lt> ngroups; j++) {\n"
606 " printf(\"%d\", groups[j]);\n"
607 " gr = getgrgid(groups[j]);\n"
608 " if (gr != NULL)\n"
609 " printf(\" (%s)\", gr-E<gt>gr_name);\n"
610 " printf(\"\\[rs]n\");\n"
611 " }\n"
612 "\\&\n"
613 " exit(EXIT_SUCCESS);\n"
614 "}\n"
615 msgstr ""
616 "#include E<lt>errno.hE<gt>\n"
617 "#include E<lt>grp.hE<gt>\n"
618 "#include E<lt>pwd.hE<gt>\n"
619 "#include E<lt>stdio.hE<gt>\n"
620 "#include E<lt>stdlib.hE<gt>\n"
621 "\\&\n"
622 "int\n"
623 "main(int argc, char *argv[])\n"
624 "{\n"
625 " int ngroups;\n"
626 " gid_t *groups;\n"
627 " struct group *gr;\n"
628 " struct passwd *pw;\n"
629 "\\&\n"
630 " if (argc != 3) {\n"
631 " fprintf(stderr, \"Utilizare: %s E<lt>userE<gt> E<lt>ngroupsE<gt>\\[rs]n\", argv[0]);\n"
632 " exit(EXIT_FAILURE);\n"
633 " }\n"
634 "\\&\n"
635 " ngroups = atoi(argv[2]);\n"
636 "\\&\n"
637 " groups = malloc(sizeof(*groups) * ngroups);\n"
638 " if (groups == NULL) {\n"
639 " perror(\"malloc\");\n"
640 " exit(EXIT_FAILURE);\n"
641 " }\n"
642 "\\&\n"
643 " /* Obține structura passwd (conține primul ID de grup pentru utilizator). */\n"
644 "\\&\n"
645 " errno = 0\n"
646 " pw = getpwnam(argv[1]);\n"
647 " if (pw == NULL) {\n"
648 " if (errno)\n"
649 " perror(\"getpwnam\");\n"
650 " else\n"
651 " fprintf(stderr, \"nu există un astfel de utilizator\\[rs]n\");\n"
652 " exit(EXIT_FAILURE);\n"
653 " }\n"
654 "\\&\n"
655 " /* Preluarea listei de grupuri. */\n"
656 "\\&\n"
657 " if (getgrouplist(argv[1], pw-E<gt>pw_gid, groups, &ngroups) == -1) {\n"
658 " fprintf(stderr, \"getgrouplist() returned -1; ngroups = %d\\[rs]n\",\n"
659 " ngroups);\n"
660 " exit(EXIT_FAILURE);\n"
661 " }\n"
662 "\\&\n"
663 " /* Afișează lista grupurilor recuperate, împreună cu numele grupurilor. */\n"
664 "\\&\n"
665 " fprintf(stderr, \"ngroups = %d\\[rs]n\", ngroups);\n"
666 " for (size_t j = 0; j E<lt> ngroups; j++) {\n"
667 " printf(\"%d\", groups[j]);\n"
668 " gr = getgrgid(groups[j]);\n"
669 " if (gr != NULL)\n"
670 " printf(\" (%s)\", gr-E<gt>gr_name);\n"
671 " printf(\"\\[rs]n\");\n"
672 " }\n"
673 "\\&\n"
674 " exit(EXIT_SUCCESS);\n"
675 "}\n"
676
677 #. type: TH
678 #: fedora-44 fedora-rawhide
679 #, no-wrap
680 msgid "2024-07-23"
681 msgstr "23 iulie 2024"
682
683 #. type: TH
684 #: fedora-44 fedora-rawhide
685 #, no-wrap
686 msgid "Linux man-pages 6.13"
687 msgstr "Pagini de manual de Linux 6.13"
688
689 #. type: TH
690 #: mageia-cauldron
691 #, no-wrap
692 msgid "Linux man-pages 6.17"
693 msgstr "Pagini de manual de Linux 6.17"
694
695 #. type: TH
696 #: opensuse-leap-16-1 opensuse-tumbleweed
697 #, no-wrap
698 msgid "Linux man-pages (unreleased)"
699 msgstr "Pagini de manual Linux (nepublicate)"