OSDN Git Service

hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing...
[uclinux-h8/uClibc.git] / libc / stdio / ctermid.c
1 /* 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 libc_hidden_proto(strcpy)
11
12 char *ctermid(register char *s)
13 {
14         static char sbuf[L_ctermid];
15
16 #ifdef __BCC__
17         /* Currently elks doesn't support /dev/tty. */
18         if (!s) {
19                 s = sbuf;
20         }
21         *s = 0;
22
23         return s;
24 #else
25         /* glibc always returns /dev/tty for linux. */
26         return strcpy((s ? s : sbuf), "/dev/tty");
27 #endif
28 }