ladybird/Userland/tty.cpp
Andreas Kling c7d5ce6b5a Add a /bin/tty command that prints the current tty.
Also fix ttyname() syscall to include "/dev/" in the name.
2018-10-31 21:46:05 +01:00

14 lines
208 B
C++

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