summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio
Commit message (Collapse)AuthorAgeFilesLines
* Arrange for text mode on stdin, stdout and stderr.Kaz Kylheku2017-11-171-0/+20
| | | | | | * newlib/libc/stdio/findfp.c (__sinit): Add the Cygwin-specific __SCLE (stream convert line endings) flag when calling the std function to initializing the reent structure's _stdin, _stdout and _stderr members.
* Default stdio streams to text mode.Kaz Kylheku2017-11-161-2/+2
| | | | | | | | * newlib/libc/stdio/flags.c (__sflags): Enable for Cygwin the piece of code which adds the O_TEXT mode if O_BINARY is not present. And, also, fix that piece of code's incorrect use of the | operator to test a flag instead of &.
* stdio: Fix make rule overrideSebastian Huber2017-07-282-10/+0
| | | | | | The Makefile.am contained two rules for the vfwscanf object. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Enable _REENT_GLOBAL_STDIO_STREAMS for RTEMSSebastian Huber2017-06-301-1/+1
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Introduce _REENT_GLOBAL_STDIO_STREAMSSebastian Huber2017-06-301-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Newlib, the stdio streams are defined to thread-specific pointers _reent::_stdin, _reent::_stdout and _reent::_stderr. In case _REENT_SMALL is not defined, then these pointers are initialized via _REENT_INIT_PTR() or _REENT_INIT_PTR_ZEROED() to thread-specific FILE objects provided via _reent::__sf[3]. There are two problems with this (at least in case of RTEMS). (1) The thread-specific FILE objects are closed by _reclaim_reent(). This leads to problems with language run-time libraries that provide wrappers to the C/POSIX stdio streams (e.g. C++ and Ada), since they use the thread-specific FILE objects of the initialization thread. In case the initialization thread is deleted, then they use freed memory. (2) Since thread-specific FILE objects are used with a common output device via file descriptors 0, 1 and 2, the locking at FILE object level cannot ensure atomicity of the output, e.g. a call to printf(). Introduce a new Newlib configuration option _REENT_GLOBAL_STDIO_STREAMS to enable the use of global stdio FILE objects. As a side-effect this reduces the size of struct _reent by more than 50%. The _REENT_GLOBAL_STDIO_STREAMS should not be used without _STDIO_CLOSE_PER_REENT_STD_STREAMS. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Add stdin_init(), stdout_init() and stderr_init()Sebastian Huber2017-06-301-17/+33
| | | | | | This simplifies further changes in this area. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Remove superfluous parameter from std()Sebastian Huber2017-06-301-7/+6
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Revert "Don't overread or write memory returned by _DTOA_R"Corinna Vinschen2017-06-191-13/+12
| | | | This reverts commit efaef1bba263501e1e7264833ddfc9b8c20f9ebc.
* Don't overread or write memory returned by _DTOA_RSilviu Baranga2017-06-091-12/+13
| | | | | | | | | | | | | | | Don't over-read memory returned by _DTOA_R, and never write to it since the result might be a string literal. For example, when doing: swprintf(tt, 20, L"%.*f", 6, 0.0); we will get back "0". Instead, write the result returned by _DTOA_R to the output buffer. After this, write the 0 chars directly to the the output buffer (if there are any). This also has the (marginal) advantage that we read/write less memory overall.
* Print sign of NaN values.Kito Cheng2017-06-072-0/+8
|
* Add __packed to struct ldieeeKito Cheng2017-04-181-8/+9
| | | | | - We don't want any padding in struct ldieee, otherwise the offset might wrong in most compiler.
* Use enum __packed in favour of -fshort-enumsSebastian Huber2017-04-033-41/+46
| | | | | | | | | | | | Some architectures like ARM encode the short enum option state in the object file and the linker checks that this option is consistent for all objects of an executable. In case applications use -fno-short-enums, then this leads to linker warnings. Use the enum __packed attribute for the relevent enums to avoid the -fshort-enums compiler option. This attribute is at least available on GCC, LLVM/clang and the Intel compiler. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Unify names of all lock objectsFreddie Chopin2017-02-061-6/+6
| | | | | | | | | | | | | | | | | | In preparation for the patch that would allow retargeting of locking routines, rename all lock objects to follow this pattern: "__<name>_[recursive_]mutex". Following locks were renamed: __dd_hash_lock -> __dd_hash_mutex __sfp_lock -> __sfp_recursive_mutex __sinit_lock -> __sinit_recursive_mutex __atexit_lock -> __atexit_recursive_mutex _arc4random_mutex -> __arc4random_mutex __env_lock_object -> __env_recursive_mutex __malloc_lock_object -> __malloc_recursive_mutex __atexit_mutex -> __at_quick_exit_mutex __tz_lock_object -> __tz_mutex
* 2016-12-15 Giuseppe Musumeci <giuseppe.musumeci@broadcom.com>Jeff Johnston2016-12-151-2/+2
| | | | | | | | | | | | | | __sinit initialises some common file descriptors as line buffered and relies on the first users of such FDs to call __smakebuf_r. If __smakebuf_r realises there's no space for a buffer (malloc returns NULL), it makes them unbuffered. However, while setting the __SNBF bit, it doesn't clear the __SLBF bit in the flags. Depending on the order in which functions check buffering flags in the FD, sometime they assume it's line buffered (e.g. __sfvwrite_r), trashing application memory that's not really been allocated to them. This patch solves the problem by clearing the unbuffered/line buffered flag when setting the line buffered/unbuffered flag.
* Fix a potential buffer overflow in wscanf familyCorinna Vinschen2016-10-221-6/+8
| | | | | | Fixes Coverity CID 60046 Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Consolidate wctomb/mbtowc calls for POSIX-1.2008Corinna Vinschen2016-08-152-6/+4
| | | | | | | | | | | | | | | | | | | | | - Remove charset parameter from low level __foo_wctomb/__foo_mbtowc calls. - Instead, create array of function for ISO and Windows codepages to point to function which does not require to evaluate the charset string on each call. Create matching helper functions. I.e., __iso_wctomb, __iso_mbtowc, __cp_wctomb and __cp_mbtowc are functions returning the right function pointer now. - Create __WCTOMB/__MBTOWC macros utilizing per-reent locale and replace calls to __wctomb/__mbtowc with calls to __WCTOMB/__MBTOWC. - Drop global __wctomb/__mbtowc vars. - Utilize aforementioned changes in Cygwin to get rid of charset in other, calling functions and simplify the code. - In Cygwin restrict global cygheap locale info to the job performed by internal_setlocale. Use UTF-8 instead of ASCII on the fly in internal conversion functions. - In Cygwin dll_entry, make sure to initialize a TLS area with a NULL _REENT->_locale pointer. Add comment to explain why. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
* POSIX-1.2008 per-thread locales, groundwork part 2Corinna Vinschen2016-08-152-2/+2
| | | | | | | | | Move all locale category structure definitions into setlocale.h and remove other headers in locale subdir. Create inline accessor functions for current category struct pointers and use throughout. Use pointers to "C" locale category structs by default in __global_locale. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
* Regenerate newlib MakefilesJon Turney2016-07-041-3/+16
|
* Feature test macros overhaul: stdio.hYaakov Selkowitz2016-03-171-0/+1
| | | | | | | | | | | | | | Throughout, remove references to __STRICT_ANSI__ and use the proper internal macros and versions for C99, POSIX, ATFILE for the various *at functions, or LARGEFILE for fseeko and ftello. [v]asprintf are GNU extensions, but the *iprintf, *iscanf, and *asnprintf functions are unique to newlib. getw and putw were removed from POSIX.1-2001. funopen is BSD, and fopencookie is GNU. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* setvbuf: Drop setting reent->__cleanupCorinna Vinschen2016-03-131-1/+0
| | | | | | | | The __sinit call added with 1eb6db6 already sets reent->__cleanup. * libc/stdio/setvbuf.c (setvbuf): Drop setting reent->__cleanup. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Update setvbuf to latest OpenBSD implementationCorinna Vinschen2016-03-121-42/+75
| | | | | | | | | | | | | | | | | | Newlib's setvbuf function is very old and has two bugs: - It sets the SRD/SWR flags incorrectly in case of files opened for reading and writing. See https://cygwin.com/ml/cygwin/2016-03/msg00180.html for a desription of the effect. - It always sets the buffer size to BUFSIZ if it's not provided by the application, independent of the optimal blocksize for the underlying IO device. Update setvbuf to latest code from OpenBSD to fix both problems. * libc/stdio/setvbuf.c (setvbuf): Import latest OpenBSD implementation. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add __swhatbuf function from OpenBSDCorinna Vinschen2016-03-122-49/+60
| | | | | | | | | | | To fix a long-standing setvbuf bug, import __swhatbuf function from OpenBSD and only slightly rearrange for newlib. * libc/stdio/local.h (__swhatbuf_r): Declare. * libc/stdio/makebuf (__smakebuf_r): New function. (__smakebuf_r): Drop file handling code and call __smakebuf_r. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* printf(3): Handle multibyte decimal point in field size computationCorinna Vinschen2016-02-081-7/+9
| | | | | | | | | | | This patch fixes the problem reported in https://cygwin.com/ml/cygwin/2016-02/msg00014.html The 2009 changes to handle multibyte decimal point and thousands separator missed to take the length of a multibyte decimal point into account when computing the field size. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* * newlib/libc/stdio/nano-vfscanf.c: Fix '%X' specifier procesingIgor Venevtsev2016-02-081-0/+1
|
* * newlib/libc/stdio/nano-vfscanf.c: Fix '%F', '%G' and '%E' specifiers ↵Igor Venevtsev2016-02-081-3/+3
| | | | processing
* Add missing checks for __SNLK flagCorinna Vinschen2015-12-083-10/+20
| | | | | | | | | | | * libc/stdio/fclose.c (_fclose_r): Make _flockfile/_funlockfile calls dependent on __SNLK flag. * libc/stdio/findfp.c (__fp_lock): Ditto. (__fp_unlock): Ditto. * libc/stdio/freopen.c (_freopen_r): Ditto. * libc/stdio64/freopen64.c (_freopen64_r): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix re-initialization of FILE flags and mbstate in freopenCorinna Vinschen2015-12-081-1/+1
| | | | | | | | * libc/stdio/freopen.c (_freopen_r): Only reset __SWID bit per SUSv4. * libc/stdio64/freopen64.c (_freopen64_r): Add missing resetting of flag values and _mbstate. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Import correctly working strtold from David M. Gay.Corinna Vinschen2015-11-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libc/stdlib/Makefile.am (GENERAL_SOURCES): Add strtodg.c and strtorx.c. * libc/stdlib/Makefile.in: Regenerate. * libc/stdlib/strtodg.c: New file implementing generic string to long double conversion. * libc/stdlib/strtorx.c: New file, implementing IEEE format string to long double conversion. * libc/stdlib/mprec.h (_strtodg_r): Declare. (_strtorx_r): Declare. * libc/stdlib/gdtoa.h (__UShort): Define. * libc/stdlib/strtold.c (__flt_rounds): Define for i386 and x86_64 target. (FLT_ROUNDS): Define, as 0 on platforms missing a __flt_rounds function. (_strtold_r): Converted from strtold. Call _strtorx_r on targets supporting distinct long doubles. (strtold): Just call _strtold_r. * libc/include/stdlib.h (_strtold_r): Declare. * libc/stdlib/ldtoa.c (_strtold): Comment out. Explain why. * libc/stdio/vfscanf.c (__SVFSCANF_R): Call _strtold_r instead of _strtold. * libc/machine/powerpc/vfscanf.c (__svfscanf_r): Ditto. * common.din (strtold): Drop redirection to _strtold. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Simplify the markup for sprintf and swprintf documentationJon Turney2015-11-192-64/+71
| | | | | | | | | | | | - move the description of the alternative form produced with the # flag from a nested table to an additional table 2015-11-12 Jon Turney <jon.turney@dronecode.org.uk> * libc/stdio/sprintf.c: Simplify documentation markup. * libc/stdio/swprintf.c: Ditto. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
* Improve markup of sscanf and swscanf documentationJon Turney2015-11-192-114/+237
| | | | | | | | | | | | | | | | | | | - use bullet points to separate width, size and type sections, rather than using rows in an enormous table, for consistency with sprintf and swprintf. - use code markup for size bullet point for consistency - use a texinfo multitable for description of the size flags, rather than some preformatted text - tidy up some whitespace so type flags are all aligned 2015-11-12 Jon Turney <jon.turney@dronecode.org.uk> * libc/stdio/sscanf.c: Improve documentation markup. * libc/stdio/swscanf.c: Ditto. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
* Move duplicated documentation rules to Makefile.sharedJeff Johnston2015-11-022-25/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Also, harmonize libm to use CHEWOUT_FILES like libc, rather than chobj. Update documentation appropriately. * HOWTO: Update. * Makefile.shared: Move documentation rules to here... * libc/argz/Makefile.am: ... from here ... * libc/ctype/Makefile.am: ... and here. * libc/errno/Makefile.am: Ditto. * libc/iconv/Makefile.am: Ditto. * libc/iconv/ccs/Makefile.am : Ditto. * libc/iconv/ces/Makefile.am: Ditto. * libc/iconv/lib/Makefile.am: Ditto. * libc/locale/Makefile.am: Ditto. * libc/misc/Makefile.am: Ditto. * libc/posix/Makefile.am: Ditto. * libc/reent/Makefile.am: Ditto. * libc/search/Makefile.am: Ditto. * libc/stdio/Makefile.am: Ditto. * libc/stdio64/Makefile.am: Ditto. * libc/stdlib/Makefile.am : Ditto. * libc/string/Makefile.am: Ditto. * libc/syscalls/Makefile.am: Ditto. * libc/time/Makefile.am : Ditto. * libc/unix/Makefile.am: Ditto. * libc/xdr/Makefile.am: Ditto. * libm/common/Makefile.am: Ditto. * libm/complex/Makefile.am: Ditto. * libm/math/Makefile.am: Ditto. * libm/mathfp/Makefile.am: Ditto.
* Add missing semicolons to prototypes.Jeff Johnston2015-11-022-12/+12
| | | | | | | | | | | | | * libc/stdio/fseek.c: Add missing semicolons to prototypes in SYNOPSIS. * libc/stdio/fwide.c: Ditto. * libc/stdio64/fseeko64.c: Ditto. * libc/string/strtok.c: Ditto. * libc/string/wcstok.c: Ditto. * libm/math/w_cosh.c: Ditto. * libm/math/w_fmod.c: Ditto. * libm/mathfp/s_cosh.c: Ditto. * libm/mathfp/s_fmod.c: Ditto.
* Fix wscanf family positional parameter handling in %lc, %ls, %l[]Shoichi Sakon2015-08-031-7/+9
| | | | | | | | * libc/stdio/vfwscanf.c (__SVFWSCANF_R): Convert wrong usage of va_arg to GET_ARG in %lc, %ls nad %l[] cases. Fix unterminated string in %l[] case. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Prevent use of uninitialized file lockSebastian Huber2015-07-022-4/+10
| | | | | | | | | | | | | | | The CHECK_INIT() is necessary before the _newlib_flockfile_start() since this would use otherwise acquire an uninitialized lock which gets initialized after this leading to a corrupt release. newlib/ChangeLog 2015-07-01 Sebastian Huber <sebastian.huber@embedded-brains.de> libc/stdio/fputs.c (_puts_r): Add missing CHECK_INIT(). libc/stdio/gets.c (_gets_r): Add missing _REENT_SMALL_CHECK_INIT() and CHECK_INIT(). Use _stdin_r() to get the file pointer instead of stdin. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Regenerate Makefile.inJon TURNEY2015-06-291-2/+0
| | | | | | | | | | | | | | | Regenerate Makefile.in with changes in commits 153385d8 and 433aad91 2015-06-29 Jon Turney <jon.turney@dronecode.org.uk> * libc/ctype/Makefile.in: Regenerate. * libc/posix/Makefile.in: Ditto. * libc/stdio/Makefile.in: Ditto. * libc/stdio64/Makefile.in: Ditto. * libc/stdlib/Makefile.in: Ditto. * libc/string/Makefile.in: Ditto. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Don't chew files which contain no documentation markupJon TURNEY2015-06-241-2/+0
| | | | | | | | | | | | | | | Don't chew files which contain no documentation markup. Neither of the alternatives for MALLOCR (mallocr.c or nano-mallocr.c) contain any documentation markup. 2015-06-23 Jon Turney <jon.turney@dronecode.org.uk> * libc/stdlib/Makefile.am (CHEWOUT_FILES): Remove $(MALLOCR).def. * libc/stdio/Makefile.am (CHEWOUT_FILES): Remove getwc.def and putwc.def. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Fix mismatched parentheses in documentation.Jon TURNEY2015-06-241-1/+1
| | | | | | | | | | | 2015-06-23 Jon Turney <jon.turney@dronecode.org.uk> * libc/locale/locale.c: Fix mismatched parentheses in documentation. * libc/locale/locale.tex: Ditto. * libc/stdio/fgetwc.c: Ditto. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Fix an inconsistent use of '.' in FUNCTIONJon TURNEY2015-06-231-1/+1
| | | | | | | | | | | | Fix an inconsistent use of '.' to separate function names in FUNCTION. ',' is used everywhere else. 2015-06-23 Jon Turney <jon.turney@dronecode.org.uk> * libc/stdio/fread.c: Fix inconsistent use of '.' to separate function names in FUNCTION mark up. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Correct a non-ANSI prototype in SYNOPSISJon TURNEY2015-06-231-1/+1
| | | | | | | | 2015-06-23 Jon Turney <jon.turney@dronecode.org.uk> * libc/stdio/getchar_u.c: Fix a non-ANSI prototype in SYNOPSIS. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Fix makedoc markup used in texinfo sourceJon TURNEY2015-06-231-1/+1
| | | | | | | | | 2015-06-23 Jon Turney <jon.turney@dronecode.org.uk> * libc/signal/signal.tex: Use texinfo not makedoc markup. * libc/stdio/stdio.tex: Ditto. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Implement BSD/GNU unlocked stdio extensions.Yaakov Selkowitz2014-12-1839-75/+1738
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. Add necessary dependencies. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/clearerr.c: Document unlocked variant. * libc/stdio/clearerr_u.c: New file. * libc/stdio/feof.c: Document unlocked variant. * libc/stdio/feof_u.c: New file. * libc/stdio/ferror.c: Document unlocked variant. * libc/stdio/ferror_u.c: New file. * libc/stdio/fflush.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fflush_u.c: New file. * libc/stdio/fgetc.c: Document unlocked variants. * libc/stdio/fgetc_u.c: New file. * libc/stdio/fgets.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fgets_u.c: New file. * libc/stdio/fgetwc.c: Document unlocked variants. (__fgetwc): Make non-static. * libc/stdio/fgetwc_u.c: New file. * libc/stdio/fgetws.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fgetws_u.c: New file. * libc/stdio/fileno.c: Document unlocked variant. * libc/stdio/fileno_u.c: New file. * libc/stdio/fputc.c: Document unlocked variants. * libc/stdio/fputc_u.c: New file. * libc/stdio/fputs.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fputs_u.c: New file. * libc/stdio/fputwc.c: Document unlocked variants. (__fputwc): Make non-static. * libc/stdio/fputwc_u.c: New file. * libc/stdio/fputws.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fputws_u.c: New file. * libc/stdio/fread.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fread_u.c: New file. * libc/stdio/fwrite.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fwrite_u.c: New file. * libc/stdio/getwc_u.c: New file. * libc/stdio/getwchar.c: Document unlocked variants. * libc/stdio/getwchar_u.c: New file. * libc/stdio/local.h: Define locking macros as empty ifdef __IMPL_UNLOCKED__. (__fgetwc, __fputwc): Declare. * libc/stdio/putwc_u.c: New file. * libc/stdio/putwchar.c: Document unlocked variants. * libc/stdio/putwchar_u.c: New file.
* * stdio.tex: Add menu entries for __fsetlocking and stdio_ext.Corinna Vinschen2014-12-182-1/+3
| | | | * stdio_ext.c: Add "stdio_ext" to synopsis.
* * libc/include/stdio.h (__SNLK): Define.Yaakov Selkowitz2014-12-155-7/+129
| | | | | | | | | | | | | | | * libc/include/stdio_ext.h (FSETLOCKING_QUERY, FSETLOCKING_INTERNAL, FSETLOCKING_BYCALLER): Define. (__fsetlocking): Declare. * libc/stdio/Makefile.am: Build fsetlocking.c. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/fsetlocking.c: New file. * libc/stdio/local.h (_newlib_flockfile_start): Make _flockfile call dependent on __SNLK flag. (_newlib_flockfile_exit, _newlib_flockfile_end): Ditto for _funlockfile calls. Define all locking macros as empty if __SINGLE_THREAD__. * libc/stdio/stdio.tex: Include fsetlocking.def.
* * libc/include/stdio_ext.h: Rename __fwriteable to __fwritable.Yaakov Selkowitz2014-12-114-0/+128
| | | | | | | | | | [!__GNUC__]: Declare real functions for the macros, and make the macros conditional on !__cplusplus. * libc/stdio/Makefile.am (ELIX_4_SOURCES): Add stdio_ext.c. (CHEWOUT_FILES): Add stdio_ext.def. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/stdio.tex: Include stdio_ext.def. * libc/stdio/stdio_ext.c: New file.
* * libc/stdio/nano-vfprintf_i.c (_printf_i): Use LONGINT when void* isCorinna Vinschen2014-11-201-1/+3
| | | | larger than an int.
* * libc/stdio/nano-vfprintf_i.c (_printf_i): Use Newlib approach toCorinna Vinschen2014-11-061-9/+9
| | | | | handle string that might be not nul-terminated. * testsuite/newlib.stdio/nulprintf.c: New test.
* * libc/stdio/vfprintf.c (_VFPRINTF_R): Remove unnecessary comparison.Corinna Vinschen2014-10-291-4/+2
|
* * libc/stdio/findfp.c (_cleanup_r): Call _fflush_r when configurationCorinna Vinschen2014-09-051-4/+9
| | | | option "--enable-lite-exit" is in effect. Refactor the code.
* * libc/stdio/fwalk.c (_fwalk_reent): Remove redundant test.Corinna Vinschen2014-09-051-5/+2
|
* * libc/stdio/findfp.c (std): Don't inline when optimizing for code size.Corinna Vinschen2014-08-141-0/+4
|