mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:57:34 +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:
parent
4605b549d6
commit
c7d5ce6b5a
6 changed files with 28 additions and 5 deletions
13
Userland/tty.cpp
Normal file
13
Userland/tty.cpp
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue