projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
starting time of proc now timeval
[unix-history]
/
usr
/
src
/
old
/
whoami
/
whoami.c
static char
*
sccsid
=
"@(#)whoami.c 4.1 (Berkeley) %G%"
;
#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
);
}