]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/putgrent.3
fclose.3: Consistency fix: use "stream" as name for "FILE *" argument
[thirdparty/man-pages.git] / man3 / putgrent.3
CommitLineData
fea681da 1.\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2297bf0e 2.\"
38f20bb9 3.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
fea681da 4.\" Distributed under GPL
38f20bb9 5.\" %%%LICENSE_END
fea681da 6.\"
0ed55ece 7.TH PUTGRENT 3 2003-09-09 "GNU" "Linux Programmer's Manual"
fea681da
MK
8.SH NAME
9putgrent \- write a group database entry to a file
10.SH SYNOPSIS
b80f966b 11.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
fea681da
MK
12.br
13.B #include <grp.h>
14.sp
15.BI "int putgrent(const struct group *" grp ", FILE *" fp );
fea681da 16.SH DESCRIPTION
c13182ef 17The
63aa9df0 18.BR putgrent ()
61f4934a 19function is the counterpart for
fb186734 20.BR fgetgrent (3).
c9942389
MK
21The function writes the content of the provided
22.IR "struct group"
23into the
c13182ef 24file pointed to by
fea681da 25.IR fp .
bd74a873 26The list of group members must be NULL-terminated or NULL-initialized.
fea681da 27.sp
c9942389
MK
28The
29.IR "struct group"
30is defined as follows:
fea681da 31.sp
a08ea57c 32.in +4n
fea681da
MK
33.nf
34struct group {
b9f02710
MK
35 char *gr_name; /* group name */
36 char *gr_passwd; /* group password */
37 gid_t gr_gid; /* group ID */
38 char **gr_mem; /* group members */
fea681da
MK
39};
40.fi
a08ea57c 41.in
47297adb 42.SH RETURN VALUE
c7094399 43The function returns zero on success, and a nonzero value on error.
47297adb 44.SH CONFORMING TO
a7fadb55 45This function is a GNU extension.
47297adb 46.SH SEE ALSO
fea681da
MK
47.BR fgetgrent (3),
48.BR getgrent (3),
0a4f8b7b 49.BR group (5)