History log of /seL4-refos-master/libs/libmuslc/src/stdio/fputs.c
Revision Date Author Comments
# 10a17dfb 16-Feb-2016 Rich Felker <dalias@aerifal.cx>

fix assumption in fputs that fwrite returning 0 implies an error

internally, the idiom of passing nmemb=1 to fwrite and interpreting
the return value of fwrite (which is necessarily 0 or 1) as
failure/success is fairly widely used. this is not correct, however,
when the size argument is unknown and may be zero, since C requires
fwrite to return 0 in that special case. previously fwrite always
returned nmemb on success, but this was changed for conformance with
ISO C by commit 500c6886c654fd45e4926990fee2c61d816be197.


# 6e2bb7ac 04-Sep-2014 Rich Felker <dalias@aerifal.cx>

fix multiple stdio functions' behavior on zero-length operations

previously, fgets, fputs, fread, and fwrite completely omitted locking
and access to the FILE object when their arguments yielded a zero
length read or write operation independent of the FILE state. this
optimization was invalid; it wrongly skipped marking the stream as
byte-oriented (a C conformance bug) and exposed observably missing
synchronization (a POSIX conformance bug) where one of these functions
could wrongly complete despite another thread provably holding the
lock.


# 835f9f95 08-Nov-2012 Rich Felker <dalias@aerifal.cx>

clean up stdio_impl.h

this header evolved to facilitate the extremely lazy practice of
omitting explicit includes of the necessary headers in individual
stdio source files; not only was this sloppy, but it also increased
build time.

now, stdio_impl.h is only including the headers it needs for its own
use; any further headers needed by source files are included directly
where needed.


# 400c5e5c 06-Sep-2012 Rich Felker <dalias@aerifal.cx>

use restrict everywhere it's required by c99 and/or posix 2008

to deal with the fact that the public headers may be used with pre-c99
compilers, __restrict is used in place of restrict, and defined
appropriately for any supported compiler. we also avoid the form
[restrict] since older versions of gcc rejected it due to a bug in the
original c99 standard, and instead use the form *restrict.


# 0b44a031 11-Feb-2011 Rich Felker <dalias@aerifal.cx>

initial check-in, version 0.5.0