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