getpwwho - get password file entry using liberal name matching
struct passwd *getpwwho(name)
struct passwd *getpwambig();
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
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.
/etc/passwd The password file.
All of these match the person "Harry Q. Bovik", who has "hb"
as his login name.
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.