serenity/Userland/tty.cpp

14 lines
198 B
C++
Raw Normal View History

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