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.
11 int puts(register const char * __restrict s
)
13 register FILE *stream
= stdout
; /* This helps bcc optimize. */
15 __STDIO_AUTO_THREADLOCK_VAR
;
17 __STDIO_AUTO_THREADLOCK(stream
);
19 /* Note: Don't try to optimize by switching to FBF until the newline.
20 * If the string itself contained a newline a write error occurred,
21 * then we could have a newline in the buffer of an LBF stream. */
23 /* Note: Nonportable as fputs need only return nonnegative on success. */
24 if ((n
= fputs_unlocked(s
, stream
)) != EOF
) {
26 if (__fputc_unlocked('\n', stream
) == EOF
) {
31 __STDIO_AUTO_THREADUNLOCK(stream
);