BSD 2 development
[unix-history] / src / whoami.c
CommitLineData
01995545
BJ
1/* Copyright (c) 1979 Regents of the University of California */
2#include <retrofit.h>
3#include <pwd.h>
4/*
5 * whoami
6 */
7struct passwd *getpwuid();
8
9main()
10{
11 register struct passwd *pp;
12
13 pp = getpwuid(getuid());
14 if (pp == 0) {
15 printf("Intruder alert.\n");
16 exit(1);
17 }
18 printf("%s\n", pp->pw_name);
19 exit(0);
20}