Add a /bin/tty command that prints the current tty.

Also fix ttyname() syscall to include "/dev/" in the name.
This commit is contained in:
Andreas Kling 2018-10-31 21:45:36 +01:00
commit c7d5ce6b5a
Notes: sideshowbarker 2024-07-19 18:35:34 +09:00
6 changed files with 28 additions and 5 deletions

13
Userland/tty.cpp Normal file
View file

@ -0,0 +1,13 @@
#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;
}