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