/* * Copyright (c) 2018-2020, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include int main(int, char**) { char* tty = ttyname(0); if (!tty) { perror("Error"); return 1; } outln("{}", tty); return 0; }