#include #include #include int main(int argc, char **argv) { int i = 0; while(1) { for (i = 1; i < argc; i++) { const char *foo = argv[i]; struct passwd result; struct passwd *resultp = &result; char buffer[1024]; getpwnam_r(foo, &result, buffer, sizeof(buffer), &resultp); if (resultp == NULL) { printf("Result[%s]: empty\n", foo); continue; } printf("Result[%s]: %s, %s, %u, %u, %s, %s, %s\n", foo, resultp->pw_name, resultp->pw_passwd, resultp->pw_uid, resultp->pw_gid, resultp->pw_gecos, resultp->pw_dir, resultp->pw_shell); } } return 0; }