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