| lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 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 |  | 
|  | 11 | char *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 | } |