summaryrefslogtreecommitdiff
path: root/Userland/Utilities/tty.cpp
blob: 2476070b04b0a2ebfccca86df0ad602e5b3158b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <AK/Format.h>
#include <stdio.h>
#include <unistd.h>

int main(int, char**)
{
    char* tty = ttyname(0);
    if (!tty) {
        perror("Error");
        return 1;
    }
    outln("{}", tty);
    return 0;
}