Update source and manual pages to match X/Open 1170 specification.

Updated setpassent() to understand YP (a bug), and changed setpwent()
to simply be a call to setpassent(0) (to remove duplicated code).
This commit is contained in:
jtc 1993-10-25 23:36:51 +00:00
parent 2928342e94
commit 71afdb430b
4 changed files with 28 additions and 31 deletions

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)getgrent.3 6.8 (Berkeley) 4/20/91
.\" $Id: getgrent.3,v 1.5 1993/10/15 00:09:56 jtc Exp $
.\" $Id: getgrent.3,v 1.6 1993/10/25 23:36:51 jtc Exp $
.\"
.Dd April 20, 1991
.Dt GETGRENT 3
@ -53,11 +53,11 @@
.Fn getgrnam "const char *name"
.Ft struct group *
.Fn getgrgid "gid_t gid"
.Ft struct group *
.Ft int
.Fn setgroupent "int stayopen"
.\" .Ft void
.\" .Fn setgrfile "const char *name"
.Ft int
.Ft void
.Fn setgrent void
.Ft void
.Fn endgrent void
@ -115,7 +115,7 @@ functionality as the group file may be updated.
The
.Fn setgrent
function
is identical to
is equivalent to
.Fn setgroupent
with an argument of zero.
.Pp
@ -131,17 +131,15 @@ and
.Fn getgrgid ,
return a pointer to the group entry if successful; if end-of-file
is reached or an error occurs a null pointer is returned.
The functions
The
.Fn setgroupent
and
.Fn setgrent
return the value 1 if successful, otherwise the value
function returns the value 1 if successful, otherwise the value
0 is returned.
The functions
The
.Fn endgrent
and
.Fn setgrfile
have no return value.
.Fn setgrent
functions have no return value.
.Sh FILES
.Bl -tag -width /etc/group -compact
.It Pa /etc/group

View File

@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)getgrent.c 5.9 (Berkeley) 4/1/91";*/
static char *rcsid = "$Id: getgrent.c,v 1.4 1993/08/26 00:44:37 jtc Exp $";
static char *rcsid = "$Id: getgrent.c,v 1.5 1993/10/25 23:36:53 jtc Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@ -112,10 +112,10 @@ start_gr()
return((_gr_fp = fopen(_PATH_GROUP, "r")) ? 1 : 0);
}
int
void
setgrent()
{
return(setgroupent(0));
(void) setgroupent(0);
}
int

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)getpwent.3 6.8 (Berkeley) 4/19/91
.\" $Id: getpwent.3,v 1.3 1993/10/25 22:23:39 jtc Exp $
.\" $Id: getpwent.3,v 1.4 1993/10/25 23:36:54 jtc Exp $
.\"
.Dd April 19, 1991
.Dt GETPWENT 3
@ -119,7 +119,7 @@ program is running.
The
.Fn setpwent
function
is identical to
is equivalent to
.Fn setpassent
with an argument of zero.
.Pp
@ -142,15 +142,15 @@ and
.Fn getpwuid ,
return a valid pointer to a passwd structure on success
and a null pointer if end-of-file is reached or an error occurs.
The functions
The
.Fn setpassent
and
.Fn setpwent
return 0 on failure and 1 on success.
function returns 0 on failure and 1 on success.
The
.Fn endpwent
function
has no return value.
and
.Fn setpwent
functions
have no return value.
.Sh FILES
.Bl -tag -width /etc/master.passwd -compact
.It Pa /var/db/pwd.db

View File

@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)getpwent.c 5.21 (Berkeley) 3/14/91";*/
static char *rcsid = "$Id: getpwent.c,v 1.8 1993/10/25 22:23:40 jtc Exp $";
static char *rcsid = "$Id: getpwent.c,v 1.9 1993/10/25 23:36:55 jtc Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@ -373,20 +373,19 @@ setpassent(stayopen)
{
_pw_keynum = 0;
_pw_stayopen = stayopen;
return(1);
}
void
setpwent()
{
_pw_keynum = 0;
_pw_stayopen = 0;
#ifdef YP
__ypmode = 0;
if(__ypcurrent)
free(__ypcurrent);
__ypcurrent = NULL;
#endif
return(1);
}
void
setpwent()
{
(void) setpassent(0);
}
void