]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/putgrent.3
getutent.3: tfix
[thirdparty/man-pages.git] / man3 / putgrent.3
1 .\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
5 .\" %%%LICENSE_END
6 .\"
7 .TH PUTGRENT 3 2017-09-15 "GNU" "Linux Programmer's Manual"
8 .SH NAME
9 putgrent \- write a group database entry to a file
10 .SH SYNOPSIS
11 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
12 .br
13 .B #include <grp.h>
14 .PP
15 .BI "int putgrent(const struct group *" grp ", FILE *" stream );
16 .SH DESCRIPTION
17 The
18 .BR putgrent ()
19 function is the counterpart for
20 .BR fgetgrent (3).
21 The function writes the content of the provided
22 .IR "struct group"
23 into the
24 .IR stream .
25 The list of group members must be NULL-terminated or NULL-initialized.
26 .PP
27 The
28 .IR "struct group"
29 is defined as follows:
30 .PP
31 .in +4n
32 .EX
33 struct group {
34 char *gr_name; /* group name */
35 char *gr_passwd; /* group password */
36 gid_t gr_gid; /* group ID */
37 char **gr_mem; /* group members */
38 };
39 .EE
40 .in
41 .SH RETURN VALUE
42 The function returns zero on success, and a nonzero value on error.
43 .SH ATTRIBUTES
44 For an explanation of the terms used in this section, see
45 .BR attributes (7).
46 .TS
47 allbox;
48 lb lb lb
49 l l l.
50 Interface Attribute Value
51 T{
52 .BR putgrent ()
53 T} Thread safety MT-Safe
54 .TE
55 .sp 1
56 .SH CONFORMING TO
57 This function is a GNU extension.
58 .SH SEE ALSO
59 .BR fgetgrent (3),
60 .BR getgrent (3),
61 .BR group (5)