2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
|
|
|
|
.\" Distributed under GPL
|
|
|
|
.\"
|
2007-05-18 08:43:42 +00:00
|
|
|
.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
|
2007-04-12 22:42:49 +00:00
|
|
|
The
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR putgrent ()
|
2005-07-05 13:53:03 +00:00
|
|
|
function is the counterpart for
|
2007-05-12 00:30:29 +00:00
|
|
|
.BR fgetgrent (3).
|
2004-11-03 13:51:07 +00:00
|
|
|
The function writes the content of the provided struct group into the
|
2007-04-12 22:42:49 +00:00
|
|
|
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
|
|
|
|
The struct group is defined as follows:
|
|
|
|
.sp
|
2007-04-03 15:32:52 +00:00
|
|
|
.in +0.5i
|
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
|
2007-04-03 15:32:52 +00:00
|
|
|
.in -0.5i
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "RETURN VALUE"
|
|
|
|
The function returns zero on success, and a non-zero value on error.
|
2006-08-04 12:39:17 +00:00
|
|
|
.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)
|