man-pages/man3/putgrent.3

44 lines
1.1 KiB
Groff
Raw Normal View History

2004-11-03 13:51:07 +00:00
.\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
.\" Distributed under GPL
.\"
.TH PUTGRENT 3 2003-09-09 "GNU" "Linux Programmer's Manual"
2004-11-03 13:51:07 +00:00
.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 );
.SH DESCRIPTION
The
.BR putgrent ()
2005-07-05 13:53:03 +00:00
function is the counterpart for
.BR fgetgrent (3).
2007-06-13 22:13:46 +00:00
The function writes the content of the provided \fIstruct group\fP into the
file pointed to by
2004-11-03 13:51:07 +00:00
.IR fp .
The list of group members must be NULL terminated or NULL initialized.
.sp
2007-06-13 22:13:46 +00:00
The \fIstruct group\fP is defined as follows:
2004-11-03 13:51:07 +00:00
.sp
.in +4n
2004-11-03 13:51:07 +00:00
.nf
struct group {
2007-04-03 15:32:52 +00:00
char *gr_name; /* group name */
char *gr_passwd; /* group password */
gid_t gr_gid; /* group ID */
char **gr_mem; /* group members */
2004-11-03 13:51:07 +00:00
};
.fi
.in
2004-11-03 13:51:07 +00:00
.SH "RETURN VALUE"
2007-12-25 22:02:19 +00:00
The function returns zero on success, and a nonzero value on error.
.SH "CONFORMING TO"
This function is a GNU extension.
2004-11-03 13:51:07 +00:00
.SH "SEE ALSO"
.BR fgetgrent (3),
.BR getgrent (3),
2007-01-28 20:00:24 +00:00
.BR group (5),
.BR feature_test_macros (7)