File: putgrent.3

package info (click to toggle)
manpages 3.44-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 12,880 kB
  • sloc: sh: 404; perl: 166; makefile: 87; lisp: 22
file content (50 lines) | stat: -rw-r--r-- 1,339 bytes parent folder | download | duplicates (2)
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
42
43
44
45
46
47
48
49
50
.\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
.\" Distributed under GPL
.\"
.TH PUTGRENT 3 2003-09-09 "GNU" "Linux Programmer's Manual"
.SH NAME
putgrent \- write a group database entry to a file
.SH SYNOPSIS
.BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
.br
.B #include <grp.h>
.sp
.BI "int putgrent(const struct group *" grp ", FILE *" fp );
.SH DESCRIPTION
The
.BR putgrent ()
function is the counterpart for
.BR fgetgrent (3).
The function writes the content of the provided \fIstruct group\fP into the
file pointed to by
.IR fp .
The list of group members must be NULL-terminated or NULL-initialized.
.sp
The \fIstruct group\fP is defined as follows:
.sp
.in +4n
.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
.in
.SH "RETURN VALUE"
The function returns zero on success, and a nonzero value on error.
.SH "CONFORMING TO"
This function is a GNU extension.
.SH "SEE ALSO"
.BR fgetgrent (3),
.BR getgrent (3),
.BR group (5)
.SH COLOPHON
This page is part of release 3.44 of the Linux
.I man-pages
project.
A description of the project,
and information about reporting bugs,
can be found at
http://www.kernel.org/doc/man-pages/.