This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] unlocked stdio extensions


This is a first draft of an implementation of the 19 unlocked stdio extensions:

http://man7.org/linux/man-pages/man3/unlocked_stdio.3.html

These are used most notably by GCC when available.

There are a few points that could use clarification:

* are there any CHECK_INITs that are missing or unnecessary in these functions?

* should the documentation of the _unlocked variants be separate, or merged with the locking variants (as the _r variants do)?

--
Yaakov Selkowitz
Associate Software Engineer, ARM
Red Hat, Inc.
2014-12-15  Yaakov Selkowitz  <yselkowi@...>

	* libc/include/stdio.h (clearerr_unlocked, feof_unlocked,
	ferror_unlocked, fflush_unlocked, fgetc_unlocked, fgets_unlocked,
	fileno_unlocked, fputc_unlocked, fputs_unlocked, fread_unlocked,
	fwrite_unlocked): Declare.
	* libc/include/wchar.h (fgetwc_unlocked, fgetws_unlocked,
	fputwc_unlocked, fputws_unlocked, getwc_unlocked, getwchar_unlocked,
	putwc_unlocked, putwchar_unlocked): Declare.
	* libc/stdio/Makefile.am (ELIX_4_SOURCES): Add clearerr_u.c,
	feof_u.c, ferror_u.c, fflush_u.c, fgetc_u.c, fgets_u.c, fgetwc_u.c,
	fgetws_u.c, fileno_u.c, fputc_u.c, fputs_u.c, fputwc_u.c, fputws_u.c,
	fread_u.c, fwrite_u.c, getwc_u.c, getwchar_u.c, putwc_u.c, putwchar_u.c.
	(CHEWOUT_FILES): Add corresponding .def files.
	* libc/stdio/Makefile.in: Regenerate.
	* libc/stdio/clearerr_u.c: New file.
	* libc/stdio/feof_u.c: New file.
	* libc/stdio/ferror_u.c: New file.
	* libc/stdio/fflush_u.c: New file.
	* libc/stdio/fgetc_u.c: New file.
	* libc/stdio/fgets.c: Add FGETS_UNLOCKED overrides.
	* libc/stdio/fgets_u.c: New file.
	* libc/stdio/fgetwc.c (__fgetwc): Make non-static.
	* libc/stdio/fgetwc_u.c: New file.
	* libc/stdio/fgetws.c: Add FGETWS_UNLOCKED overrides.
	* libc/stdio/fgetws_u.c: New file.
	* libc/stdio/fileno_u.c: New file.
	* libc/stdio/fputc_u.c: New file.
	* libc/stdio/fputs.c: Add FPUTS_UNLOCKED overrides.
	* libc/stdio/fputs_u.c: New file.
	* libc/stdio/fputwc.c (__fputwc): Make non-static.
	* libc/stdio/fputwc_u.c: New file.
	* libc/stdio/fputws.c: Add FPUTWS_UNLOCKED overrides.
	* libc/stdio/fputws_u.c: New file.
	* libc/stdio/fread.c: Add FREAD_UNLOCKED overrides.
	* libc/stdio/fread_u.c: New file.
	* libc/stdio/fwrite.c: Add FWRITE_UNLOCKED overrides.
	* libc/stdio/fwrite_u.c: New file.
	* libc/stdio/getwc_u.c: New file.
	* libc/stdio/getwchar_u.c: New file.
	* libc/stdio/local.h (__fgetwc, __fputwc): Declare.
	* libc/stdio/putwc_u.c: New file.
	* libc/stdio/putwchar_u.c: New file.

Index: libc/include/stdio.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/stdio.h,v
retrieving revision 1.73
diff -u -p -r1.73 stdio.h
--- libc/include/stdio.h	15 Dec 2014 18:22:56 -0000	1.73
+++ libc/include/stdio.h	15 Dec 2014 18:45:56 -0000
@@ -486,6 +486,23 @@ int	_EXFUN(fpurge, (FILE *));
 ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *));
 ssize_t _EXFUN(__getline, (char **, size_t *, FILE *));
 
+#if __BSD_VISIBLE
+void	_EXFUN(clearerr_unlocked, (FILE *));
+int	_EXFUN(feof_unlocked, (FILE *));
+int	_EXFUN(ferror_unlocked, (FILE *));
+int	_EXFUN(fileno_unlocked, (FILE *));
+int	_EXFUN(fflush_unlocked, (FILE *));
+int	_EXFUN(fgetc_unlocked, (FILE *));
+int	_EXFUN(fputc_unlocked, (int, FILE *));
+size_t	_EXFUN(fread_unlocked, (_PTR __restrict, size_t _size, size_t _n, FILE *__restrict));
+size_t	_EXFUN(fwrite_unlocked, (const _PTR __restrict , size_t _size, size_t _n, FILE *));
+#endif
+
+#if __GNU_VISIBLE
+char *  _EXFUN(fgets_unlocked, (char *__restrict, int, FILE *__restrict));
+int	_EXFUN(fputs_unlocked, (const char *__restrict, FILE *__restrict));
+#endif
+
 #ifdef __LARGE64_FILES
 #if !defined(__CYGWIN__) || defined(_COMPILING_NEWLIB)
 FILE *	_EXFUN(fdopen64, (int, const char *));
