1PUTGRENT(3)                  group Database Access                 PUTGRENT(3)
2
3
4

NAME

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

SYNOPSIS

9       #define _GNU_SOURCE
10       #include <grp.h>
11
12       int putgrent(const struct group *grp, FILE *fp);
13
14

DESCRIPTION

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

RETURN VALUE

31       The function returns zero on success, and a non-zero value on error.
32

CONFORMING TO

34       This function is a GNU extension.
35

SEE ALSO

37       fgetgrent(3), getgrent(3), group(5), feature_test_macros(7)
38
39
40
41GNU                               2003-09-09                       PUTGRENT(3)
Impressum