2014-10-16 17:15:16 -04:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
2014-11-13 12:29:30 -05:00
|
|
|
|
2014-10-16 17:15:16 -04:00
|
|
|
#include "util.h"
|
|
|
|
|
2015-03-16 19:44:18 -04:00
|
|
|
static void
|
|
|
|
usage(void)
|
|
|
|
{
|
|
|
|
eprintf("usage: %s\n", argv0);
|
|
|
|
}
|
|
|
|
|
2014-10-16 17:15:16 -04:00
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
char *login;
|
|
|
|
|
2015-03-16 19:44:18 -04:00
|
|
|
argv0 = argv[0], argc--, argv++;
|
|
|
|
|
|
|
|
if (argc)
|
|
|
|
usage();
|
|
|
|
|
2014-10-16 17:15:16 -04:00
|
|
|
if ((login = getlogin()))
|
2014-10-17 10:39:14 -04:00
|
|
|
puts(login);
|
2014-10-16 17:15:16 -04:00
|
|
|
else
|
2015-03-16 19:44:18 -04:00
|
|
|
eprintf("no login name\n");
|
|
|
|
|
2014-10-16 17:15:16 -04:00
|
|
|
return 0;
|
|
|
|
}
|