NAME
getpwwho - get password file entry using liberal name
matching
SYNOPSIS
#include <pwd.h>
struct passwd *getpwwho(name)
char *name;
struct passwd *getpwambig();
DESCRIPTION
Getpwwho is much like getpwnam(3), except that it is much
more
liberal about the names that it will match. Name may be a
full
login name or it may be the unique abbreviation of a persons
last
name, or it may be a unique abbreviation of a persons first
and
last name.
The subroutine getpwambig may be
used to iterate through all the
matches for the name given to the last call to getpwwho. If
getpwwho returns -1 then name does not uniquely determine a
person,
a program can then print out all the names that match by
repeatedly
calling getpwambig until getpwambig returns 0.
FILES
/etc/passwd The password file.
SEE ALSO
getpwnam(3),
EXAMPLE
getpwwho("harry bovik");
getpwwho("bovik");
getpwwho("H Bovik");
getpwwho("hb");
All of these match the person "Harry Q. Bovik",
who has "hb"
as his login name.
DIAGNOSTICS
Getpwwho returns 0 if the person isn’t found, -1 if
the name is
ambiguous. In the case that the name is ambiguous a program
can
iterate through all the possibilities by using
getpwambig.