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