1 /* tty.c - Return tty name Author: Freeman P. Pascal IV */
3 /* Minor changes to make tty conform to POSIX1003.2 Draft10
4 Thomas Brupbacher (tobr@mw.lpc.ethz.ch) */
12 int main(int argc
, char **argv
);
20 tty_name
= ttyname(STDIN_FILENO
);
21 if ((argc
== 2) && (!strcmp(argv
[1], "-s")))
22 /* Do nothing - shhh! we're in silent mode */ ;
24 puts((tty_name
!= NULL
) ? tty_name
: "not a tty");
26 if (isatty(STDIN_FILENO
) == 0)