home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
minnie.tuhs.org
/
unixen.tar
/
unixen
/
PDP-11
/
Distributions
/
ucb
/
spencer_2bsd.tar.gz
/
2bsd.tar
/
src
/
whoami.c
< prev
next >
Wrap
C/C++ Source or Header
|
1980-02-17
|
317b
|
21 lines
/* Copyright (c) 1979 Regents of the University of California */
#include <retrofit.h>
#include <pwd.h>
/*
* whoami
*/
struct passwd *getpwuid();
main()
{
register struct passwd *pp;
pp = getpwuid(getuid());
if (pp == 0) {
printf("Intruder alert.\n");
exit(1);
}
printf("%s\n", pp->pw_name);
exit(0);
}