summaryrefslogtreecommitdiff
path: root/Userland/tty.cpp
blob: 2d8f3800841780b4c6001ea2d78a30f02cd79c4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#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;
}