2011-06-02 20:15:35 +00:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
2013-10-07 14:50:41 +00:00
|
|
|
#include <unistd.h>
|
2011-06-02 20:15:35 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2013-10-07 14:50:41 +00:00
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
static void
|
|
|
|
usage(void)
|
|
|
|
{
|
|
|
|
eprintf("usage: %s\n", argv0);
|
|
|
|
}
|
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;
|
|
|
|
|
2013-10-07 14:50:41 +00:00
|
|
|
ARGBEGIN {
|
|
|
|
default:
|
|
|
|
usage();
|
|
|
|
} ARGEND;
|
|
|
|
|
|
|
|
tty = ttyname(STDIN_FILENO);
|
|
|
|
puts(tty ? tty : "not a tty");
|
2013-10-07 15:41:55 +00:00
|
|
|
return tty ? EXIT_SUCCESS : EXIT_FAILURE;
|
2011-06-02 20:15:35 +00:00
|
|
|
}
|