]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/putgrent.3
pthread_tryjoin_np.3: ATTRIBUTES: Note functions that are thread-safe
[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.\"
8392a3b3 7.TH PUTGRENT 3 2015-01-22 "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
2d70fb0d 15.BI "int putgrent(const struct group *" grp ", FILE *" stream );
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
2d70fb0d 24.IR stream .
bd74a873 25The list of group members must be NULL-terminated or NULL-initialized.
fea681da 26.sp
c9942389
MK
27The
28.IR "struct group"
29is defined as follows:
fea681da 30.sp
a08ea57c 31.in +4n
fea681da
MK
32.nf
33struct group {
b9f02710
MK
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 */
fea681da
MK
38};
39.fi
a08ea57c 40.in
47297adb 41.SH RETURN VALUE
c7094399 42The function returns zero on success, and a nonzero value on error.
47297adb 43.SH CONFORMING TO
a7fadb55 44This function is a GNU extension.
47297adb 45.SH SEE ALSO
fea681da
MK
46.BR fgetgrent (3),
47.BR getgrent (3),
0a4f8b7b 48.BR group (5)