Debian Codegraph @

po/ru/man3/getgrouplist.3.po

raw
1 # Russian translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Azamat Hackimov <[email protected]>, 2013-2014, 2017.
5 # Dmitry Bolkhovskikh <[email protected]>, 2017.
6 # Vladislav <[email protected]>, 2015.
7 # Yuri Kozlov <[email protected]>, 2011-2019.
8 # Иван Павлов <[email protected]>, 2017, 2019.
9 msgid ""
10 msgstr ""
11 "Project-Id-Version: manpages-l10n\n"
12 "POT-Creation-Date: 2026-06-05 06:25+0200\n"
13 "PO-Revision-Date: 2024-12-21 19:50+0300\n"
14 "Last-Translator: Yuri Kozlov <[email protected]>\n"
15 "Language-Team: Russian <[email protected]>\n"
16 "Language: ru\n"
17 "MIME-Version: 1.0\n"
18 "Content-Type: text/plain; charset=UTF-8\n"
19 "Content-Transfer-Encoding: 8bit\n"
20 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
21 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
22 "(n%100>=11 && n%100<=14)? 2 : 3);\n"
23 "X-Generator: Lokalize 2.0\n"
24
25 #. type: TH
26 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
27 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
28 #, fuzzy, no-wrap
29 #| msgid "B<getgrouplist>()"
30 msgid "getgrouplist"
31 msgstr "B<getgrouplist>()"
32
33 #. type: TH
34 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
35 #: opensuse-tumbleweed
36 #, no-wrap
37 msgid "2025-09-21"
38 msgstr "21 сентября 2025 г."
39
40 #. type: TH
41 #: archlinux debian-unstable
42 #, fuzzy, no-wrap
43 #| msgid "Linux man-pages 6.17"
44 msgid "Linux man-pages 6.18"
45 msgstr "Справочные страницы Linux 6.17"
46
47 #. type: SH
48 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
49 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
50 #, no-wrap
51 msgid "NAME"
52 msgstr "НАИМЕНОВАНИЕ"
53
54 #. type: Plain text
55 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
56 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
57 msgid "getgrouplist - get list of groups to which a user belongs"
58 msgstr "getgrouplist - возвращает список групп, в которые входит пользователь"
59
60 #. type: SH
61 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
62 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
63 #, no-wrap
64 msgid "LIBRARY"
65 msgstr "БИБЛИОТЕКА"
66
67 #. type: Plain text
68 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
69 #: opensuse-leap-16-1 opensuse-tumbleweed
70 msgid "Standard C library (I<libc>,\\ I<-lc>)"
71 msgstr "Стандартная библиотека языка C (I<libc>,\\ I<-lc>)"
72
73 #. type: SH
74 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
75 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
76 #, no-wrap
77 msgid "SYNOPSIS"
78 msgstr "СИНТАКСИС"
79
80 #. type: Plain text
81 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
82 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
83 #, no-wrap
84 msgid "B<#include E<lt>grp.hE<gt>>\n"
85 msgstr "B<#include E<lt>grp.hE<gt>>\n"
86
87 #. type: Plain text
88 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
89 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
90 #, fuzzy, no-wrap
91 #| msgid ""
92 #| "B<int getrpcport(const char *>I<host>B<, unsigned long >I<prognum>B<,>\n"
93 #| "B< unsigned long >I<versnum>B<, unsigned >I<proto>B<);>\n"
94 msgid ""
95 "B<int getgrouplist(const char *>I<user>B<, gid_t >I<group>B<,>\n"
96 "B< gid_t *>I<groups>B<, int *>I<ngroups>B<);>\n"
97 msgstr ""
98 "B<int getrpcport(const char *>I<host>B<, unsigned long >I<prognum>B<,>\n"
99 "B< unsigned long >I<versnum>B<, unsigned >I<proto>B<);>\n"
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 ""
105 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
106 msgstr ""
107 "Требования макроса тестирования свойств для glibc (см. "
108 "B<feature_test_macros>(7)):"
109
110 #. type: Plain text
111 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
112 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
113 #, fuzzy
114 #| msgid "B<getgrouplist>()"
115 msgid "B<getgrouplist>():"
116 msgstr "B<getgrouplist>()"
117
118 #. type: Plain text
119 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
120 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
121 #, no-wrap
122 msgid ""
123 " Since glibc 2.19:\n"
124 " _DEFAULT_SOURCE\n"
125 " glibc 2.19 and earlier:\n"
126 " _BSD_SOURCE\n"
127 msgstr ""
128 " Начиная с glibc 2.19:\n"
129 " _DEFAULT_SOURCE\n"
130 " В версии glibc 2.19 и более ранних:\n"
131 " _BSD_SOURCE\n"
132
133 #. type: SH
134 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
135 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
136 #, no-wrap
137 msgid "DESCRIPTION"
138 msgstr "ОПИСАНИЕ"
139
140 #. type: Plain text
141 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
142 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
143 msgid ""
144 "The B<getgrouplist>() function scans the group database (see B<group>(5)) "
145 "to obtain the list of groups that I<user> belongs to. Up to I<*ngroups> of "
146 "these groups are returned in the array I<groups>."
147 msgstr ""
148 "Функция B<getgrouplist>() просматривает базу данных групп (смотрите "
149 "B<group>(5)) для составления списка групп, в которые входит пользователь "
150 "I<user>. В возвращаемом массиве I<groups> может быть до I<*ngroups> групп."
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 ""
156 "If it was not among the groups defined for I<user> in the group database, "
157 "then I<group> is included in the list of groups returned by "
158 "B<getgrouplist>(); typically this argument is specified as the group ID from "
159 "the password record for I<user>."
160 msgstr ""
161 "Если в базе данных групп отсутствуют группы, определённые для I<user>, то в "
162 "список групп, возвращаемый B<getgrouplist>(), включается I<group>; обычно, "
163 "это аргумент задаётся в виде ID группы из записи пароля I<user>."
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 "The I<ngroups> argument is a value-result argument: on return it always "
170 "contains the number of groups found for I<user>, including I<group>; this "
171 "value may be greater than the number of groups stored in I<groups>."
172 msgstr ""
173 "Аргумент I<ngroups> является аргументом-результатом: при возврате в нём "
174 "всегда содержится количество группы, найденных для I<user> включая I<group>; "
175 "данное значение может быть больше, чем количество групп, хранящихся в "
176 "I<groups>."
177
178 #. type: SH
179 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
180 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
181 #, no-wrap
182 msgid "RETURN VALUE"
183 msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"
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 number of groups of which I<user> is a member is less than or equal "
190 "to I<*ngroups>, then the value I<*ngroups> is returned."
191 msgstr ""
192 "Если количество групп, в которых I<user> является членом, меньше или равно "
193 "I<*ngroups>, то возвращается значение I<*ngroups>."
194
195 #. type: Plain text
196 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
197 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
198 #, fuzzy
199 #| msgid ""
200 #| "If the user is a member of more than I<*ngroups> groups, then "
201 #| "B<getgrouplist>() returns -1. In this case, the value returned in "
202 #| "I<*ngroups> can be used to resize the buffer passed to a further call "
203 #| "B<getgrouplist>()."
204 msgid ""
205 "If the user is a member of more than I<*ngroups> groups, then "
206 "B<getgrouplist>() returns -1. In this case, the value returned in "
207 "I<*ngroups> can be used to resize the buffer passed to a further call to "
208 "B<getgrouplist>()."
209 msgstr ""
210 "Если пользователь является членом более чем I<*ngroups> групп, то "
211 "B<getgrouplist>() возвращает -1. В этом случае значение, возвращаемое в "
212 "I<*ngroups>, можно использовать для подстройки размера буфера, передаваемого "
213 "в последующий вызов B<getgrouplist>()."
214
215 #. type: SH
216 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
217 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
218 #, no-wrap
219 msgid "ATTRIBUTES"
220 msgstr "АТРИБУТЫ"
221
222 #. type: Plain text
223 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
224 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
225 msgid ""
226 "For an explanation of the terms used in this section, see B<attributes>(7)."
227 msgstr "Описание терминов данного раздела смотрите в B<attributes>(7)."
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 "Interface"
234 msgstr "Интерфейс"
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 "Attribute"
241 msgstr "Атрибут"
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 "Value"
248 msgstr "Значение"
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 ".na\n"
255 msgstr ".na\n"
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 ".nh\n"
262 msgstr ".nh\n"
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 "B<getgrouplist>()"
269 msgstr "B<getgrouplist>()"
270
271 #. type: tbl table
272 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
273 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
274 #, no-wrap
275 msgid "Thread safety"
276 msgstr "Безвредность в нитях"
277
278 #. type: tbl table
279 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
280 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
281 #, no-wrap
282 msgid "MT-Safe locale"
283 msgstr "MT-Safe locale"
284
285 #. type: SH
286 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
287 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
288 #, no-wrap
289 msgid "STANDARDS"
290 msgstr "СТАНДАРТЫ"
291
292 #. type: Plain text
293 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
294 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
295 msgid "None."
296 msgstr "Отсутствуют."
297
298 #. type: SH
299 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
300 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
301 #, no-wrap
302 msgid "HISTORY"
303 msgstr "ИСТОРИЯ"
304
305 #. type: Plain text
306 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
307 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
308 msgid "glibc 2.2.4."
309 msgstr "glibc 2.2.4."
310
311 #. type: SH
312 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
313 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
314 #, no-wrap
315 msgid "BUGS"
316 msgstr "ПРОГРАММНЫЕ ОШИБКИ"
317
318 #. type: Plain text
319 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
320 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
321 #, fuzzy
322 #| msgid ""
323 #| "In glibc versions before 2.3.3, the implementation of this function "
324 #| "contains a buffer-overrun bug: it returns the complete list of groups for "
325 #| "I<user> in the array I<groups>, even when the number of groups exceeds "
326 #| "I<*ngroups>."
327 msgid ""
328 "Before glibc 2.3.3, the implementation of this function contains a buffer-"
329 "overrun bug: it returns the complete list of groups for I<user> in the array "
330 "I<groups>, even when the number of groups exceeds I<*ngroups>."
331 msgstr ""
332 "В glibc до версии 2.3.3 в реализации этой функции содержится ошибка "
333 "переполнения буфера: она возвращает полный список групп для I<user> в "
334 "массиве I<groups> даже когда количество групп превышает I<*ngroups>."
335
336 #. type: SH
337 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
338 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
339 #, no-wrap
340 msgid "EXAMPLES"
341 msgstr "ПРИМЕРЫ"
342
343 #. type: Plain text
344 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
345 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
346 msgid ""
347 "The program below displays the group list for the user named in its first "
348 "command-line argument. The second command-line argument specifies the "
349 "I<ngroups> value to be supplied to B<getgrouplist>(). The following shell "
350 "session shows examples of the use of this program:"
351 msgstr ""
352 "Программа, показанная далее, печатает список групп для пользователя из "
353 "первого аргумента командной строки. Во втором аргументе задаётся значение "
354 "I<ngroups>, передаваемое B<getgrouplist>(). Вот примеры работы этой "
355 "программы:"
356
357 #. type: Plain text
358 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
359 #: opensuse-tumbleweed
360 #, fuzzy, no-wrap
361 #| msgid ""
362 #| "$B< ./a.out cecilia 0>\n"
363 #| "getgrouplist() returned -1; ngroups = 3\n"
364 #| "$B< ./a.out cecilia 3>\n"
365 #| "ngroups = 3\n"
366 #| "16 (dialout)\n"
367 #| "33 (video)\n"
368 #| "100 (users)\n"
369 msgid ""
370 "$B< ./a.out cecilia 0>\n"
371 "getgrouplist() returned -1\n"
372 "ngroups = 3\n"
373 "$B< ./a.out cecilia 3>\n"
374 "ngroups = 3\n"
375 "16 (dialout)\n"
376 "33 (video)\n"
377 "100 (users)\n"
378 msgstr ""
379 "$B< ./a.out cecilia 0>\n"
380 "getgrouplist() вернула -1; ngroups = 3\n"
381 "$B< ./a.out cecilia 3>\n"
382 "ngroups = 3\n"
383 "16 (dialout)\n"
384 "33 (video)\n"
385 "100 (users)\n"
386
387 #. type: SS
388 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
389 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
390 #, no-wrap
391 msgid "Program source"
392 msgstr "Исходный код программы"
393
394 #. type: Plain text
395 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
396 #: opensuse-tumbleweed
397 #, no-wrap
398 msgid ""
399 "#include E<lt>errno.hE<gt>\n"
400 "#include E<lt>grp.hE<gt>\n"
401 "#include E<lt>pwd.hE<gt>\n"
402 "#include E<lt>stdio.hE<gt>\n"
403 "#include E<lt>stdlib.hE<gt>\n"
404 "\\&\n"
405 "int\n"
406 "main(int argc, char *argv[])\n"
407 "{\n"
408 " int ngroups;\n"
409 " gid_t *groups;\n"
410 " struct group *gr;\n"
411 " struct passwd *pw;\n"
412 "\\&\n"
413 " if (argc != 3) {\n"
414 " fprintf(stderr, \"Usage: %s E<lt>userE<gt> E<lt>ngroupsE<gt>\\[rs]n\", argv[0]);\n"
415 " exit(EXIT_FAILURE);\n"
416 " }\n"
417 "\\&\n"
418 " ngroups = atoi(argv[2]);\n"
419 "\\&\n"
420 " groups = malloc(sizeof(*groups) * ngroups);\n"
421 " if (groups == NULL) {\n"
422 " perror(\"malloc\");\n"
423 " exit(EXIT_FAILURE);\n"
424 " }\n"
425 "\\&\n"
426 " /* Fetch passwd structure (contains first group ID for user). */\n"
427 "\\&\n"
428 " errno = 0;\n"
429 " pw = getpwnam(argv[1]);\n"
430 " if (pw == NULL) {\n"
431 " if (errno)\n"
432 " perror(\"getpwnam\");\n"
433 " else\n"
434 " fprintf(stderr, \"no such user\\[rs]n\");\n"
435 " exit(EXIT_FAILURE);\n"
436 " }\n"
437 "\\&\n"
438 " /* Retrieve group list. */\n"
439 "\\&\n"
440 " if (getgrouplist(argv[1], pw-E<gt>pw_gid, groups, &ngroups) == -1) {\n"
441 " fprintf(stderr, \"getgrouplist() returned -1\\[rs]n\");\n"
442 " fprintf(stderr, \"ngroups = %d\\[rs]n\", ngroups);\n"
443 " exit(EXIT_FAILURE);\n"
444 " }\n"
445 "\\&\n"
446 " /* Display list of retrieved groups, along with group names. */\n"
447 "\\&\n"
448 " fprintf(stderr, \"ngroups = %d\\[rs]n\", ngroups);\n"
449 " for (int j = 0; j E<lt> ngroups; j++) {\n"
450 " printf(\"%d\", groups[j]);\n"
451 " gr = getgrgid(groups[j]);\n"
452 " if (gr != NULL)\n"
453 " printf(\" (%s)\", gr-E<gt>gr_name);\n"
454 " printf(\"\\[rs]n\");\n"
455 " }\n"
456 "\\&\n"
457 " exit(EXIT_SUCCESS);\n"
458 "}\n"
459 msgstr ""
460
461 #. SRC END
462 #. type: SH
463 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
464 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
465 #, no-wrap
466 msgid "SEE ALSO"
467 msgstr "СМОТРИТЕ ТАКЖЕ"
468
469 #. type: Plain text
470 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
471 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
472 msgid ""
473 "B<getgroups>(2), B<setgroups>(2), B<getgrent>(3), B<group_member>(3), "
474 "B<group>(5), B<passwd>(5)"
475 msgstr ""
476 "B<getgroups>(2), B<setgroups>(2), B<getgrent>(3), B<group_member>(3), "
477 "B<group>(5), B<passwd>(5)"
478
479 #. type: TH
480 #: debian-trixie
481 #, no-wrap
482 msgid "2024-06-15"
483 msgstr "15 июня 2024 г."
484
485 #. type: TH
486 #: debian-trixie
487 #, no-wrap
488 msgid "Linux man-pages 6.9.1"
489 msgstr "Страницы руководства Linux 6.9.1"
490
491 #. type: Plain text
492 #: debian-trixie
493 msgid "Standard C library (I<libc>, I<-lc>)"
494 msgstr "Стандартная библиотека языка C (I<libc>, I<-lc>)"
495
496 #. type: Plain text
497 #: debian-trixie fedora-44 fedora-rawhide
498 #, no-wrap
499 msgid ""
500 "$B< ./a.out cecilia 0>\n"
501 "getgrouplist() returned -1; ngroups = 3\n"
502 "$B< ./a.out cecilia 3>\n"
503 "ngroups = 3\n"
504 "16 (dialout)\n"
505 "33 (video)\n"
506 "100 (users)\n"
507 msgstr ""
508 "$B< ./a.out cecilia 0>\n"
509 "getgrouplist() вернула -1; ngroups = 3\n"
510 "$B< ./a.out cecilia 3>\n"
511 "ngroups = 3\n"
512 "16 (dialout)\n"
513 "33 (video)\n"
514 "100 (users)\n"
515
516 #. type: Plain text
517 #: debian-trixie fedora-44 fedora-rawhide
518 #, no-wrap
519 msgid ""
520 "#include E<lt>errno.hE<gt>\n"
521 "#include E<lt>grp.hE<gt>\n"
522 "#include E<lt>pwd.hE<gt>\n"
523 "#include E<lt>stdio.hE<gt>\n"
524 "#include E<lt>stdlib.hE<gt>\n"
525 "\\&\n"
526 "int\n"
527 "main(int argc, char *argv[])\n"
528 "{\n"
529 " int ngroups;\n"
530 " gid_t *groups;\n"
531 " struct group *gr;\n"
532 " struct passwd *pw;\n"
533 "\\&\n"
534 " if (argc != 3) {\n"
535 " fprintf(stderr, \"Usage: %s E<lt>userE<gt> E<lt>ngroupsE<gt>\\[rs]n\", argv[0]);\n"
536 " exit(EXIT_FAILURE);\n"
537 " }\n"
538 "\\&\n"
539 " ngroups = atoi(argv[2]);\n"
540 "\\&\n"
541 " groups = malloc(sizeof(*groups) * ngroups);\n"
542 " if (groups == NULL) {\n"
543 " perror(\"malloc\");\n"
544 " exit(EXIT_FAILURE);\n"
545 " }\n"
546 "\\&\n"
547 " /* Fetch passwd structure (contains first group ID for user). */\n"
548 "\\&\n"
549 " errno = 0;\n"
550 " pw = getpwnam(argv[1]);\n"
551 " if (pw == NULL) {\n"
552 " if (errno)\n"
553 " perror(\"getpwnam\");\n"
554 " else\n"
555 " fprintf(stderr, \"no such user\\[rs]n\");\n"
556 " exit(EXIT_FAILURE);\n"
557 " }\n"
558 "\\&\n"
559 " /* Retrieve group list. */\n"
560 "\\&\n"
561 " if (getgrouplist(argv[1], pw-E<gt>pw_gid, groups, &ngroups) == -1) {\n"
562 " fprintf(stderr, \"getgrouplist() returned -1; ngroups = %d\\[rs]n\",\n"
563 " ngroups);\n"
564 " exit(EXIT_FAILURE);\n"
565 " }\n"
566 "\\&\n"
567 " /* Display list of retrieved groups, along with group names. */\n"
568 "\\&\n"
569 " fprintf(stderr, \"ngroups = %d\\[rs]n\", ngroups);\n"
570 " for (int j = 0; j E<lt> ngroups; j++) {\n"
571 " printf(\"%d\", groups[j]);\n"
572 " gr = getgrgid(groups[j]);\n"
573 " if (gr != NULL)\n"
574 " printf(\" (%s)\", gr-E<gt>gr_name);\n"
575 " printf(\"\\[rs]n\");\n"
576 " }\n"
577 "\\&\n"
578 " exit(EXIT_SUCCESS);\n"
579 "}\n"
580 msgstr ""
581
582 #. type: TH
583 #: fedora-44 fedora-rawhide
584 #, no-wrap
585 msgid "2024-07-23"
586 msgstr "23 июля 2024 г."
587
588 #. type: TH
589 #: fedora-44 fedora-rawhide
590 #, no-wrap
591 msgid "Linux man-pages 6.13"
592 msgstr "Страницы руководства Linux 6.13"
593
594 #. type: TH
595 #: mageia-cauldron
596 #, no-wrap
597 msgid "Linux man-pages 6.17"
598 msgstr "Страницы руководства Linux 6.17"
599
600 #. type: TH
601 #: opensuse-leap-16-1 opensuse-tumbleweed
602 #, no-wrap
603 msgid "Linux man-pages (unreleased)"
604 msgstr "Страницы руководства Linux (не выпущены)"