5748432 [rkeene@sledge /home/rkeene/devel/mooselinux-0.0.19/src]$ cat -n whoami.c
 1 #include <stdio.h>
 2 #include <unistd.h>
 3 #include <stdlib.h>
 4 #include <pwd.h>
 5 #include <sys/types.h>
 6 #include "version.h"
 7 #include "whoami.h"
 8 
 9 int whoami_main (int argc, char **argv) {
10     struct passwd *pwent;
11 
12     pwent=getpwuid(getuid());
13 
14     write(STDOUT_FILENO,pwent->pw_name,strlen(pwent->pw_name));
15     write(STDOUT_FILENO,"\n",1);
16     return(0);
17 }
5748433 [rkeene@sledge /home/rkeene/devel/mooselinux-0.0.19/src]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 2000-04-27 22:24:52