14 lines
168 B
C
14 lines
168 B
C
#include <unistd.h>
|
|
#include <stdio.h>
|
|
|
|
int main(void) {
|
|
char *tty = ttyname(STDIN_FILENO);
|
|
if (tty)
|
|
puts(tty);
|
|
|
|
else
|
|
puts("not a tty");
|
|
|
|
return tty == NULL;
|
|
}
|