2020-01-18 11:38:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 11:38:21 +03:00
|
|
|
*/
|
|
|
|
|
2021-05-31 17:43:25 +03:00
|
|
|
#include <AK/Format.h>
|
2022-03-29 23:14:51 +03:00
|
|
|
#include <LibMain/Main.h>
|
2018-11-09 12:18:04 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
2018-10-31 23:45:36 +03:00
|
|
|
|
2022-03-29 23:14:51 +03:00
|
|
|
ErrorOr<int> serenity_main(Main::Arguments)
|
2018-10-31 23:45:36 +03:00
|
|
|
{
|
|
|
|
char* tty = ttyname(0);
|
|
|
|
if (!tty) {
|
|
|
|
perror("Error");
|
|
|
|
return 1;
|
|
|
|
}
|
2021-05-31 17:43:25 +03:00
|
|
|
outln("{}", tty);
|
2018-10-31 23:45:36 +03:00
|
|
|
return 0;
|
|
|
|
}
|