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
10       #include <grp.h>
11
12       int putgrent(const struct group *grp, FILE *fp);
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  file
17       pointed to by fp.  The list of group members must be NULL terminated or
18       NULL initialized.
19
20       The struct group is defined as follows:
21
22           struct group {
23               char   *gr_name;      /* group name */
24               char   *gr_passwd;    /* group password */
25               gid_t   gr_gid;       /* group ID */
26               char  **gr_mem;       /* group members */
27           };
28

RETURN VALUE

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

CONFORMING TO

33       This function is a GNU extension.
34

SEE ALSO

36       fgetgrent(3), getgrent(3), group(5), feature_test_macros(7)
37

COLOPHON

39       This page is part of release 3.22 of the Linux  man-pages  project.   A
40       description  of  the project, and information about reporting bugs, can
41       be found at http://www.kernel.org/doc/man-pages/.
42
43
44
45GNU                               2003-09-09                       PUTGRENT(3)
Impressum