FENIX_coreutils/tty.c

15 lines
209 B
C
Raw Normal View History

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