OSDN Git Service

(split) LDP: Update original to LDP v3.50.
[linuxjm/LDP_man-pages.git] / original / 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 2003-09-09 "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 .sp
15 .BI "int putgrent(const struct group *" grp ", FILE *" fp );
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 \fIstruct group\fP into the
22 file pointed to by
23 .IR fp .
24 The list of group members must be NULL-terminated or NULL-initialized.
25 .sp
26 The \fIstruct group\fP is defined as follows:
27 .sp
28 .in +4n
29 .nf
30 struct group {
31     char   *gr_name;      /* group name */
32     char   *gr_passwd;    /* group password */
33     gid_t   gr_gid;       /* group ID */
34     char  **gr_mem;       /* group members */
35 };
36 .fi
37 .in
38 .SH RETURN VALUE
39 The function returns zero on success, and a nonzero value on error.
40 .SH CONFORMING TO
41 This function is a GNU extension.
42 .SH SEE ALSO
43 .BR fgetgrent (3),
44 .BR getgrent (3),
45 .BR group (5)