blob: 854c526ea0b49952c3522339017e3be1dcfcf960 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
2 *
3 * GNU Library General Public License (LGPL) version 2 or later.
4 *
5 * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
6 */
7
8#include "_stdio.h"
9
10
11char *ctermid(register char *s)
12{
13 static char sbuf[L_ctermid];
14
15#ifdef __BCC__
16 /* Currently elks doesn't support /dev/tty. */
17 if (!s) {
18 s = sbuf;
19 }
20 *s = 0;
21
22 return s;
23#else
24 /* glibc always returns /dev/tty for linux. */
25 return strcpy((s ? s : sbuf), "/dev/tty");
26#endif
27}