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(fputs_unlocked)
12 /* Experimentally off - libc_hidden_proto(strlen) */
13 libc_hidden_proto(fwrite_unlocked)
15 /* Note: The standard says fputs returns a nonnegative number on
16 * success. In this implementation, we return the length of the
17 * string written on success.
22 int fputs_unlocked(register const char * __restrict s,
23 FILE * __restrict stream)
27 return ((fwrite_unlocked(s, 1, n, stream) == n) ? n : EOF);
29 libc_hidden_def(fputs_unlocked)
31 #ifndef __UCLIBC_HAS_THREADS__
32 libc_hidden_proto(fputs)
33 strong_alias(fputs_unlocked,fputs)
34 libc_hidden_def(fputs)
37 #elif defined __UCLIBC_HAS_THREADS__
39 libc_hidden_proto(fputs)
40 int fputs(const char * __restrict s, register FILE * __restrict stream)
43 __STDIO_AUTO_THREADLOCK_VAR;
45 __STDIO_AUTO_THREADLOCK(stream);
47 retval = fputs_unlocked(s, stream);
49 __STDIO_AUTO_THREADUNLOCK(stream);
53 libc_hidden_def(fputs)