micro-utils/coreutils/tty.c
Your Name 7eed71d9b2 mk
2023-10-13 15:34:16 +03:00

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