4.3BSD-Reno/src/lib/libutil/pwcache.3

Compare this file to the similar file:
Show the results in this format:

.\" Copyright (c) 1989 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms are permitted provided
.\" that: (1) source distributions retain this entire copyright notice and
.\" comment, and (2) distributions including binaries display the following
.\" acknowledgement:  ``This product includes software developed by the
.\" University of California, Berkeley and its contributors'' in the
.\" documentation or other materials provided with the distribution and in
.\" all advertising materials mentioning features or use of this software.
.\" Neither the name of the University nor the names of its contributors may
.\" be used to endorse or promote products derived from this software without
.\" specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.\"	@(#)pwcache.3	5.3 (Berkeley) 6/23/90
.\"
.TH PWCACHE 3 "June 23, 1990"
.UC 7
.SH NAME
pwcache \- cache password and group entries
.SH SYNOPSIS
.ft B
.nf
user_from_uid(uid, nouser)
uid_t uid;
int nouser;

group_from_gid(gid, nogroup)
gid_t gid;
int nogroup;
.fi
.ft R
.SH DESCRIPTION
.ft B
This interface is not part of the C library.
It has been placed in the Berkeley utility library, libutil, as it is
used by several standard utilities.
.ft R
.PP
The
.I user_from_uid
function returns the user name associated with the argument uid.
The user name is cached so that multiple calls with the same uid 
do not require additional calls to
.IR getpwuid (3).
If there is no user associated with the uid, a pointer is returned
to an ASCII representation of the uid, unless the argument
.I nouser
is non-zero, in which case a NULL pointer is returned.
.PP
The
.I group_from_gid
function returns the group name associated with the argument gid.
The group name is cached so that multiple calls with the same gid
do not require additional calls to
.IR getgrgid (3).
If there is no group associated with the gid, a pointer is returned
to an ASCII representation of the gid, unless the argument
.I nogroup
is non-zero, in which case a NULL pointer is returned.
.SH SEE ALSO
getgrgid(3), getpwuid(3)