2011-06-02 16:15:35 -04:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
2013-10-07 10:50:41 -04:00
|
|
|
#include <unistd.h>
|
2011-06-02 16:15:35 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
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");
|
2014-10-02 18:46:04 -04:00
|
|
|
return tty ? 0 : 1;
|
2011-06-02 16:15:35 -04:00
|
|
|
}
|