getpw - get passwd entry from UID
#include <stdlib.h> int getpw(uid_t uid, char *buf);
The getpw() function searches the local user database for a user id number that equals uid, copies the line of the password file in which uid was found into the array pointed to by buf, and returns 0. getpw() returns non-zero if uid cannot be found.
This function is included only for compatibility with legacy systems and should not be used; the functions described on the getpwnam(3C) manual page should be used instead.
This function does not search any network name services, nor does it use the caching provided by nscd(8).
There is no limit to the length of data which getpw() may write to the provided buffer, making it impossible to use this function without risk of buffer overflow.
The getpw() function returns non-zero on error.
See attributes(7) for descriptions of the following attributes:
|
getpwnam(3C), passwd(5), attributes(7)
The getpw() function was first documented in Bell Labs Research UNIX Version 4 in 1973. It was documented as deprecated in Bell Labs Research UNIX Version 7 in 1979 when the replacement getpwuid() function was introduced.
The getpw() function has been included for compatibility but deprecated for use by new software in all versions of SunOS and Solaris.