2011-06-02 16:15:35 -04:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
#include <stdio.h>
|
2014-11-13 13:54:28 -05:00
|
|
|
#include <unistd.h>
|
2014-11-13 12:29:30 -05:00
|
|
|
|
2013-10-07 10:50:41 -04:00
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
static void
|
|
|
|
usage(void)
|
|
|
|
{
|
2018-07-07 03:26:20 -04:00
|
|
|
enprintf(2, "usage: %s\n", argv0);
|
2013-10-07 10:50:41 -04:00
|
|
|
}
|
2011-06-02 16:15:35 -04:00
|
|
|
|
|
|
|
int
|
2013-10-07 10:50:41 -04:00
|
|
|
main(int argc, char *argv[])
|
2011-06-02 16:15:35 -04:00
|
|
|
{
|
|
|
|
char *tty;
|
|
|
|
|
2019-06-28 03:18:48 -04:00
|
|
|
ARGBEGIN {
|
|
|
|
default:
|
|
|
|
usage();
|
|
|
|
} ARGEND
|
2013-10-07 10:50:41 -04:00
|
|
|
|
2015-02-28 13:59:34 -05:00
|
|
|
if (argc)
|
|
|
|
usage();
|
|
|
|
|
2013-10-07 10:50:41 -04:00
|
|
|
tty = ttyname(STDIN_FILENO);
|
|
|
|
puts(tty ? tty : "not a tty");
|
2015-02-07 16:00:28 -05:00
|
|
|
|
2018-07-07 03:26:20 -04:00
|
|
|
enfshut(2, stdout, "<stdout>");
|
|
|
|
return !tty;
|
2011-06-02 16:15:35 -04:00
|
|
|
}
|