Returns information about the specified user name.
#include <pwd.h> struct passwd *getpwnam ( const char *name );
If successful, returns a pointer to a passwd structure. Otherwise, returns a NULL pointer if the ID cannot be found or an error occurs. If an error occurs, errno is also set.
The pointer returned by the getpwnam points to data, which might be overwritten by another call to getpwnam. In a multi-threaded, multi-processor environment, use getpwnam_r.