MCPcopy Create free account
hub / github.com/coreutils/coreutils / print_user

Function print_user

src/id.c:332–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330/* Print the name or value of user ID UID. */
331
332static void
333print_user (uid_t uid)
334{
335 struct passwd *pwd = NULL;
336
337 if (use_name)
338 {
339 pwd = getpwuid (uid);
340 if (pwd == NULL)
341 {
342 error (0, 0, _("cannot find name for user ID %ju"), (uintmax_t) uid);
343 ok &= false;
344 }
345 }
346
347 if (pwd)
348 printf ("%s", pwd->pw_name);
349 else
350 printf ("%ju", (uintmax_t) uid);
351}
352
353/* Print all of the info about the user's user and group IDs. */
354

Callers 1

print_stuffFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected