1 /* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
3 * GNU Library General Public License (LGPL) version 2 or later.
5 * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
14 /* the only use of the hidden getchar_unlocked is in gets.c */
15 #undef getchar_unlocked
16 int getchar_unlocked(void)
18 register FILE *stream
= stdin
;
20 return __GETC_UNLOCKED_MACRO(stream
);
22 libc_hidden_def(getchar_unlocked
)
24 #ifndef __UCLIBC_HAS_THREADS__
25 strong_alias(getchar_unlocked
,getchar
)
28 #elif defined __UCLIBC_HAS_THREADS__
32 register FILE *stream
= stdin
;
34 if (stream
->__user_locking
!= 0) {
35 return __GETC_UNLOCKED_MACRO(stream
);
38 __STDIO_ALWAYS_THREADLOCK(stream
);
39 retval
= __GETC_UNLOCKED_MACRO(stream
);
40 __STDIO_ALWAYS_THREADUNLOCK(stream
);