FENIX_coreutils/tty.c

14 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;
}
}