Please check the manual page getpwnam(3).