Debian Codegraph @

upstream/debian-trixie/man3/putgrent.3

raw
1 '\" t
2 .\" Copyright 2003 Walter Harms ([email protected])
3 .\"
4 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .\"
6 .TH putgrent 3 2024-05-02 "Linux man-pages 6.9.1"
7 .SH NAME
8 putgrent \- write a group database entry to a file
9 .SH LIBRARY
10 Standard C library
11 .RI ( libc ", " \-lc )
12 .SH SYNOPSIS
13 .nf
14 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
15 .B #include <grp.h>
16 .P
17 .BI "int putgrent(const struct group *restrict " grp \
18 ", FILE *restrict " stream );
19 .fi
20 .SH DESCRIPTION
21 The
22 .BR putgrent ()
23 function is the counterpart for
24 .BR fgetgrent (3).
25 The function writes the content of the provided
26 .I struct group
27 into the
28 .IR stream .
29 The list of group members must be NULL-terminated or NULL-initialized.
30 .P
31 The
32 .I struct group
33 is defined as follows:
34 .P
35 .in +4n
36 .EX
37 struct group {
38 char *gr_name; /* group name */
39 char *gr_passwd; /* group password */
40 gid_t gr_gid; /* group ID */
41 char **gr_mem; /* group members */
42 };
43 .EE
44 .in
45 .SH RETURN VALUE
46 The function returns zero on success, and a nonzero value on error.
47 .SH ATTRIBUTES
48 For an explanation of the terms used in this section, see
49 .BR attributes (7).
50 .TS
51 allbox;
52 lbx lb lb
53 l l l.
54 Interface Attribute Value
55 T{
56 .na
57 .nh
58 .BR putgrent ()
59 T} Thread safety MT-Safe
60 .TE
61 .SH STANDARDS
62 GNU.
63 .SH SEE ALSO
64 .BR fgetgrent (3),
65 .BR getgrent (3),
66 .BR group (5)