1PUTGRENT(3)                Linux Programmer's Manual               PUTGRENT(3)
2
3
4

NAME

6       putgrent - write a group database entry to a file
7

SYNOPSIS

9       #define _GNU_SOURCE         /* See feature_test_macros(7) */
10       #include <grp.h>
11
12       int putgrent(const struct group *grp, FILE *stream);
13

DESCRIPTION

15       The putgrent() function is the counterpart for fgetgrent(3).  The func‐
16       tion writes the content of the provided struct group into  the  stream.
17       The list of group members must be NULL-terminated or NULL-initialized.
18
19       The struct group is defined as follows:
20
21           struct group {
22               char   *gr_name;      /* group name */
23               char   *gr_passwd;    /* group password */
24               gid_t   gr_gid;       /* group ID */
25               char  **gr_mem;       /* group members */
26           };
27

RETURN VALUE

29       The function returns zero on success, and a nonzero value on error.
30

ATTRIBUTES

32       For   an   explanation   of   the  terms  used  in  this  section,  see
33       attributes(7).
34
35       ┌───────────┬───────────────┬─────────┐
36Interface  Attribute     Value   
37       ├───────────┼───────────────┼─────────┤
38putgrent() │ Thread safety │ MT-Safe │
39       └───────────┴───────────────┴─────────┘
40

CONFORMING TO

42       This function is a GNU extension.
43

SEE ALSO

45       fgetgrent(3), getgrent(3), group(5)
46

COLOPHON

48       This page is part of release 4.16 of the Linux  man-pages  project.   A
49       description  of  the project, information about reporting bugs, and the
50       latest    version    of    this    page,    can     be     found     at
51       https://www.kernel.org/doc/man-pages/.
52
53
54
55GNU                               2017-09-15                       PUTGRENT(3)
Impressum