repo.or.cz
/
4chanprog.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Added a basic implementation of wc.
[4chanprog.git]
/
coreutils
/
logname.c
blob
10b95c7f77a196eabe9c2a402f7be7d9811c9217
1
/* @logname.c */
2
#include <stdio.h>
3
#include <unistd.h>
4
#include <string.h>
5
#include <errno.h>
6
7
int
main
(
int
argc
,
char
**
argv
) {
8
char
*
name
;
9
if
(
name
=
getlogin
())
10
printf
(
"%s
\n
"
,
name
);
11
else
12
fprintf
(
stderr
,
"%s: could not get login name: %s
\n
"
,
argv
[
0
],
strerror
(
errno
));
13
return
!
name
;
14
}