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.
12 /* Note: The standard says fputs returns a nonnegative number on
13 * success. In this implementation, we return the length of the
14 * string written on success.
19 int fputs_unlocked(register const char * __restrict s
,
20 FILE * __restrict stream
)
24 return ((fwrite_unlocked(s
, 1, n
, stream
) == n
) ? n
: EOF
);
26 libc_hidden_def(fputs_unlocked
)
28 #ifndef __UCLIBC_HAS_THREADS__
29 strong_alias(fputs_unlocked
,fputs
)
30 libc_hidden_def(fputs
)
33 #elif defined __UCLIBC_HAS_THREADS__
35 int fputs(const char * __restrict s
, register FILE * __restrict stream
)
38 __STDIO_AUTO_THREADLOCK_VAR
;
40 __STDIO_AUTO_THREADLOCK(stream
);
42 retval
= fputs_unlocked(s
, stream
);
44 __STDIO_AUTO_THREADUNLOCK(stream
);
48 libc_hidden_def(fputs
)