1: #include <stdio.h>
   2: #include <pwd.h>
   3: #include <grp.h>
   4: struct passwd *getpwuid();
   5: struct group  *getgrgid();
   6: 
   7: main()
   8: {
   9:     struct passwd *pp;
  10:     struct group  *gn;
  11:     int uid, gid;
  12: 
  13:     pp=getpwuid(uid = getuid());
  14:     gn=getgrgid(gid = getgid());
  15: 
  16:     if (pp == NULL)
  17:         printf("%d", uid);
  18:     else
  19:         printf("%s", pp->pw_name);
  20: 
  21:     if (gn == NULL)
  22:         printf(".%d\n", gid);
  23:     else
  24:         printf(".%s\n", gn->gr_name);
  25: 
  26: }

Defined functions

main defined in line 7; never used
Last modified: 1983-03-15
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 656
Valid CSS Valid XHTML 1.0 Strict