1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:17:44 +00:00

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
parent 4605b549d6
commit c7d5ce6b5a
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;
}