15 lines
209 B
C
Executable file
15 lines
209 B
C
Executable file
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
int main() {
|
|
if(isatty(fileno(stdin))) {
|
|
printf("%s\n", ttyname(0));
|
|
return 0;
|
|
}
|
|
else {
|
|
printf("not a tty\n");
|
|
return 1;
|
|
}
|
|
}
|