summaryrefslogtreecommitdiffstats
path: root/libc/stdio/stdio.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Attempt to clean up the strerror_r situation.Manuel Novoa III2002-07-071-36/+2
|
* Enable WCHAR support for C/POSIX stub locales.Manuel Novoa III2002-07-031-134/+244
| | | | | | Implemented unformatted wide i/o functions. (ungetwc still needs testing) Fix a few bugs in wchar.c. Modifications for bcc/elks support.
* Fix perror() and printf("%m") to not call strerror(), as required by theManuel Novoa III2002-06-181-5/+48
| | | | | | | | | standards. Temporarily added a utility function to wrap Erik's strerror_r so that "Unknown error xxx" strings can be generated for errno's which cause strerror_r to fail. That utility function will eventually be merged in with the strerror/strerror_r functions when I change over to optionallly mmap'ing the system error strings to provide for lower mem comsumption on non-MMU platforms, as well as locale-specific system error messages.
* Revert Erik's patch to vasprintf and fix the real issue.Manuel Novoa III2002-06-111-0/+1
| | | | | The writer for the stream returned by open_memstream was supposed to keep the buffer nul-terminated. I apparently left out a statement.
* Fix the read/write auto-transition bugs. Note that if we can'tManuel Novoa III2002-04-091-29/+36
| | | | | | | | | | | | auto-transition, we fail the operation. This is different than glibc's apparent behavior for writing of clearing the read buffer and still failing the write without setting the stream's error flag. Also, change a number of "errno = xxx" assignments to use __set_errno(). Also, change setvbuf(file, NULL, _IO{LF}BF, 0) behavior to more closely match glibc's by keeping the current buffer and only changing the buffering mode. Update setlinebuf() in the process to match the man page behavior.
* Compile in flockfile and friends by defaultEric Andersen2002-03-211-0/+8
| | | | -Erik
* Fix a pointer bug in setvbuf reported by Bart Visscher <magick@Linux-Fan.com>.Manuel Novoa III2002-03-161-2/+6
|
* I vow to rerun _all_ the tests before making commits. :-(Manuel Novoa III2002-03-141-2/+2
| | | | | I successfully managed to blow away all the modeflags for the file _except_ the one dealing with buffering...
* Fix stdin/stdout initialization of buffering type. I had changed theManuel Novoa III2002-03-131-2/+2
| | | | default static initiailization and forgotten to update _stdio_init().
* Fix another O_LARGEFILE bug. Also, I forget to make floating point optionalManuel Novoa III2002-03-121-2/+10
| | | | in the new printf code.
* So much for fcntl flags being resonably consistent across archs... (hopefully)Manuel Novoa III2002-03-121-10/+14
| | | | | fix O_APPEND and O_LARGEFILE handling in _stdio_fopen(). Someone else will have to check of course...
* Fix fflush(NULL) and tweak _stdio_term() for the unbuffered stdio option.Manuel Novoa III2002-03-121-2/+10
|
* Deal with cvs "feature"... or is that cvs _user_...Manuel Novoa III2002-03-121-0/+3171
|
* Swap in the new stdio code.Manuel Novoa III2002-03-121-1117/+0
|
* Be consistant and use an unsigned char * throughoutEric Andersen2002-02-261-2/+3
|
* I shouldn't try to program when sleepy, since I totally botchedEric Andersen2002-02-251-4/+4
| | | | | the fcntl interface... -Erik
* When messing with fd NONBLOCK status, put things back the way we foundEric Andersen2002-02-251-1/+4
| | | | | | them afterwards. As was, this hosed things up for fds shared with a parent process. Very bad for shells... Oops. -Erik
* IEEE Std 1003.1-2001 says that the "fclose() function shall fail [with]Eric Andersen2002-02-231-7/+1
| | | | | | | | EINTR [when] the fclose() function was interrupted by a signal". But looking in the current uClibc stdio.c for some bizarre reason we had a special case where when errno was EINTR, we would keep on trying instead. Doh! Fix that, -Erik
* Per discussion with Manuel, when we call __stdio_flush_buffersEric Andersen2002-02-231-1/+9
| | | | | | from abort() and from _exit(), we need to ensure that flushing will not cause us to block. So use fcntl to set the fd's to non-block mode...
* Rename __stdio_close_all to __stdio_flush_buffers. Eliminate anEric Andersen2002-02-181-2/+2
| | | | unnecessary variable
* Add missing ctermid. Also add putc and getc (in case they getEric Andersen2001-11-211-0/+19
| | | | | undefined which is a valid thing to do) -Erik
* This commit makes large file support actually work (when enabled inEric Andersen2001-10-171-9/+25
| | | | | the config file). I've tested this and it works for me. -Erik
* Fix fseek behavior.Manuel Novoa III2001-09-251-2/+3
|
* Use "stdin", "stdout", and "stderr", not "_stdin", "_stdout", andEric Andersen2001-08-241-10/+10
| | | | | "_stderr", since this is what gcc and libgcc expect... -Erik
* Add the __fopen prototype, since I pulled it from stdio.hEric Andersen2001-08-241-0/+4
|
* Oops... left in a debugging line.Manuel Novoa III2001-07-281-1/+0
|
* Back out the changes to _uClibc_fread and loop in fread() if incomplete, toManuel Novoa III2001-07-281-22/+21
| | | | | | | | | | avoid problems with fgets on tty streams. I actually did some testing this time. ;-) Note: there is a difference in behavior between glibc and uClibc here regarding fread() on a tty stream. glibc's fread() seems to return after reading all _available_ data even if not at end-of-file, while uClibc's fread() continues reading until all requested or eof or error. The latter behavior seems correct w.r.t. the standards.
* Yes... the previous "fix" was broken too... the result of careless cuttingManuel Novoa III2001-07-261-1/+1
| | | | and pasting while pressed for time. I haven't checked this one either. :-(
* Ok... the fix wasn't quite so straightforward. Hopefully this will do it.Manuel Novoa III2001-07-251-0/+3
|
* Fix fread bug reported by Vodz. The fix is straightforward, but I haven'tManuel Novoa III2001-07-251-11/+13
| | | | tested it (lack of time).
* Commit _uClibc_fread bug fix (with minor edit) posted by Johan Adolfsson ↵Manuel Novoa III2001-06-071-0/+4
| | | | <johan.adolfsson@axis.com>.
* Fix fwrite return value bug reported by Matthias Kilian ↵Manuel Novoa III2001-05-071-1/+2
| | | | <kili@outback.escape.de>.
* Be really sneaky and use GNU ld special stuff so that whenever folksEric Andersen2001-04-251-0/+1
| | | | | | use the unsafe gets, they will get a warning from the linker. muahahaha. This method will soon be applied to fork() w/o an mmu etc... -Erik
* Fix include/errno.h to not use kernel header, and instead use bits/errno.h.Eric Andersen2001-04-061-7/+7
| | | | | | | This required we use _LIBC instead of __LIBC__ to be consistent with glibc. This had some sideffects in sys/syscalls.h. While fixing things, I made everything use __set_errno() for (eventual) thread support. -Erik
* Fix fdopen mode-compatibility test and errno setting.Manuel Novoa III2001-03-171-1/+8
|
* Fix a bad assertion test.Manuel Novoa III2001-03-071-1/+2
|
* Stupid buglet fix. Don't trash FILE bufstart if buffer allocation fails.Manuel Novoa III2001-03-011-11/+4
|
* stdio mostly rewritten... passes lots of tests now.Manuel Novoa III2001-02-271-421/+505
| | | | printf now supports long double, plus some bug fixes.
* Fix a couple of bugs in _fopen and fclose, plus change a few internals.Manuel Novoa III2001-02-191-59/+80
|
* Lots of stdio cleanups. Several bug fixes, addition of a number of functionsManuel Novoa III2001-02-191-244/+328
| | | | | to supplement macros in stdio.h, change perror to use stdio package instead of "write". Also add back in weak stdio initialization for static lib case.
* Fix stdin/stdout/stderr for now.Manuel Novoa III2001-02-151-0/+4
|
* Remove now irrelevant comment.Eric Andersen2001-02-091-3/+0
|
* Silence warnings -- add func declaration.Eric Andersen2001-02-091-0/+1
| | | | -Erik
* Revert stdio to initializing itself. Not quite a pretty but that ensures thatEric Andersen2001-02-091-1/+34
| | | | | | | we don't blow up by using too much stack space, and simplifies the job of supporting new architectures, since they don't have to mess with calling foo init functions in crt0 and cleaning up the resulting damage. -Erik
* Fixed stderr initialization bug (mine).Manuel Novoa III2001-01-241-1/+1
|
* Fix static buffer used initialization for FIXED_BUFFERS > 2.Manuel Novoa III2001-01-171-4/+13
|
* A large update from Manuel Novoa III <mnovoa3@bellsouth.net>.Eric Andersen2001-01-111-133/+62
|
* A few cleanups. Fix fflush so it remembers to init stdio.Eric Andersen2000-12-121-8/+10
|