(file) Return to getuid.c CVS log (file) (dir) Up to [Development] / JSOC

File: [Development] / JSOC / Attic / getuid.c (download)
Revision: 1.2, Fri Nov 15 17:12:06 2013 UTC (4 years, 11 months ago) by arta
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Files no longer needed - the localization logic was consolidated in localize.py

#include <sys/types.h>
#include <pwd.h>
#include <stdio.h>

main (int argc, char **argv) {
  uid_t uid = -1;
  char *who = argv[1];
  if (who) {
    struct passwd *pwd = getpwnam (who);
    if (pwd) uid = pwd->pw_uid;
  }
  printf ("%d\n", (unsigned int)uid);
  return 0;
}

Karen Tian
Powered by
ViewCVS 0.9.4