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)
|
|
|
|
{
|
|
|
|
eprintf("usage: %s\n", argv0);
|
|
|
|
}
|
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;
|
|
|
|
|
2013-10-07 10:50:41 -04:00
|
|
|
ARGBEGIN {
|
|
|
|
default:
|
|
|
|
usage();
|
|
|
|
} ARGEND;
|
|
|
|
|
|
|
|
tty = ttyname(STDIN_FILENO);
|
|
|
|
puts(tty ? tty : "not a tty");
|
2015-02-07 16:00:28 -05:00
|
|
|
|
2014-10-02 18:46:04 -04:00
|
|
|
return tty ? 0 : 1;
|
2011-06-02 16:15:35 -04:00
|
|
|
}
|