Introduction
Introduction Statistics Contact Development Disclaimer Help
logname.c - sbase - suckless unix tools
git clone git://git.suckless.org/sbase
Log
Files
Refs
README
LICENSE
---
logname.c (422B)
---
1 /* See LICENSE file for copyright and license details. */
2 #include <stdio.h>
3 #include <unistd.h>
4
5 #include "util.h"
6
7 static void
8 usage(void)
9 {
10 eprintf("usage: %s\n", argv0);
11 }
12
13 int
14 main(int argc, char *argv[])
15 {
16 char *login;
17
18 argv0 = *argv, argv0 ? (argc--, argv++) : (void *)0;
19
20 if (argc)
21 usage();
22
23 if ((login = getlogin()))
24 puts(login);
25 else
26 eprintf("no login name\n");
27
28 return fshut(stdout, "<stdout>");
29 }
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.