1putgrent(3)                Library Functions Manual                putgrent(3)
2
3
4

NAME

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

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #define _GNU_SOURCE         /* See feature_test_macros(7) */
13       #include <grp.h>
14
15       int putgrent(const struct group *restrict grp, FILE *restrict stream);
16

DESCRIPTION

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

RETURN VALUE

32       The function returns zero on success, and a nonzero value on error.
33

ATTRIBUTES

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

STANDARDS

45       GNU.
46

SEE ALSO

48       fgetgrent(3), getgrent(3), group(5)
49
50
51
52Linux man-pages 6.05              2023-07-20                       putgrent(3)
Impressum