Serenity Operating System
1/*
2 * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#include <AK/Format.h>
8#include <LibMain/Main.h>
9#include <stdio.h>
10#include <unistd.h>
11
12ErrorOr<int> serenity_main(Main::Arguments)
13{
14 char* tty = ttyname(0);
15 if (!tty) {
16 perror("Error");
17 return 1;
18 }
19 outln("{}", tty);
20 return 0;
21}