@@ -659,6 +676,10 @@ _ELIDABLE_INLINE int __sputc_r(struct _r
 #define	feof(p)		__sfeof(p)
 #define	ferror(p)	__sferror(p)
 #define	clearerr(p)	__sclearerr(p)
+
+#define	feof_unlocked(p)	__sfeof(p)
+#define	ferror_unlocked(p)	__sferror(p)
+#define	clearerr_unlocked(p)	__sclearerr(p)
 #endif
 
 #if 0 /*ndef __STRICT_ANSI__ - FIXME: must initialize stdio first, use fn */
@@ -688,6 +709,9 @@ _ELIDABLE_INLINE int __sputc_r(struct _r
 #define	getchar()	getc(stdin)
 #define	putchar(x)	putc(x, stdout)
 
+#define	getchar_unlocked()	getc_unlocked(stdin)
+#define	putchar_unlocked(x)	putc_unlocked(x, stdout)
+
 _END_STD_C
 
 #endif /* _STDIO_H_ */
Index: libc/include/wchar.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/wchar.h,v
retrieving revision 1.35
diff -u -p -r1.35 wchar.h
--- libc/include/wchar.h	12 May 2014 17:02:11 -0000	1.35
+++ libc/include/wchar.h	15 Dec 2014 18:45:56 -0000
@@ -170,6 +170,15 @@ wint_t _EXFUN(_putwc_r, (struct _reent *
 wint_t _EXFUN(_putwchar_r, (struct _reent *, wchar_t));
 wint_t _EXFUN (_ungetwc_r, (struct _reent *, wint_t wc, __FILE *));
 
+wint_t _EXFUN(fgetwc_unlocked, (__FILE *));
+wchar_t *_EXFUN(fgetws_unlocked, (wchar_t *__restrict, int, __FILE *__restrict));
+wint_t _EXFUN(fputwc_unlocked, (wchar_t, __FILE *));
+int _EXFUN(fputws_unlocked, (const wchar_t *__restrict, __FILE *__restrict));
+wint_t _EXFUN(getwc_unlocked, (__FILE *));
+wint_t _EXFUN(getwchar_unlocked, (void));
+wint_t _EXFUN(putwc_unlocked, (wchar_t, __FILE *));
+wint_t _EXFUN(putwchar_unlocked, (wchar_t));
+
 __FILE *_EXFUN (open_wmemstream, (wchar_t **, size_t *));
 __FILE *_EXFUN (_open_wmemstream_r, (struct _reent *, wchar_t **, size_t *));
 
@@ -220,6 +229,11 @@ int	_EXFUN(_wscanf_r, (struct _reent *, 
 #define getwchar()	fgetwc(_REENT->_stdin)
 #define putwchar(wc)	fputwc((wc), _REENT->_stdout)
 
+#define getwc_unlocked(fp)	fgetwc_unlocked(fp)
+#define putwc_unlocked(wc,fp)	fputwc_unlocked((wc), (fp))
+#define getwchar_unlocked()	fgetwc_unlocked(_REENT->_stdin)
+#define putwchar_unlocked(wc)	fputwc_unlocked((wc), _REENT->_stdout)
+
 _END_STD_C
 
 #endif /* _WCHAR_H_ */
Index: libc/stdio/Makefile.am
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/Makefile.am,v
retrieving revision 1.37
diff -u -p -r1.37 Makefile.am
--- libc/stdio/Makefile.am	15 Dec 2014 18:22:55 -0000	1.37
+++ libc/stdio/Makefile.am	15 Dec 2014 18:45:56 -0000
@@ -138,24 +138,43 @@ endif !NEWLIB_NANO_FORMATTED_IO
 ELIX_4_SOURCES = \
 	$(ELIX_4_INT_FORMATTED_IO_SOURCES) \
 	asnprintf.c		\
+	clearerr_u.c		\
 	dprintf.c		\
+	feof_u.c		\
+	ferror_u.c		\
+	fflush_u.c		\
+	fgetc_u.c		\
+	fgets_u.c		\
 	fgetwc.c		\
+	fgetwc_u.c		\
 	fgetws.c		\
+	fgetws_u.c		\
+	fileno_u.c		\
 	fmemopen.c		\
 	fopencookie.c		\
 	fpurge.c		\
+	fputc_u.c		\
+	fputs_u.c		\
 	fputwc.c		\
+	fputwc_u.c		\
 	fputws.c		\
+	fputws_u.c		\
+	fread_u.c		\
 	fsetlocking.c		\
 	funopen.c		\
 	fwide.c			\
 	fwprintf.c		\
+	fwrite_u.c		\
 	fwscanf.c		\
 	getwc.c			\
+	getwc_u.c		\
 	getwchar.c		\
+	getwchar_u.c		\
 	open_memstream.c	\
 	putwc.c			\
+	putwc_u.c		\
 	putwchar.c		\
+	putwchar_u.c		\
 	stdio_ext.c		\
 	swprintf.c		\
 	swscanf.c		\
@@ -334,28 +353,42 @@ endif
 CHEWOUT_FILES = \
 	$(CHEWOUT_INT_FORMATTED_IO_FILES)	\
 	clearerr.def		\
+	clearerr_u.def		\
 	dprintf.def		\
 	fclose.def		\
 	fcloseall.def		\
 	fdopen.def		\
 	feof.def		\
+	feof_u.def		\
 	ferror.def		\
+	ferror_u.def		\
 	fflush.def		\
+	fflush_u.def		\
 	fgetc.def		\
+	fgetc_u.def		\
 	fgetpos.def		\
 	fgets.def		\
+	fgets_u.def		\
 	fgetwc.def		\
+	fgetwc_u.def		\
 	fgetws.def		\
+	fgetws_u.def		\
 	fileno.def		\
+	fileno_u.def		\
 	fmemopen.def		\
 	fopen.def		\
 	fopencookie.def		\
 	fpurge.def		\
 	fputc.def		\
+	fputc_u.def		\
 	fputs.def		\
+	fputs_u.def		\
 	fputwc.def		\
+	fputwc_u.def		\
 	fputws.def		\
+	fputws_u.def		\
 	fread.def		\
+	fread_u.def		\
 	freopen.def		\
 	fseek.def		\
 	fsetlocking.def		\
@@ -364,6 +397,7 @@ CHEWOUT_FILES = \
 	funopen.def		\
 	fwide.def		\
 	fwrite.def		\
+	fwrite_u.def		\
 	getc.def		\
 	getc_u.def		\
 	getchar.def		\
@@ -373,7 +407,9 @@ CHEWOUT_FILES = \
 	gets.def		\
 	getw.def		\
 	getwc.def		\
+	getwc_u.def		\
 	getwchar.def		\
+	getwchar_u.def		\
 	mktemp.def		\
 	open_memstream.def	\
 	perror.def		\
@@ -384,7 +420,9 @@ CHEWOUT_FILES = \
 	puts.def		\
 	putw.def		\
 	putwc.def		\
+	putwc_u.def		\
 	putwchar.def		\
+	putwchar_u.def		\
 	remove.def		\
 	rename.def		\
 	rewind.def		\
Index: libc/stdio/Makefile.in
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/Makefile.in,v
retrieving revision 1.58
diff -u -p -r1.58 Makefile.in
--- libc/stdio/Makefile.in	15 Dec 2014 18:22:55 -0000	1.58
+++ libc/stdio/Makefile.in	15 Dec 2014 18:45:57 -0000
@@ -135,24 +135,43 @@ am__objects_2 = $(am__objects_1) lib_a-c
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@NEWLIB_NANO_FORMATTED_IO_FALSE@	lib_a-vasniprintf.$(OBJEXT)
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_6 = $(am__objects_5) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-asnprintf.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-clearerr_u.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-dprintf.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-feof_u.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-ferror_u.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fflush_u.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fgetc_u.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fgets_u.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fgetwc.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fgetwc_u.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fgetws.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fgetws_u.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fileno_u.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fmemopen.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fopencookie.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fpurge.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fputc_u.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fputs_u.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fputwc.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fputwc_u.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fputws.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fputws_u.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fread_u.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fsetlocking.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-funopen.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fwide.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fwprintf.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fwrite_u.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-fwscanf.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-getwc.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-getwc_u.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-getwchar.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-getwchar_u.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-open_memstream.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-putwc.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-putwc_u.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-putwchar.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-putwchar_u.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-stdio_ext.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-swprintf.$(OBJEXT) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-swscanf.$(OBJEXT) \
@@ -199,24 +218,43 @@ am__objects_8 = $(am__objects_7) clearer
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@NEWLIB_NANO_FORMATTED_IO_FALSE@	vasniprintf.lo
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_12 = $(am__objects_11) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	asnprintf.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	clearerr_u.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	dprintf.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	feof_u.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	ferror_u.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fflush_u.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fgetc_u.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fgets_u.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fgetwc.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fgetwc_u.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fgetws.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fgetws_u.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fileno_u.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fmemopen.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fopencookie.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fpurge.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fputc_u.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fputs_u.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fputwc.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fputwc_u.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fputws.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fputws_u.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fread_u.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fsetlocking.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	funopen.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fwide.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fwprintf.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fwrite_u.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fwscanf.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	getwc.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	getwc_u.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	getwchar.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	getwchar_u.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	open_memstream.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	putwc.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	putwc_u.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	putwchar.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	putwchar_u.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	stdio_ext.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	swprintf.lo \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	swscanf.lo \
@@ -508,24 +546,43 @@ GENERAL_SOURCES = \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ELIX_4_SOURCES = \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	$(ELIX_4_INT_FORMATTED_IO_SOURCES) \
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	asnprintf.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	clearerr_u.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	dprintf.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	feof_u.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	ferror_u.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fflush_u.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fgetc_u.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fgets_u.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fgetwc.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fgetwc_u.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fgetws.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fgetws_u.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fileno_u.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fmemopen.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fopencookie.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fpurge.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fputc_u.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fputs_u.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fputwc.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fputwc_u.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fputws.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fputws_u.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fread_u.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fsetlocking.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	funopen.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fwide.c			\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fwprintf.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fwrite_u.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	fwscanf.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	getwc.c			\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	getwc_u.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	getwchar.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	getwchar_u.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	open_memstream.c	\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	putwc.c			\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	putwc_u.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	putwchar.c		\
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	putwchar_u.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	stdio_ext.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	swprintf.c		\
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	swscanf.c		\
@@ -610,28 +667,42 @@ libstdio_la_LDFLAGS = -Xcompiler -nostdl
 CHEWOUT_FILES = \
 	$(CHEWOUT_INT_FORMATTED_IO_FILES)	\
 	clearerr.def		\
+	clearerr_u.def		\
 	dprintf.def		\
 	fclose.def		\
 	fcloseall.def		\
 	fdopen.def		\
 	feof.def		\
+	feof_u.def		\
 	ferror.def		\
+	ferror_u.def		\
 	fflush.def		\
+	fflush_u.def		\
 	fgetc.def		\
+	fgetc_u.def		\
 	fgetpos.def		\
 	fgets.def		\
+	fgets_u.def		\
 	fgetwc.def		\
+	fgetwc_u.def		\
 	fgetws.def		\
+	fgetws_u.def		\
 	fileno.def		\
+	fileno_u.def		\
 	fmemopen.def		\
 	fopen.def		\
 	fopencookie.def		\
 	fpurge.def		\
 	fputc.def		\
+	fputc_u.def		\
 	fputs.def		\
+	fputs_u.def		\
 	fputwc.def		\
+	fputwc_u.def		\
 	fputws.def		\
+	fputws_u.def		\
 	fread.def		\
+	fread_u.def		\
 	freopen.def		\
 	fseek.def		\
 	fsetlocking.def		\
@@ -640,6 +711,7 @@ CHEWOUT_FILES = \
 	funopen.def		\
 	fwide.def		\
 	fwrite.def		\
+	fwrite_u.def		\
 	getc.def		\
 	getc_u.def		\
 	getchar.def		\
@@ -649,7 +721,9 @@ CHEWOUT_FILES = \
 	gets.def		\
 	getw.def		\
 	getwc.def		\
+	getwc_u.def		\
 	getwchar.def		\
+	getwchar_u.def		\
 	mktemp.def		\
 	open_memstream.def	\
 	perror.def		\
@@ -660,7 +734,9 @@ CHEWOUT_FILES = \
 	puts.def		\
 	putw.def		\
 	putwc.def		\
+	putwc_u.def		\
 	putwchar.def		\
+	putwchar_u.def		\
 	remove.def		\
 	rename.def		\
 	rewind.def		\
@@ -1311,24 +1387,78 @@ lib_a-asnprintf.o: asnprintf.c
 lib_a-asnprintf.obj: asnprintf.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-asnprintf.obj `if test -f 'asnprintf.c'; then $(CYGPATH_W) 'asnprintf.c'; else $(CYGPATH_W) '$(srcdir)/asnprintf.c'; fi`
 
+lib_a-clearerr_u.o: clearerr_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-clearerr_u.o `test -f 'clearerr_u.c' || echo '$(srcdir)/'`clearerr_u.c
+
+lib_a-clearerr_u.obj: clearerr_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-clearerr_u.obj `if test -f 'clearerr_u.c'; then $(CYGPATH_W) 'clearerr_u.c'; else $(CYGPATH_W) '$(srcdir)/clearerr_u.c'; fi`
+
 lib_a-dprintf.o: dprintf.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-dprintf.o `test -f 'dprintf.c' || echo '$(srcdir)/'`dprintf.c
 
 lib_a-dprintf.obj: dprintf.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-dprintf.obj `if test -f 'dprintf.c'; then $(CYGPATH_W) 'dprintf.c'; else $(CYGPATH_W) '$(srcdir)/dprintf.c'; fi`
 
+lib_a-feof_u.o: feof_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-feof_u.o `test -f 'feof_u.c' || echo '$(srcdir)/'`feof_u.c
+
+lib_a-feof_u.obj: feof_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-feof_u.obj `if test -f 'feof_u.c'; then $(CYGPATH_W) 'feof_u.c'; else $(CYGPATH_W) '$(srcdir)/feof_u.c'; fi`
+
+lib_a-ferror_u.o: ferror_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ferror_u.o `test -f 'ferror_u.c' || echo '$(srcdir)/'`ferror_u.c
+
+lib_a-ferror_u.obj: ferror_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ferror_u.obj `if test -f 'ferror_u.c'; then $(CYGPATH_W) 'ferror_u.c'; else $(CYGPATH_W) '$(srcdir)/ferror_u.c'; fi`
+
+lib_a-fflush_u.o: fflush_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fflush_u.o `test -f 'fflush_u.c' || echo '$(srcdir)/'`fflush_u.c
+
+lib_a-fflush_u.obj: fflush_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fflush_u.obj `if test -f 'fflush_u.c'; then $(CYGPATH_W) 'fflush_u.c'; else $(CYGPATH_W) '$(srcdir)/fflush_u.c'; fi`
+
+lib_a-fgetc_u.o: fgetc_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetc_u.o `test -f 'fgetc_u.c' || echo '$(srcdir)/'`fgetc_u.c
+
+lib_a-fgetc_u.obj: fgetc_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetc_u.obj `if test -f 'fgetc_u.c'; then $(CYGPATH_W) 'fgetc_u.c'; else $(CYGPATH_W) '$(srcdir)/fgetc_u.c'; fi`
+
+lib_a-fgets_u.o: fgets_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgets_u.o `test -f 'fgets_u.c' || echo '$(srcdir)/'`fgets_u.c
+
+lib_a-fgets_u.obj: fgets_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgets_u.obj `if test -f 'fgets_u.c'; then $(CYGPATH_W) 'fgets_u.c'; else $(CYGPATH_W) '$(srcdir)/fgets_u.c'; fi`
+
 lib_a-fgetwc.o: fgetwc.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetwc.o `test -f 'fgetwc.c' || echo '$(srcdir)/'`fgetwc.c
 
 lib_a-fgetwc.obj: fgetwc.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetwc.obj `if test -f 'fgetwc.c'; then $(CYGPATH_W) 'fgetwc.c'; else $(CYGPATH_W) '$(srcdir)/fgetwc.c'; fi`
 
+lib_a-fgetwc_u.o: fgetwc_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetwc_u.o `test -f 'fgetwc_u.c' || echo '$(srcdir)/'`fgetwc_u.c
+
+lib_a-fgetwc_u.obj: fgetwc_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetwc_u.obj `if test -f 'fgetwc_u.c'; then $(CYGPATH_W) 'fgetwc_u.c'; else $(CYGPATH_W) '$(srcdir)/fgetwc_u.c'; fi`
+
 lib_a-fgetws.o: fgetws.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetws.o `test -f 'fgetws.c' || echo '$(srcdir)/'`fgetws.c
 
 lib_a-fgetws.obj: fgetws.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetws.obj `if test -f 'fgetws.c'; then $(CYGPATH_W) 'fgetws.c'; else $(CYGPATH_W) '$(srcdir)/fgetws.c'; fi`
 
+lib_a-fgetws_u.o: fgetws_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetws_u.o `test -f 'fgetws_u.c' || echo '$(srcdir)/'`fgetws_u.c
+
+lib_a-fgetws_u.obj: fgetws_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetws_u.obj `if test -f 'fgetws_u.c'; then $(CYGPATH_W) 'fgetws_u.c'; else $(CYGPATH_W) '$(srcdir)/fgetws_u.c'; fi`
+
+lib_a-fileno_u.o: fileno_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fileno_u.o `test -f 'fileno_u.c' || echo '$(srcdir)/'`fileno_u.c
+
+lib_a-fileno_u.obj: fileno_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fileno_u.obj `if test -f 'fileno_u.c'; then $(CYGPATH_W) 'fileno_u.c'; else $(CYGPATH_W) '$(srcdir)/fileno_u.c'; fi`
+
 lib_a-fmemopen.o: fmemopen.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fmemopen.o `test -f 'fmemopen.c' || echo '$(srcdir)/'`fmemopen.c
 
@@ -1347,18 +1477,48 @@ lib_a-fpurge.o: fpurge.c
 lib_a-fpurge.obj: fpurge.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fpurge.obj `if test -f 'fpurge.c'; then $(CYGPATH_W) 'fpurge.c'; else $(CYGPATH_W) '$(srcdir)/fpurge.c'; fi`
 
+lib_a-fputc_u.o: fputc_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputc_u.o `test -f 'fputc_u.c' || echo '$(srcdir)/'`fputc_u.c
+
+lib_a-fputc_u.obj: fputc_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputc_u.obj `if test -f 'fputc_u.c'; then $(CYGPATH_W) 'fputc_u.c'; else $(CYGPATH_W) '$(srcdir)/fputc_u.c'; fi`
+
+lib_a-fputs_u.o: fputs_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputs_u.o `test -f 'fputs_u.c' || echo '$(srcdir)/'`fputs_u.c
+
+lib_a-fputs_u.obj: fputs_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputs_u.obj `if test -f 'fputs_u.c'; then $(CYGPATH_W) 'fputs_u.c'; else $(CYGPATH_W) '$(srcdir)/fputs_u.c'; fi`
+
 lib_a-fputwc.o: fputwc.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputwc.o `test -f 'fputwc.c' || echo '$(srcdir)/'`fputwc.c
 
 lib_a-fputwc.obj: fputwc.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputwc.obj `if test -f 'fputwc.c'; then $(CYGPATH_W) 'fputwc.c'; else $(CYGPATH_W) '$(srcdir)/fputwc.c'; fi`
 
+lib_a-fputwc_u.o: fputwc_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputwc_u.o `test -f 'fputwc_u.c' || echo '$(srcdir)/'`fputwc_u.c
+
+lib_a-fputwc_u.obj: fputwc_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputwc_u.obj `if test -f 'fputwc_u.c'; then $(CYGPATH_W) 'fputwc_u.c'; else $(CYGPATH_W) '$(srcdir)/fputwc_u.c'; fi`
+
 lib_a-fputws.o: fputws.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputws.o `test -f 'fputws.c' || echo '$(srcdir)/'`fputws.c
 
 lib_a-fputws.obj: fputws.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputws.obj `if test -f 'fputws.c'; then $(CYGPATH_W) 'fputws.c'; else $(CYGPATH_W) '$(srcdir)/fputws.c'; fi`
 
+lib_a-fputws_u.o: fputws_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputws_u.o `test -f 'fputws_u.c' || echo '$(srcdir)/'`fputws_u.c
+
+lib_a-fputws_u.obj: fputws_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputws_u.obj `if test -f 'fputws_u.c'; then $(CYGPATH_W) 'fputws_u.c'; else $(CYGPATH_W) '$(srcdir)/fputws_u.c'; fi`
+
+lib_a-fread_u.o: fread_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fread_u.o `test -f 'fread_u.c' || echo '$(srcdir)/'`fread_u.c
+
+lib_a-fread_u.obj: fread_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fread_u.obj `if test -f 'fread_u.c'; then $(CYGPATH_W) 'fread_u.c'; else $(CYGPATH_W) '$(srcdir)/fread_u.c'; fi`
+
 lib_a-fsetlocking.o: fsetlocking.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fsetlocking.o `test -f 'fsetlocking.c' || echo '$(srcdir)/'`fsetlocking.c
 
@@ -1383,6 +1543,12 @@ lib_a-fwprintf.o: fwprintf.c
 lib_a-fwprintf.obj: fwprintf.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fwprintf.obj `if test -f 'fwprintf.c'; then $(CYGPATH_W) 'fwprintf.c'; else $(CYGPATH_W) '$(srcdir)/fwprintf.c'; fi`
 
+lib_a-fwrite_u.o: fwrite_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fwrite_u.o `test -f 'fwrite_u.c' || echo '$(srcdir)/'`fwrite_u.c
+
+lib_a-fwrite_u.obj: fwrite_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fwrite_u.obj `if test -f 'fwrite_u.c'; then $(CYGPATH_W) 'fwrite_u.c'; else $(CYGPATH_W) '$(srcdir)/fwrite_u.c'; fi`
+
 lib_a-fwscanf.o: fwscanf.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fwscanf.o `test -f 'fwscanf.c' || echo '$(srcdir)/'`fwscanf.c
 
@@ -1395,12 +1561,24 @@ lib_a-getwc.o: getwc.c
 lib_a-getwc.obj: getwc.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getwc.obj `if test -f 'getwc.c'; then $(CYGPATH_W) 'getwc.c'; else $(CYGPATH_W) '$(srcdir)/getwc.c'; fi`
 
+lib_a-getwc_u.o: getwc_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getwc_u.o `test -f 'getwc_u.c' || echo '$(srcdir)/'`getwc_u.c
+
+lib_a-getwc_u.obj: getwc_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getwc_u.obj `if test -f 'getwc_u.c'; then $(CYGPATH_W) 'getwc_u.c'; else $(CYGPATH_W) '$(srcdir)/getwc_u.c'; fi`
+
 lib_a-getwchar.o: getwchar.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getwchar.o `test -f 'getwchar.c' || echo '$(srcdir)/'`getwchar.c
 
 lib_a-getwchar.obj: getwchar.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getwchar.obj `if test -f 'getwchar.c'; then $(CYGPATH_W) 'getwchar.c'; else $(CYGPATH_W) '$(srcdir)/getwchar.c'; fi`
 
+lib_a-getwchar_u.o: getwchar_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getwchar_u.o `test -f 'getwchar_u.c' || echo '$(srcdir)/'`getwchar_u.c
+
+lib_a-getwchar_u.obj: getwchar_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getwchar_u.obj `if test -f 'getwchar_u.c'; then $(CYGPATH_W) 'getwchar_u.c'; else $(CYGPATH_W) '$(srcdir)/getwchar_u.c'; fi`
+
 lib_a-open_memstream.o: open_memstream.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-open_memstream.o `test -f 'open_memstream.c' || echo '$(srcdir)/'`open_memstream.c
 
@@ -1413,12 +1591,24 @@ lib_a-putwc.o: putwc.c
 lib_a-putwc.obj: putwc.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putwc.obj `if test -f 'putwc.c'; then $(CYGPATH_W) 'putwc.c'; else $(CYGPATH_W) '$(srcdir)/putwc.c'; fi`
 
+lib_a-putwc_u.o: putwc_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putwc_u.o `test -f 'putwc_u.c' || echo '$(srcdir)/'`putwc_u.c
+
+lib_a-putwc_u.obj: putwc_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putwc_u.obj `if test -f 'putwc_u.c'; then $(CYGPATH_W) 'putwc_u.c'; else $(CYGPATH_W) '$(srcdir)/putwc_u.c'; fi`
+
 lib_a-putwchar.o: putwchar.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putwchar.o `test -f 'putwchar.c' || echo '$(srcdir)/'`putwchar.c
 
 lib_a-putwchar.obj: putwchar.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putwchar.obj `if test -f 'putwchar.c'; then $(CYGPATH_W) 'putwchar.c'; else $(CYGPATH_W) '$(srcdir)/putwchar.c'; fi`
 
+lib_a-putwchar_u.o: putwchar_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putwchar_u.o `test -f 'putwchar_u.c' || echo '$(srcdir)/'`putwchar_u.c
+
+lib_a-putwchar_u.obj: putwchar_u.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putwchar_u.obj `if test -f 'putwchar_u.c'; then $(CYGPATH_W) 'putwchar_u.c'; else $(CYGPATH_W) '$(srcdir)/putwchar_u.c'; fi`
+
 lib_a-stdio_ext.o: stdio_ext.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stdio_ext.o `test -f 'stdio_ext.c' || echo '$(srcdir)/'`stdio_ext.c
 
Index: libc/stdio/clearerr_u.c
===================================================================
RCS file: libc/stdio/clearerr_u.c
diff -N libc/stdio/clearerr_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/clearerr_u.c	15 Dec 2014 18:45:57 -0000
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<clearerr_unlocked>>---clear file or stream error indicator
+
+INDEX
+	clearerr_unlocked
+
+ANSI_SYNOPSIS
+	#define _BSD_SOURCE
+	#include <stdio.h>
+	void clearerr_unlocked(FILE *<[fp]>);
+
+TRAD_SYNOPSIS
+	#define _BSD_SOURCE
+	#include <stdio.h>
+	void clearerr_unlocked(<[fp]>)
+	FILE *<[fp]>;
+
+DESCRIPTION
+<<clearerr_unlocked>> is a non-thread-safe version of <<clearerr>> declared in
+<<stdio.h>>.  <<clearerr_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<clearerr_unlocked>> is equivalent to <<clearerr>>.
+
+RETURNS
+<<clearerr_unlocked>> does not return a result.
+
+PORTABILITY
+<<clearerr_unlocked>> is a BSD extension also provided by GNU libc.
+
+No supporting OS subroutines are required.
+*/
+
+#include <_ansi.h>
+#include <stdio.h>
+
+/* A subroutine version of the macro clearerr_unlocked.  */
+
+#undef	clearerr_unlocked
+
+_VOID
+_DEFUN(clearerr_unlocked, (fp),
+       FILE * fp)
+{
+  __sclearerr (fp);
+}
Index: libc/stdio/feof_u.c
===================================================================
RCS file: libc/stdio/feof_u.c
diff -N libc/stdio/feof_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/feof_u.c	15 Dec 2014 18:45:57 -0000
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<feof_unlocked>>---test for end of file
+
+INDEX
+	feof_unlocked
+
+ANSI_SYNOPSIS
+	#define _BSD_SOURCE
+	#include <stdio.h>
+	int feof_unlocked(FILE *<[fp]>);
+
+TRAD_SYNOPSIS
+	#define _BSD_SOURCE
+	#include <stdio.h>
+	int feof_unlocked(<[fp]>)
+	FILE *<[fp]>;
+
+DESCRIPTION
+<<feof_unlocked>> is a non-thread-safe version of <<feof>> declared in
+<<stdio.h>>.  <<feof_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<feof_unlocked>> is equivalent to <<feof>>.
+
+RETURNS
+<<feof_unlocked>> returns <<0>> if the end of file has not yet been reached; if
+at end of file, the result is nonzero.
+
+PORTABILITY
+<<feof_unlocked>> is a BSD extension also provided by GNU libc.
+
+No supporting OS subroutines are required.
+*/
+
+#include <stdio.h>
+
+/* A subroutine version of the macro feof_unlocked.  */
+
+#undef feof_unlocked
+
+int
+_DEFUN(feof_unlocked, (fp),
+       FILE * fp)
+{
+  return __sfeof (fp);
+}
Index: libc/stdio/ferror_u.c
===================================================================
RCS file: libc/stdio/ferror_u.c
diff -N libc/stdio/ferror_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/ferror_u.c	15 Dec 2014 18:45:57 -0000
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<ferror_unlocked>>---test whether read/write error has occurred
+
+INDEX
+	ferror_unlocked
+
+ANSI_SYNOPSIS
+	#define _BSD_SOURCE
+	#include <stdio.h>
+	int ferror_unlocked(FILE *<[fp]>);
+
+TRAD_SYNOPSIS
+	#define _BSD_SOURCE
+	#include <stdio.h>
+	int ferror_unlocked(<[fp]>)
+	FILE *<[fp]>;
+
+DESCRIPTION
+<<ferror_unlocked>> is a non-thread-safe version of <<ferror>> declared in
+<<stdio.h>>.  <<ferror_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<ferror_unlocked>> is equivalent to <<ferror>>.
+
+RETURNS
+<<ferror_unlocked>> returns <<0>> if no errors have occurred; it returns a
+nonzero value otherwise.
+
+PORTABILITY
+<<ferror_unlocked>> is a BSD extension also provided by GNU libc.
+
+No supporting OS subroutines are required.
+*/
+
+#include <_ansi.h>
+#include <stdio.h>
+
+/* A subroutine version of the macro ferror_unlocked.  */
+
+#undef ferror_unlocked
+
+int
+_DEFUN(ferror_unlocked, (fp),
+       FILE * fp)
+{
+  return __sferror (fp);
+}
Index: libc/stdio/fflush_u.c
===================================================================
RCS file: libc/stdio/fflush_u.c
diff -N libc/stdio/fflush_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/fflush_u.c	15 Dec 2014 18:45:57 -0000
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<fflush_unlocked>>---flush buffered file output
+
+INDEX
+	fflush_unlocked
+
+ANSI_SYNOPSIS
+	#define _BSD_SOURCE
+	#include <stdio.h>
+	int fflush_unlocked(FILE *<[fp]>);
+
+DESCRIPTION
+<<fflush_unlocked>> is a non-thread-safe version of <<fflush>> declared in
+<<stdio.h>>.  <<fflush_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<fflush_unlocked>> is equivalent to <<fflush>>.
+
+RETURNS
+<<fflush_unlocked>> returns <<0>> unless it encounters a write error; in that
+situation, it returns <<EOF>>.
+
+PORTABILITY
+<<fflush_unlocked>> is a BSD extension also provided by GNU libc.
+
+No supporting OS subroutines are required.
+*/
+
+#include <_ansi.h>
+#include <stdio.h>
+#include <errno.h>
+#include "local.h"
+
+int
+_DEFUN(fflush_unlocked, (fp),
+       register FILE * fp)
+{
+  CHECK_INIT (_REENT, fp);
+
+  if (!fp->_flags)
+    return 0;
+
+  return __sflush_r (_REENT, fp);
+}
Index: libc/stdio/fgetc_u.c
===================================================================
RCS file: libc/stdio/fgetc_u.c
diff -N libc/stdio/fgetc_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/fgetc_u.c	15 Dec 2014 18:45:57 -0000
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<fgetc_unlocked>>---get a character from a file or stream
+
+INDEX
+	fgetc_unlocked
+
+ANSI_SYNOPSIS
+	#include <stdio.h>
+	int fgetc_unlocked(FILE *<[fp]>);
+
+TRAD_SYNOPSIS
+	#include <stdio.h>
+	int fgetc_unlocked(<[fp]>)
+	FILE *<[fp]>;
+
+DESCRIPTION
+<<fgetc_unlocked>> is a non-thread-safe version of <<fgetc>> declared in
+<<stdio.h>>.  <<fgetc_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<fgetc_unlocked>> is equivalent to <<fgetc>>.
+
+RETURNS
+The next character (read as an <<unsigned char>>, and cast to
+<<int>>), unless there is no more data, or the host system reports a
+read error; in either of these situations, <<fgetc_unlocked>> returns <<EOF>>.
+
+You can distinguish the two situations that cause an <<EOF>> result by
+using the <<ferror_unlocked>> and <<feof_unlocked>> functions.
+
+PORTABILITY
+<<fgetc_unlocked>> is a BSD extension also provided by GNU libc.
+
+Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
+<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
+*/
+
+#include <_ansi.h>
+#include <stdio.h>
+#include "local.h"
+
+int
+_DEFUN(fgetc_unlocked, (fp),
+       FILE * fp)
+{
+  int result;
+  CHECK_INIT(_REENT, fp);
+  return __sgetc_r (_REENT, fp);
+}
Index: libc/stdio/fgets.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fgets.c,v
retrieving revision 1.12
diff -u -p -r1.12 fgets.c
--- libc/stdio/fgets.c	18 Nov 2013 17:28:05 -0000	1.12
+++ libc/stdio/fgets.c	15 Dec 2014 18:45:58 -0000
@@ -74,12 +74,26 @@ Supporting OS subroutines required: <<cl
 #include <string.h>
 #include "local.h"
 
+#ifdef FGETS_UNLOCKED
+#undef _newlib_flockfile_start
+#undef _newlib_flockfile_exit
+#undef _newlib_flockfile_end
+#define _newlib_flockfile_start(x) {}
+#define _newlib_flockfile_exit(x) {}
+#define _newlib_flockfile_end(x) {}
+#define _fgets_r _fgets_unlocked_r
+#define fgets fgets_unlocked
+#endif
+
 /*
  * Read at most n-1 characters from the given file.
  * Stop when a newline has been read, or the count runs out.
  * Return first argument, or NULL if no characters were read.
  */
 
+#ifdef FGETS_UNLOCKED
+static
+#endif
 char *
 _DEFUN(_fgets_r, (ptr, buf, n, fp),
        struct _reent * ptr _AND
Index: libc/stdio/fgets_u.c
===================================================================
RCS file: libc/stdio/fgets_u.c
diff -N libc/stdio/fgets_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/fgets_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<fgets_unlocked>>---get character string from a file or stream
+
+INDEX
+	fgets_unlocked
+
+ANSI_SYNOPSIS
+        #include <stdio.h>
+	char *fgets_unlocked(char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>);
+
+TRAD_SYNOPSIS
+	#include <stdio.h>
+	char *fgets_unlocked(<[buf]>,<[n]>,<[fp]>)
+        char *<[buf]>;
+	int <[n]>;
+	FILE *<[fp]>;
+
+DESCRIPTION
+<<fgets_unlocked>> is a non-thread-safe version of <<fgets>> declared in
+<<stdio.h>>.  <<fgets_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<fgets_unlocked>> is equivalent to <<fgets>>.
+
+RETURNS
+<<fgets_unlocked>> returns the buffer passed to it, with the data filled in.
+If end of file occurs with some data already accumulated, the data is returned
+with no other indication. If no data are read, NULL is returned instead.
+
+PORTABILITY
+<<fgets_unlocked>> should replace all uses of <<gets_unlocked>>. Note however
+that <<fgets_unlocked>> returns all of the data, while <<gets_unlocked>> removes
+the trailing newline (with no indication that it has done so.)
+
+Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
+<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
+*/
+
+#define FGETS_UNLOCKED
+#include "fgets.c"
Index: libc/stdio/fgetwc.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fgetwc.c,v
retrieving revision 1.6
diff -u -p -r1.6 fgetwc.c
--- libc/stdio/fgetwc.c	29 Apr 2013 21:06:23 -0000	1.6
+++ libc/stdio/fgetwc.c	15 Dec 2014 18:45:58 -0000
@@ -110,7 +110,7 @@ C99, POSIX.1-2001
 #include <wchar.h>
 #include "local.h"
 
-static wint_t
+wint_t
 _DEFUN(__fgetwc, (ptr, fp),
 	struct _reent *ptr _AND
 	register FILE *fp)
Index: libc/stdio/fgetwc_u.c
===================================================================
RCS file: libc/stdio/fgetwc_u.c
diff -N libc/stdio/fgetwc_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/fgetwc_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<fgetwc_unlocked>>, <<getwc_unlocked>>---get a wide character from a file or stream
+
+INDEX
+	fgetwc_unlocked
+INDEX
+	getwc_unlocked
+
+ANSI_SYNOPSIS
+	#include <stdio.h>
+	#include <wchar.h>
+	wint_t fgetwc_unlocked(FILE *<[fp]>);
+
+	#include <stdio.h>
+	#include <wchar.h>
+	wint_t getwc_unlocked(FILE *<[fp]>);
+
+TRAD_SYNOPSIS
+	#include <stdio.h>
+	#include <wchar.h>
+	wint_t fgetwc_unlocked(<[fp]>)
+	FILE *<[fp]>;
+
+	#include <stdio.h>
+	#include <wchar.h>
+	wint_t getwc_unlocked(<[fp]>)
+	FILE *<[fp]>;
+
+DESCRIPTION
+<<fgetwc_unlocked>> is a non-thread-safe version of <<fgetwc>> declared in
+<<stdio.h>>.  <<fgetwc_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<fgetwc_unlocked>> is equivalent to <<fgetwc>>.
+
+The <<getwc_unlocked>> function or macro functions identically to
+<<fgetwc_unlocked>>.  It may be implemented as a macro, and may evaluate
+its argument more than once. There is no reason ever to use it.
+
+RETURNS
+The next wide character cast to <<wint_t>>), unless there is no more data,
+or the host system reports a read error; in either of these situations,
+<<fgetwc_unlocked>> and <<getwc_unlocked>> return <<WEOF>>.
+
+You can distinguish the two situations that cause an <<EOF>> result by
+using the <<ferror_unlocked>> and <<feof_unlocked>> functions.
+
+PORTABILITY
+These functions are GNU extensions.
+*/
+
+#include <_ansi.h>
+#include <stdio.h>
+#include <wchar.h>
+#include "local.h"
+
+wint_t
+_DEFUN(fgetwc_unlocked, (fp),
+	register FILE *fp)
+{
+  wint_t r;
+
+  CHECK_INIT(_REENT, fp);
+  ORIENT(fp, 1);
+  return __fgetwc (_REENT, fp);
+}
Index: libc/stdio/fgetws.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fgetws.c,v
retrieving revision 1.8
diff -u -p -r1.8 fgetws.c
--- libc/stdio/fgetws.c	26 Nov 2013 17:20:59 -0000	1.8
+++ libc/stdio/fgetws.c	15 Dec 2014 18:45:58 -0000
@@ -83,6 +83,20 @@ C99, POSIX.1-2001
 #include <wchar.h>
 #include "local.h"
 
+#ifdef FGETWS_UNLOCKED
+#undef _newlib_flockfile_start
+#undef _newlib_flockfile_exit
+#undef _newlib_flockfile_end
+#define _newlib_flockfile_start(x) {}
+#define _newlib_flockfile_exit(x) {}
+#define _newlib_flockfile_end(x) {}
+#define _fgetws_r _fgetws_unlocked_r
+#define fgetws fgetws_unlocked
+#endif
+
+#ifdef FGETWS_UNLOCKED
+static
+#endif
 wchar_t *
 _DEFUN(_fgetws_r, (ptr, ws, n, fp),
 	struct _reent *ptr _AND
Index: libc/stdio/fgetws_u.c
===================================================================
RCS file: libc/stdio/fgetws_u.c
diff -N libc/stdio/fgetws_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/fgetws_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<fgetws>>---get wide character string from a file or stream
+
+INDEX
+	fgetws_unlocked
+
+ANSI_SYNOPSIS
+	#define _GNU_SOURCE
+	#include <wchar.h>
+	wchar_t *fgetws_unlocked(wchar_t *__restrict <[ws]>, int <[n]>,
+                        FILE *__restrict <[fp]>);
+
+TRAD_SYNOPSIS
+	#define _GNU_SOURCE
+	#include <wchar.h>
+	wchar_t *fgetws_unlocked(<[ws]>,<[n]>,<[fp]>)
+	wchar_t *__restrict <[ws]>;
+	int <[n]>;
+	FILE *__restrict <[fp]>;
+
+DESCRIPTION
+<<fgetws_unlocked>> is a non-thread-safe version of <<fgetws>> declared in
+<<wchar.h>>.  <<fgetws_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<fgetws_unlocked>> is equivalent to <<fgetws>>.
+
+RETURNS
+<<fgetws_unlocked>> returns the buffer passed to it, with the data
+filled in. If end of file occurs with some data already
+accumulated, the data is returned with no other indication. If
+no data are read, NULL is returned instead.
+
+PORTABILITY
+<<fgetws_unlocked>> is a GNU extension.
+*/
+
+#define FGETWS_UNLOCKED
+#include "fgetws.c"
Index: libc/stdio/fileno_u.c
===================================================================
RCS file: libc/stdio/fileno_u.c
diff -N libc/stdio/fileno_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/fileno_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/*
+FUNCTION
+<<fileno_unlocked>>---return file descriptor associated with stream
+
+INDEX
+	fileno_unlocked
+
+ANSI_SYNOPSIS
+	#define _BSD_SOURCE
+	#include <stdio.h>
+	int fileno_unlocked(FILE *<[fp]>);
+
+TRAD_SYNOPSIS
+	#define _BSD_SOURCE
+	#include <stdio.h>
+	int fileno_unlocked(<[fp]>)
+	FILE *<[fp]>;
+
+DESCRIPTION
+<<fileno_unlocked>> is a non-thread-safe version of <<fileno>> declared in
+<<stdio.h>>.  <<fileno_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<fileno_unlocked>> is equivalent to <<fileno>>.
+
+RETURNS
+<<fileno_unlocked>> returns a non-negative integer when successful.
+If <[fp]> is not an open stream, <<fileno_unlocked>> returns -1.
+
+PORTABILITY
+<<fileno_unlocked>> is a BSD extension also provided by GNU libc.
+
+Supporting OS subroutines required: none.
+*/
+
+#include <_ansi.h>
+#include <stdio.h>
+#include <errno.h>
+#include "local.h"
+
+int
+_DEFUN(fileno_unlocked, (f),
+       FILE * f)
+{
+  int result;
+  CHECK_INIT (_REENT, f);
+  if (f->_flags)
+    result = __sfileno (f);
+  else
+    {
+      result = -1;
+      _REENT->_errno = EBADF;
+    }
+  return result;
+}
Index: libc/stdio/fputc_u.c
===================================================================
RCS file: libc/stdio/fputc_u.c
diff -N libc/stdio/fputc_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/fputc_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<fputc_unlocked>>---write a character on a stream or file
+
+INDEX
+	fputc_unlocked
+
+ANSI_SYNOPSIS
+	#define _BSD_SOURCE
+	#include <stdio.h>
+	int fputc_unlocked(int <[ch]>, FILE *<[fp]>);
+
+TRAD_SYNOPSIS
+	#define _BSD_SOURCE
+	#include <stdio.h>
+	int fputc_unlocked(<[ch]>, <[fp]>)
+	int <[ch]>;
+	FILE *<[fp]>;
+
+DESCRIPTION
+<<fputc_unlocked>> is a non-thread-safe version of <<fputc>> declared in
+<<stdio.h>>.  <<fputc_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<fputc_unlocked>> is equivalent to <<fputc>>.
+
+RETURNS
+If successful, <<fputc_unlocked>> returns its argument <[ch]>.  If an error
+intervenes, the result is <<EOF>>.  You can use `<<ferror(<[fp]>)>>' to
+query for errors.
+
+PORTABILITY
+<<fputc_unlocked>> is a BSD extension also provided by GNU libc.
+
+Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
+<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
+*/
+
+#include <_ansi.h>
+#include <stdio.h>
+#include "local.h"
+
+int
+_DEFUN(fputc_unlocked, (ch, file),
+       int ch _AND
+       FILE * file)
+{
+  int result;
+  CHECK_INIT(_REENT, file);
+  return _putc_r (_REENT, ch, file);
+}
Index: libc/stdio/fputs.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fputs.c,v
retrieving revision 1.10
diff -u -p -r1.10 fputs.c
--- libc/stdio/fputs.c	18 Nov 2013 17:28:05 -0000	1.10
+++ libc/stdio/fputs.c	15 Dec 2014 18:45:58 -0000
@@ -67,10 +67,23 @@ Supporting OS subroutines required: <<cl
 #include "fvwrite.h"
 #include "local.h"
 
+#ifdef FPUTS_UNLOCKED
+#undef _newlib_flockfile_start
+#undef _newlib_flockfile_exit
+#undef _newlib_flockfile_end
+#define _newlib_flockfile_start(x) {}
+#define _newlib_flockfile_exit(x) {}
+#define _newlib_flockfile_end(x) {}
+#define _fputs_r _fputs_unlocked_r
+#define fputs fputs_unlocked
+#endif
+
 /*
  * Write the given string to the given file.
  */
-
+#ifdef FPUTS_UNLOCKED
+static
+#endif
 int
 _DEFUN(_fputs_r, (ptr, s, fp),
        struct _reent * ptr _AND
Index: libc/stdio/fputs_u.c
===================================================================
RCS file: libc/stdio/fputs_u.c
diff -N libc/stdio/fputs_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/fputs_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<fputs_unlocked>>---get character string from a file or stream
+
+INDEX
+	fputs_unlocked
+
+ANSI_SYNOPSIS
+	#define _GNU_SOURCE
+        #include <stdio.h>
+	char *fputs_unlocked(char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>);
+
+TRAD_SYNOPSIS
+	#define _GNU_SOURCE
+	#include <stdio.h>
+	char *fputs_unlocked(<[buf]>,<[n]>,<[fp]>)
+        char *<[buf]>;
+	int <[n]>;
+	FILE *<[fp]>;
+
+DESCRIPTION
+<<fputs_unlocked>> is a non-thread-safe version of <<fputs>> declared in
+<<stdio.h>>.  <<fputs_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<fputs_unlocked>> is equivalent to <<fputs>>.
+
+RETURNS
+<<fputs_unlocked>> returns the buffer passed to it, with the data filled in.
+If end of file occurs with some data already accumulated, the data is returned
+with no other indication. If no data are read, NULL is returned instead.
+
+PORTABILITY
+<<fputs_unlocked>> should replace all uses of <<puts_unlocked>>. Note however
+that <<fputs_unlocked>> returns all of the data, while <<puts_unlocked>> removes
+the trailing newline (with no indication that it has done so.)
+
+Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
+<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
+*/
+
+#define FPUTS_UNLOCKED
+#include "fputs.c"
Index: libc/stdio/fputwc.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fputwc.c,v
retrieving revision 1.4
diff -u -p -r1.4 fputwc.c
--- libc/stdio/fputwc.c	29 Apr 2013 21:06:23 -0000	1.4
+++ libc/stdio/fputwc.c	15 Dec 2014 18:45:58 -0000
@@ -117,7 +117,7 @@ C99, POSIX.1-2001
 #include <wchar.h>
 #include "local.h"
 
-static wint_t
+wint_t
 _DEFUN(__fputwc, (ptr, wc, fp),
 	struct _reent *ptr _AND
 	wchar_t wc _AND
Index: libc/stdio/fputwc_u.c
===================================================================
RCS file: libc/stdio/fputwc_u.c
diff -N libc/stdio/fputwc_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/fputwc_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<fputwc_unlocked>>, <<putwc_unlocked>>---write a wide character on a stream or file
+
+INDEX
+	fputwc_unlocked
+INDEX
+	putwc_unlocked
+
+ANSI_SYNOPSIS
+	#define _GNU_SOURCE
+	#include <stdio.h>
+	#include <wchar.h>
+	wint_t fputwc_unlocked(wchar_t <[wc]>, FILE *<[fp]>);
+
+	#include <stdio.h>
+	#include <wchar.h>
+	wint_t putwc_unlocked(wchar_t <[wc]>, FILE *<[fp]>);
+
+TRAD_SYNOPSIS
+	#define _GNU_SOURCE
+	#include <stdio.h>
+	#include <wchar.h>
+	wint_t fputwc_unlocked(<[wc]>, <[fp]>)
+	wchar_t <[wc]>;
+	FILE *<[fp]>;
+
+	#include <stdio.h>
+	#include <wchar.h>
+	wint_t putwc_unlocked(<[wc]>, <[fp]>)
+	wchar_t <[wc]>;
+	FILE *<[fp]>;
+
+DESCRIPTION
+<<fputwc_unlocked>> is a non-thread-safe version of <<fputwc>> declared in
+<<wchar.h>>.  <<fputwc_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<fputwc_unlocked>> is equivalent to <<fputwc>>.
+
+The <<putwc_unlocked>> function or macro functions identically to
+<<fputwc_unlocked>>.  It may be implemented as a macro, and may evaluate
+its argument more than once. There is no reason ever to use it.
+
+RETURNS
+If successful, <<fputwc_unlocked>> and <<putwc_unlocked>> return their argument
+<[wc]>. If an error intervenes, the result is <<EOF>>.  You can use
+`<<ferror_unlocked(<[fp]>)>>' to query for errors.
+
+PORTABILITY
+These functions are GNU extensions.
+*/
+
+#include <_ansi.h>
+#include <stdio.h>
+#include <wchar.h>
+#include "local.h"
+
+wint_t
+_DEFUN(fputwc_unlocked, (wc, fp),
+	wchar_t wc _AND
+	FILE *fp)
+{
+  wint_t r;
+
+  CHECK_INIT(_REENT, fp);
+  ORIENT(fp, 1);
+  return __fputwc(_REENT, wc, fp);
+}
Index: libc/stdio/fputws.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fputws.c,v
retrieving revision 1.6
diff -u -p -r1.6 fputws.c
--- libc/stdio/fputws.c	26 Nov 2013 17:21:00 -0000	1.6
+++ libc/stdio/fputws.c	15 Dec 2014 18:45:58 -0000
@@ -77,6 +77,20 @@ C99, POSIX.1-2001
 #include "fvwrite.h"
 #include "local.h"
 
+#ifdef FPUTWS_UNLOCKED
+#undef _newlib_flockfile_start
+#undef _newlib_flockfile_exit
+#undef _newlib_flockfile_end
+#define _newlib_flockfile_start(x) {}
+#define _newlib_flockfile_exit(x) {}
+#define _newlib_flockfile_end(x) {}
+#define _fputws_r _fputws_unlocked_r
+#define fputws fputws_unlocked
+#endif
+
+#ifdef FPUTWS_UNLOCKED
+static
+#endif
 int
 _DEFUN(_fputws_r, (ptr, ws, fp),
 	struct _reent *ptr _AND
Index: libc/stdio/fputws_u.c
===================================================================
RCS file: libc/stdio/fputws_u.c
diff -N libc/stdio/fputws_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/fputws_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION        
+<<fputws>>---write a wide character string in a file or stream
+
+INDEX
+	fputws_unlocked
+
+ANSI_SYNOPSIS
+	#define _GNU_SOURCE
+	#include <wchar.h>
+	int fputws_unlocked(const wchar_t *__restrict <[ws]>, FILE *__restrict <[fp]>);
+
+TRAD_SYNOPSIS   
+	#define _GNU_SOURCE
+	#include <wchar.h>
+	int fputws_unlocked(<[ws]>, <[fp]>)
+	wchar_t *__restrict <[ws]>;
+	FILE *__restrict <[fp]>;
+
+DESCRIPTION
+<<fputws_unlocked>> is a non-thread-safe version of <<fputws>> declared in
+<<wchar.h>>.  <<fputws_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<fputws_unlocked>> is equivalent to <<fputws>>.
+
+RETURNS
+If successful, the result is a non-negative integer; otherwise, the result
+is <<-1>> to indicate an error.
+
+PORTABILITY
+<<fputws_unlocked>> is a GNU extension.
+*/
+
+#define FPUTWS_UNLOCKED
+#include "fputws.c"
Index: libc/stdio/fread.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fread.c,v
retrieving revision 1.22
diff -u -p -r1.22 fread.c
--- libc/stdio/fread.c	18 Nov 2013 17:28:05 -0000	1.22
+++ libc/stdio/fread.c	15 Dec 2014 18:45:58 -0000
@@ -78,6 +78,17 @@ Supporting OS subroutines required: <<cl
 #include <malloc.h>
 #include "local.h"
 
+#ifdef FREAD_UNLOCKED
+#undef _newlib_flockfile_start
+#undef _newlib_flockfile_exit
+#undef _newlib_flockfile_end
+#define _newlib_flockfile_start(x) {}
+#define _newlib_flockfile_exit(x) {}
+#define _newlib_flockfile_end(x) {}
+#define _fread_r _fread_unlocked_r
+#define fread fread_unlocked
+#endif
+
 #ifdef __SCLE
 static size_t
 _DEFUN(crlf_r, (ptr, fp, buf, count, eof),
@@ -128,6 +139,9 @@ _DEFUN(crlf_r, (ptr, fp, buf, count, eof
 
 #endif
 
+#ifdef FREAD_UNLOCKED
+static
+#endif
 size_t
 _DEFUN(_fread_r, (ptr, buf, size, count, fp),
        struct _reent * ptr _AND
Index: libc/stdio/fread_u.c
===================================================================
RCS file: libc/stdio/fread_u.c
diff -N libc/stdio/fread_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/fread_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<fread_unlocked>>---read array elements from a file
+
+INDEX
+	fread_unlocked
+
+ANSI_SYNOPSIS
+	#define _BSD_SOURCE
+	#include <stdio.h>
+	size_t fread_unlocked(void *restrict <[buf]>, size_t <[size]>, size_t <[count]>,
+		     FILE *restrict <[fp]>);
+
+TRAD_SYNOPSIS
+	#define _BSD_SOURCE
+	#include <stdio.h>
+	size_t fread_unlocked(<[buf]>, <[size]>, <[count]>, <[fp]>)
+	char *<[buf]>;
+	size_t <[size]>;
+	size_t <[count]>;
+	FILE *<[fp]>;
+
+DESCRIPTION
+<<fread_unlocked>> is a non-thread-safe version of <<fread>> declared in
+<<stdio.h>>.  <<fread_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<fread_unlocked>> is equivalent to <<fread>>.
+
+RETURNS
+The result of <<fread_unlocked>> is the number of elements it succeeded in
+reading.
+
+PORTABILITY
+<<fread_unlocked>> is a BSD extension also provided by GNU libc.
+
+Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
+<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
+*/
+
+#define FREAD_UNLOCKED
+#include "fread.c"
Index: libc/stdio/fwrite.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fwrite.c,v
retrieving revision 1.11
diff -u -p -r1.11 fwrite.c
--- libc/stdio/fwrite.c	18 Nov 2013 17:28:05 -0000	1.11
+++ libc/stdio/fwrite.c	15 Dec 2014 18:45:58 -0000
@@ -89,11 +89,25 @@ static char sccsid[] = "%W% (Berkeley) %
 #include "fvwrite.h"
 #endif
 
+#ifdef FWRITE_UNLOCKED
+#undef _newlib_flockfile_start
+#undef _newlib_flockfile_exit
+#undef _newlib_flockfile_end
+#define _newlib_flockfile_start(x) {}
+#define _newlib_flockfile_exit(x) {}
+#define _newlib_flockfile_end(x) {}
+#define _fwrite_r _fwrite_unlocked_r
+#define fwrite fwrite_unlocked
+#endif
+
 /*
  * Write `count' objects (each size `size') from memory to the given file.
  * Return the number of whole objects written.
  */
 
+#ifdef FWRITE_UNLOCKED
+static
+#endif
 size_t
 _DEFUN(_fwrite_r, (ptr, buf, size, count, fp),
        struct _reent * ptr _AND
Index: libc/stdio/fwrite_u.c
===================================================================
RCS file: libc/stdio/fwrite_u.c
diff -N libc/stdio/fwrite_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/fwrite_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/*
+FUNCTION
+<<fwrite_unlocked>>---write array elements
+
+INDEX
+	fwrite_unlocked
+
+ANSI_SYNOPSIS
+	#include <stdio.h>
+	size_t fwrite_unlocked(const void *restrict <[buf]>, size_t <[size]>,
+			       size_t <[count]>, FILE *restrict <[fp]>);
+
+TRAD_SYNOPSIS
+	#include <stdio.h>
+	size_t fwrite_unlocked(<[buf]>, <[size]>, <[count]>, <[fp]>)
+	char *<[buf]>;
+	size_t <[size]>;
+	size_t <[count]>;
+	FILE *<[fp]>;
+
+DESCRIPTION
+<<fwrite_unlocked>> is a non-thread-safe version of <<fwrite>> declared in
+<<stdio.h>>.  <<fwrite_unlocked>> may only safely be used within a scope
+protected by flockfile() (or ftrylockfile()) and funlockfile().  These
+functions may safely be used in a multi-threaded program if and only
+if they are called while the invoking thread owns the ( FILE *)
+object, as is the case after a successful call to the flockfile() or
+ftrylockfile() functions.  If threads are disabled, then
+<<fwrite_unlocked>> is equivalent to <<fwrite>>.
+
+RETURNS
+If <<fwrite_unlocked>> succeeds in writing all the elements you specify, the
+result is the same as the argument <[count]>.  In any event, the
+result is the number of complete elements that <<fwrite_unlocked>> copied to
+the file.
+
+PORTABILITY
+<<fwrite_unlocked>> is a BSD extension also provided by GNU libc.
+
+Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
+<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
+*/
+
+
+#define FWRITE_UNLOCKED
+#include "fwrite.c"
Index: libc/stdio/getwc_u.c
===================================================================
RCS file: libc/stdio/getwc_u.c
diff -N libc/stdio/getwc_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/getwc_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <_ansi.h>
+#include <reent.h>
+#include <stdio.h>
+#include <wchar.h>
+#include "local.h"
+
+#undef getwc_unlocked
+
+/*
+ * Synonym for fgetwc_unlocked(). The only difference is that getwc_unlocked(),
+ * if it is a macro, may evaluate `fp' more than once.
+ */
+wint_t
+_DEFUN(getwc_unlocked, (fp),
+	FILE *fp)
+{
+  return fgetwc_unlocked(fp);
+}
Index: libc/stdio/getwchar_u.c
===================================================================
RCS file: libc/stdio/getwchar_u.c
diff -N libc/stdio/getwchar_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/getwchar_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<getwchar_unlocked>>---read a wide character from standard input
+
+INDEX
+	getwchar_unlocked
+
+ANSI_SYNOPSIS
+	#define _GNU_SOURCE
+	#include <wchar.h>
+	wint_t getwchar_unlocked(void);
+
+TRAD_SYNOPSIS
+	#define _GNU_SOURCE
+	#include <wchar.h>
+	wint_t getwchar_unlocked();
+
+DESCRIPTION
+<<getwchar_unlocked>> function or macro is the wide character equivalent of
+the <<getchar_unlocked>> function.  You can use <<getwchar_unlocked>> to get
+the next wide character from the standard input stream.  As a side effect,
+<<getwchar_unlocked>> advances the standard input's current position indicator.
+
+RETURNS
+The next wide character cast to <<wint_t>>, unless there is no more
+data, or the host system reports a read error; in either of these
+situations, <<getwchar_unlocked>> returns <<WEOF>>.
+
+You can distinguish the two situations that cause an <<WEOF>> result by
+using `<<ferror_unlocked(stdin)>>' and `<<feof_unlocked(stdin)>>'.
+
+PORTABILITY
+<<getwchar_unlocked>> is a GNU extension.
+*/
+
+#include <_ansi.h>
+#include <reent.h>
+#include <stdio.h>
+#include <wchar.h>
+#include "local.h"
+
+#undef getwchar_unlocked
+
+/*
+ * Synonym for fgetwc_unlocked(stdin).
+ */
+wint_t
+_DEFUN_VOID (getwchar_unlocked)
+{
+  _REENT_SMALL_CHECK_INIT (_REENT);
+  return fgetwc_unlocked (stdin);
+}
Index: libc/stdio/local.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/local.h,v
retrieving revision 1.41
diff -u -p -r1.41 local.h
--- libc/stdio/local.h	15 Dec 2014 18:22:56 -0000	1.41
+++ libc/stdio/local.h	15 Dec 2014 18:45:58 -0000
@@ -140,6 +140,8 @@
 
 #endif /* _STDIO_WITH_THREAD_CANCELLATION_SUPPORT */
 
+extern wint_t _EXFUN(__fgetwc, (struct _reent *, FILE *));
+extern wint_t _EXFUN(__fputwc, (struct _reent *, wchar_t, FILE *));
 extern u_char *_EXFUN(__sccl, (char *, u_char *fmt));
 extern int    _EXFUN(__svfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list));
 extern int    _EXFUN(__ssvfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list));
Index: libc/stdio/putwc_u.c
===================================================================
RCS file: libc/stdio/putwc_u.c
diff -N libc/stdio/putwc_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/putwc_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,45 @@
+/*-
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <_ansi.h>
+#include <reent.h>
+#include <stdio.h>
+#include <wchar.h>
+#include "local.h"
+
+#undef putwc_unlocked
+
+/*
+ * Synonym for fputwc_unlocked(). The only difference is that putwc_unlocked(),
+ * if it is a macro, may evaluate `fp' more than once.
+ */
+wint_t
+_DEFUN(putwc_unlocked, (wc, fp),
+	wchar_t wc _AND
+	FILE *fp)
+{
+  return fputwc_unlocked (wc, fp);
+}
Index: libc/stdio/putwchar_u.c
===================================================================
RCS file: libc/stdio/putwchar_u.c
diff -N libc/stdio/putwchar_u.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libc/stdio/putwchar_u.c	15 Dec 2014 18:45:58 -0000
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+FUNCTION
+<<putwchar_unlocked>>---write a wide character to standard output
+
+INDEX
+	putwchar_unlocked
+
+ANSI_SYNOPSIS
+	#define _GNU_SOURCE
+	#include <wchar.h>
+	wint_t putwchar_unlocked(wchar_t <[wc]>);
+
+TRAD_SYNOPSIS
+	#define _GNU_SOURCE
+	#include <wchar.h>
+	wint_t putwchar_unlocked(<[wc]>)
+	wchar_t <[wc]>;
+
+DESCRIPTION
+The <<putwchar_unlocked>> function or macro is the wide-character equivalent of
+the <<putchar_unlocked>> function. It writes the wide character wc to stdout.
+
+RETURNS
+If successful, <<putwchar_unlocked>> returns its argument <[wc]>.  If an error
+intervenes, the result is <<EOF>>.  You can use `<<ferror_unlocked(stdin)>>' to
+query for errors.
+
+PORTABILITY
+<<putwchar_unlocked>> is a GNU extension.
+*/
+
+#include <_ansi.h>
+#include <reent.h>
+#include <stdio.h>
+#include <wchar.h>
+#include "local.h"
+
+#undef putwchar_unlocked
+
+/*
+ * Synonym for fputwc_unlocked(wc, stdout).
+ */
+wint_t
+_DEFUN(putwchar_unlocked, (wc),
+	wchar_t wc)
+{
+  _REENT_SMALL_CHECK_INIT (_REENT);
+  return fputwc_unlocked (wc, stdout);
+}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]