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.
10 libc_hidden_proto(__fgetc_unlocked)
15 #undef getchar_unlocked
16 int getchar_unlocked(void)
18 register FILE *stream = stdin;
20 return __GETC_UNLOCKED_MACRO(stream);
23 #ifndef __UCLIBC_HAS_THREADS__
24 strong_alias(getchar_unlocked,getchar)
27 #elif defined __UCLIBC_HAS_THREADS__
31 register FILE *stream = stdin;
33 if (stream->__user_locking != 0) {
34 return __GETC_UNLOCKED_MACRO(stream);
37 __STDIO_ALWAYS_THREADLOCK(stream);
38 retval = __GETC_UNLOCKED_MACRO(stream);
39 __STDIO_ALWAYS_THREADUNLOCK(stream);