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(__fputc_unlocked)
15 #undef putchar_unlocked
16 int putchar_unlocked(int c)
18 register FILE *stream = stdout;
20 return __PUTC_UNLOCKED_MACRO(c, stream);
23 #ifndef __UCLIBC_HAS_THREADS__
24 strong_alias(putchar_unlocked,putchar)
27 #elif defined __UCLIBC_HAS_THREADS__
31 register FILE *stream = stdout;
33 if (stream->__user_locking != 0) {
34 return __PUTC_UNLOCKED_MACRO(c, stream);
37 __STDIO_ALWAYS_THREADLOCK(stream);
38 retval = __PUTC_UNLOCKED_MACRO(c, stream);
39 __STDIO_ALWAYS_THREADUNLOCK(stream);