#include #include #include //misleading name int main(int argc, char **argv) { char loginname[] = "mm64"; struct passwd *p = getpwnam(loginname); if (p == NULL) { fprintf(stderr, "%s: login name %s not found\n", argv[0], loginname); return EXIT_FAILURE; } printf("loginname %s\n", p->pw_name); printf("UID %d\n", p->pw_uid); printf("GID %d\n", p->pw_gid); printf("GECOS %s\n", p->pw_gecos); printf("home directory %s\n", p->pw_dir); printf("login shell %s\n", p->pw_shell); return EXIT_SUCCESS; }