]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/putgrent.3
s/the the/the/
[thirdparty/man-pages.git] / man3 / putgrent.3
1 .\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\"
4 .TH PUTGRENT 3 2003-09-09 "GNU" "group Database Access"
5 .SH NAME
6 putgrent \- write a group database entry to a file
7 .SH SYNOPSIS
8 .B #define _GNU_SOURCE
9 .br
10 .B #include <grp.h>
11 .sp
12 .BI "int putgrent(const struct group *" grp ", FILE *" fp );
13 .sp
14 .SH DESCRIPTION
15 The
16 .B putgrent()
17 function is the counterpart for
18 .BR fgetgrent() .
19 The function writes the content of the provided struct group into the
20 file pointed to by
21 .IR fp .
22 The list of group members must be NULL terminated or NULL initialized.
23 .sp
24 The struct group is defined as follows:
25 .sp
26 .RS
27 .nf
28 struct group {
29 char *gr_name; /* group name */
30 char *gr_passwd; /* group password */
31 gid_t gr_gid; /* group id */
32 char **gr_mem; /* group members */
33 };
34 .fi
35 .RE
36 .SH "RETURN VALUE"
37 The function returns zero on success, and a non-zero value on error.
38 .SH "SEE ALSO"
39 .BR fgetgrent (3),
40 .BR getgrent (3),
41 .BR group (5)