ladybird/Userland/tty.cpp

14 lines
208 B
C++
Raw Normal View History

#include <LibC/stdio.h>
#include <LibC/unistd.h>
int main(int, char**)
{
char* tty = ttyname(0);
if (!tty) {
perror("Error");
return 1;
}
printf("%s\n", tty);
return 0;
}