summaryrefslogtreecommitdiffstats
path: root/libc/stdio
Commit message (Collapse)AuthorAgeFilesLines
* Fix a couple of issues in configurations I hadn't tested.Manuel Novoa III2004-05-071-0/+2
|
* Oops.. The custom stream funcs should only be compiled if wanted.Manuel Novoa III2004-02-131-2/+4
|
* New stdio core. Should be more maintainable. Fixes a couple of bugs.Manuel Novoa III2004-02-11100-7225/+8657
| | | | | | | | Codepaths streamlined. Improved performance for nonthreaded apps when linked with a thread-enabled libc. Minor iconv bug and some locale/thread related startup issues fixed. These showed up in getting a gcj-compiled java helloworld app running. Removed some old extension functions... _stdio_fdout and _stdio_fsfopen.
* Fix __freadable and __fwritable... were using '~' instead of '!'. (ugh)Manuel Novoa III2004-01-021-10/+13
| | | | | | Fix (hopefully) a potential problem with failed freopen() calls. The fix isn't tested since I've been working on the replacement stdio core code which will go in after the next release.
* Oops... temporarily support the old stdio code.Manuel Novoa III2004-01-021-0/+5
|
* Rewrite popen for SUSv3 compliance.Manuel Novoa III2004-01-021-47/+171
| | | | | | | Added a list of popen()'d to store pids and use waitpid() in pclose(). Loop on waitpid() failure due to EINTR as required. Close parent's popen()'d FILEs in the {v}fork()'d child. Fix failure exit code for failed execve().
* Fix a long-standing bug with pthreads. A couple of linuxthreads filesManuel Novoa III2003-12-271-6/+6
| | | | | | | | | | | | | | | | were including libc-lock.h which had a bunch of weak pragmas. Also, uClibc supplied a number of no-op weak thread functions even though many weren't needed. This combined result was that sometimes the functional versions of thread functions in pthread would not override the weaks in libc. While fixing this, I also prepended double-underscore to all necessary weak thread funcs in uClibc, and removed all unused weaks. I did a test build, but haven't tested this since these changes are a backport from my working tree. I did test the changes there and no longer need to explicitly add -lpthread in the perl build for perl to pass its thread self tests.
* Fix a couple of 'declaration after statement' errors.Manuel Novoa III2003-12-141-1/+1
|
* Fix the return value for fputs when passed an empty string.Manuel Novoa III2003-11-191-1/+4
| | | | | Indirectly detected by gmp-4.1.2 self-tests and reported by "Peter S. Mazinger" <ps.m@gmx.net>.
* Peter Kjellerstedt writes:Eric Andersen2003-10-181-1/+1
| | | | | | | rm.patch: * Define $(RM) as rm -f in Rules.mak and test/Rules.mak (this is the same definition as gmake uses by default). * Change all occurrences of rm and rm -f into $(RM).
* Quick fix to make sure vfprintf always checks stream orientation whenManuel Novoa III2003-09-231-0/+19
| | | | wchar support is enabled.
* Modify _stdio_READ to conform with C99, as stdio input behavior uponManuel Novoa III2003-09-221-28/+66
| | | | | | | | | | | | encountering EOF changed with Defect Report #141. In the current standard, the stream's EOF indicator is "sticky". Once it is set, all further input from the stream should fail until the application explicitly clears the EOF indicator (clearerr(), file positioning), even if more data becomes available. Fixed a bug in fgets. Wasn't checking for read errors. Minor thread locking optimizations to avoid some unnecessary locking. Remove the explicit calls to __builtin_* funcs, as we really need to implement a more general solution.
* Ugh... EOF handling by scanf was completely broken. :-( Regretably,Manuel Novoa III2003-09-221-67/+66
| | | | | | | | I got my mind fixed in one mode and didn't comply with the standards. Things should be fixed now, but comparision testing is difficult when glibc's scanf is broken and they stubbornly refuse to even acknowledge that it is... even when confronted by specific examples from the C99 standards and from an official C standard defect report.
* Fix a problem reported by Atsushi Nemoto <anemo@mba.ocn.ne.jp>Manuel Novoa III2003-09-131-3/+7
| | | | for environments where long and long long are the same size.
* Signifcantly speed out integer to string conversion for printf.Manuel Novoa III2003-09-081-49/+38
| | | | | Printf still needs some performance work done though. Also some bufferless stdio cleanups.
* Implement vsnprintf (old_vfprintf only) and vsnscanf when uClibc isManuel Novoa III2003-09-064-70/+358
| | | | | | | | configured with non-buffered stdio and non-wchar mode. Fix a couple of bugs that showed up in minimalist configurations. Update old_vfprintf to handle size qualifiers on the integer and %n conversions. It now passed the glibc printf tests with the exception of a floating point rounding difference.
* Always build _store_inttype since it is used by the new scanf.Manuel Novoa III2003-09-051-3/+3
|
* Oops... Forgot to convert this to the new floating point conversion func.Manuel Novoa III2003-09-051-6/+48
|
* Fix precision bug for %g conversion specifier when using %f style.Manuel Novoa III2003-09-011-3/+4
|
* scanf %lc,%ls,%l[ would always set mb_fail on eof or error,Manuel Novoa III2003-08-181-8/+22
| | | | | even when just starting a new mb char. wscanf would incorrectly unget in certain situations.
* Add a new *scanf implementation, includeing the *wscanf functions.Manuel Novoa III2003-08-015-936/+2806
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Should be standards compliant and with several optional features, including support for hexadecimal float notation, locale awareness, glibc-like locale-specific digit grouping with the `'' flag, and positional arg support. I tested it pretty well (finding several bugs in glibc's scanf in the process), but it is brand new so be aware. The *wprintf functions now support floating point output. Also, a couple of bugs were squashed. Finally, %a/%A conversions are now implemented. Implement the glibc xlocale interface for thread-specific locale support. Also add the various *_l(args, locale_t loc_arg) funcs. NOTE!!! setlocale() is NOT threadsafe! NOTE!!! The strto{floating point} conversion functions are now locale aware. The also now support hexadecimal floating point notation. Add the wcsto{floating point} conversion functions. Fix a bug in mktime() related to dst. Note that unlike glibc's mktime, uClibc's version always normalizes the struct tm before attempting to determine the correct dst setting if tm_isdst == -1 on entry. Add a stub version of the libintl functions. (untested) Fixed a known memory leak in setlocale() related to the collation data. Add lots of new config options (which Erik agreed to sort out :-), including finally exposing some of the stripped down stdio configs. Be careful with those though, as they haven't been tested in a long time. (temporary) GOTCHAs... The ctype functions are currently incorrect for 8-bit locales. They will be fixed shortly. The ctype functions are now table-based, resulting in larger staticly linked binaries. I'll be adding an option to use the old approach in the stub locale configuration.
* Bug fix from Peter Kjellerstedt <peter.kjellerstedt@axis.com>. vfscanf wasManuel Novoa III2003-07-171-1/+9
| | | | | not setting the FILE bufread member to flag the end of the buffer. Also, do not set bufgetc member if getc macro support is disabled.
* Yikes! This was doing another lock instead of unlocking the stream.Manuel Novoa III2003-07-141-1/+1
|
* Do not let isatty mess up errnoEric Andersen2003-06-271-3/+11
|
* Change 'undefined behavior' of fflush() on readonly or reading streamsManuel Novoa III2003-06-241-8/+18
| | | | | | | to match that of current glibc; i.e. don't do anything and return success. Apparently, php calls fflush() on a file opened as readonly before trying to read. Eventually I'll add some config options to flag this and several other instances of nonportable code.
* Sorry. Changed this while fixing the last bug and forgot to change itManuel Novoa III2003-05-231-1/+1
| | | | back. Unfortunately, none of my test cases caught it.
* Fix (hopefully) scanf behavior for nul bytes in the stream when processingManuel Novoa III2003-05-152-7/+23
| | | | | | | %c, %s, and %[ specifiers. Note that scanf is undergoing rewrite so I didn't bother optimizing this. I did run all my regression tests though. Set EOF correctly for fmemopen on readonly streams. I really need to check what glibc behavior is for the various open modes though.
* Wasn't thinking... we don't need to seek to end when appending if stdioManuel Novoa III2003-01-231-12/+0
| | | | is built without buffer support.
* Fixed a bug related file position in append mode. _stdio_fwrite nowManuel Novoa III2003-01-221-11/+52
| | | | | | | | | seeks to the end of the stream when append mode is set and we are transitioning to write mode, so that subsequent ftell() return values are correct. Also fix _stdio_fopen to support fdopen() with append specified when the underlying file didn't have O_APPEND set. It now sets the O_APPEND flag as recommended by SUSv3 and is done by glibc.
* Fix a silly bug in _wstdio_fwrite. wprintf %s should now work correctly.Manuel Novoa III2003-01-051-1/+3
|
* The big thing is locale dependent collation support.Manuel Novoa III2002-12-202-9/+47
| | | | Also added outdigit support and (legacy) YESSTR/NOSTR support.
* If the wait failed in pclose it would return a random status codeDavid McCullough2002-12-011-1/+2
| | | | instead of -1 as expected.
* Fix an ifdef mismatch.Manuel Novoa III2002-11-271-2/+2
|
* Ok... here's the summary:Manuel Novoa III2002-11-223-379/+823
| | | | | | | | | | | | | | Hopefully locale support will build when cross compiling now. Collation is still not supported, but that's what I'm currently working on. In the next couple of days, I'll probably put up a couple of files for download that will save people the trouble of generating all the glibc locales. Added *wprintf functions, although they currently don't support floating point. That will be fixed when I rewrite _dtostr... or possibly before. Added the wcsto{inttype} functions. Added iconv() and a mini iconv utility. The require locale support and only provide for conversions involving the various unicode encodings { UCS-4*, UCS-2*, UTF-32*, UTF-16*, UTF-8 }, the 8-bit codesets built with the locale data, and the internal WCHAR_T.
* For now, leave the "Oddly enough, __fsetlocking() is NOT threadsafe."Eric Andersen2002-11-051-0/+2
| | | | comment as an mjn3 only item.
* Add printf wchar support for %lc (%C) and %ls (%S).Manuel Novoa III2002-11-041-14/+99
| | | | | | | | | | | | | Require printf format strings to be valid multibyte strings beginning and ending in their initial shift state, as per the stds. Fixed a bug in _wchar_wcsntoutf8s(). Don't store wcs position if dst is NULL. Also, introduce an awful hack into _wchar_wcsntoutf8s() and wcsrtombs() in order to support %ls in printf. See comments below for details. Change behaviour of wc<->mb functions when in the C locale. Now they do a 1-1 map for the range 0x80-UCHAR_MAX. This is for backwards compatibility and consistency with the stds requirements that a printf format string by a valid multibyte string beginning and ending in it's initial shift state.
* It was easy enough to respect locale-specific decimal point for printfManuel Novoa III2002-11-031-2/+15
| | | | | floating point output, so at least implement that. But grouping will have to wait for the rewrite of _dtostr.
* Implement locale-specific grouping in printf for base 10 integer conversionsManuel Novoa III2002-11-032-5/+94
| | | | | when the grouping flag "'" is specified. Grouping for floating point values may wait until I do a rewrite of the floating pt to string code...
* Ok, this commit is _huge_ and its gonna change the world. I'veEric Andersen2002-10-312-22/+5
| | | | | | | | | | | | | | | been working on a new config system on and off for about 6 months now, but I've never been fully satisfied. Well, I'm finally am happy with the new config system, so here it is. This completely removes the old uClibc configuration system, and replaces it with an entirely new system based on LinuxKernelConf, from http://www.xs4all.nl/~zippel/lc/ As it turns out, Linus has just merged LinuxKernelConf into Linux 2.5.45, so it looks like I made the right choice. I have thus far updated only x86. I'll be updating the other architectures shortly. -Erik
* Fix a silly typo for ManuelEric Andersen2002-10-291-1/+1
| | | | -Erik
* Fix a problem in vasprintf (reported by vodz a while back) when builtManuel Novoa III2002-10-291-14/+35
| | | | | | without custom stream support. In that case, it is necessary to do a va_copy. Note: The affected code is not built in the stock config. Also, make sure each va_copy has a matching va_end, as required by C99.
* Patch from Tero_Lyytik�inen <tero@paravant.fi> to fix bug in matchcharManuel Novoa III2002-09-061-0/+4
| | | | case.
* Changed fclose behavior when custom streams were enabled. Previously,Manuel Novoa III2002-08-251-2/+21
| | | | | | | | | | | the cookie pointer was set to NULL as a debugging aid. However, some of the perl 5.8 test rely on being able to close stderr and still try writing to it. So now, the cookie pointer and handler function pointers are set to that it is a "normal" file with a file descriptor of -1. Note: The cookie pointer is reset to NULL if the FILE struct is free'd by fclose.
* Kill the HAS_LONG_LONG option. It really did not make a lot ofEric Andersen2002-08-251-16/+0
| | | | | | sense to exclude it, gcc always supports long long, and we never fully excluded long long anyways (off64_t for example). -Erik
* Fix two problems with printf that showed up in the python 2.2.1 tests;Manuel Novoa III2002-08-171-1/+10
| | | | One involving %o and one involving %f.
* __fsetlocking() and FILE field user_locking were completely broken. :-(Manuel Novoa III2002-08-133-9/+26
| | | | | | I think they're fixed now (I've run a few tests). Note: __fsetlocking() is not threadsafe... but glibc's doesn't appear to be either.
* Revert commit by davidm to printf.c that initialized conv_numManuel Novoa III2002-08-122-7/+7
| | | | | | | | | needlessly. To do so increases the generated code size with bcc. Eliminate duplicate define warnings in wstring.c. Fix potentially broken preprocessor comparisons. The preprocessor converts integers to maximal signed type, so inequality comparisons involving UINTMAX_MAX, ULLONG_MAX, and (if no long long) ULONG_MAX were potentially broken.
* Fix a number of compile time warnings so that uClibc will build with -Werror ↵David McCullough2002-08-091-1/+1
| | | | | | using a 3.0.4 version of the sh-linux-gcc compiler.
* Changed fflush() behavior to no-op for r/w streams in read-mode.Manuel Novoa III2002-08-061-17/+33
| | | | | | | | | | | | | This falls under undefined behavior wrt ANSI/ISO C99, but SUSv3 seems to treat it as a no-op and it occurs in some apps. Fixed a problem with _stdio_fwrite() not checking for underlying write() failures. Fixed both _stdio_fwrite() and _stdio_fread() to make sure that the putc and getc macros were disabled if the stream was in and error state. The above changes should take care of a problem initially reported by "Steven J. Hill" <sjhill@realitydiluted.com>.
* A couple of little cleanups I forgot to check in.Manuel Novoa III2002-08-031-2/+0
|