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