musl/src/stdio
Rich Felker 6e2bb7acf4 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.
2014-09-04 22:21:17 -04:00
..
__fclose_ca.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
__fdopen.c in fdopen, avoid setting O_APPEND flag if it's already set 2014-02-07 01:16:53 -05:00
__fmodeflags.c greatly improve freopen behavior 2012-10-24 21:16:06 -04:00
__fopen_rb_ca.c add O_CLOEXEC fallback for open and related functions 2014-06-06 15:42:42 -04:00
__lockfile.c document self-synchronized destruction issue for stdio locking 2012-12-10 18:31:39 -05:00
__overflow.c major stdio overhaul, using readv/writev, plus other changes 2011-03-28 01:14:44 -04:00
__stdio_close.c global cleanup to use the new syscall interface 2011-03-20 00:16:43 -04:00
__stdio_exit.c work around constant folding bug 61144 in gcc 4.9.0 and 4.9.1 2014-07-16 21:32:06 -04:00
__stdio_read.c always initialize thread pointer at program start 2014-03-24 16:57:11 -04:00
__stdio_seek.c don't disable seeking after first seek failure 2011-04-02 13:55:54 -04:00
__stdio_write.c always initialize thread pointer at program start 2014-03-24 16:57:11 -04:00
__stdout_write.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
__string_read.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
__toread.c simplify __stdio_exit static linking logic 2014-07-16 20:44:22 -04:00
__towrite.c simplify __stdio_exit static linking logic 2014-07-16 20:44:22 -04:00
__uflow.c fix getc - the classic error of trying to store EOF+0-255 in a char type.. 2011-03-28 17:31:01 -04:00
asprintf.c cleanup asprintf stuff 2011-02-20 17:19:37 -05:00
clearerr.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
dprintf.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
ext.c change stdio_ext __freading/__fwriting semantics slightly 2012-06-17 21:24:58 -04:00
ext2.c fix invalid implicit pointer conversion in gnulib-compat functions 2012-09-06 23:27:55 -04:00
fclose.c fix false ownership of stdio FILEs due to tid reuse 2014-08-23 23:35:10 -04:00
feof.c correct locking in stdio functions that tried to be lock-free 2012-10-24 23:16:41 -04:00
ferror.c correct locking in stdio functions that tried to be lock-free 2012-10-24 23:16:41 -04:00
fflush.c work around constant folding bug 61144 in gcc 4.9.0 and 4.9.1 2014-07-16 21:32:06 -04:00
fgetc.c separate getc/putc from fgetc/fputc 2012-10-27 19:52:40 -04:00
fgetln.c include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
fgetpos.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
fgets.c fix multiple stdio functions' behavior on zero-length operations 2014-09-04 22:21:17 -04:00
fgetwc.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
fgetws.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
fileno.c correct locking in stdio functions that tried to be lock-free 2012-10-24 23:16:41 -04:00
flockfile.c add proper fuxed-based locking for stdio 2011-07-30 08:02:14 -04:00
fmemopen.c always add memory streams to stdio open file list 2012-11-09 14:26:25 -05:00
fopen.c add O_CLOEXEC fallback for open and related functions 2014-06-06 15:42:42 -04:00
fprintf.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
fputc.c separate getc/putc from fgetc/fputc 2012-10-27 19:52:40 -04:00
fputs.c fix multiple stdio functions' behavior on zero-length operations 2014-09-04 22:21:17 -04:00
fputwc.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
fputws.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
fread.c fix multiple stdio functions' behavior on zero-length operations 2014-09-04 22:21:17 -04:00
freopen.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
fscanf.c fix argument omission in ABI-compat weak_alias for fscanf 2013-04-06 17:15:58 -04:00
fseek.c apparently fseek should not set the error flag on failed seek 2011-04-02 13:54:55 -04:00
fsetpos.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
ftell.c fix ftello result for append streams with unflushed output 2014-02-07 00:57:50 -05:00
ftrylockfile.c fix false ownership of stdio FILEs due to tid reuse 2014-08-23 23:35:10 -04:00
funlockfile.c fix false ownership of stdio FILEs due to tid reuse 2014-08-23 23:35:10 -04:00
fwide.c fix incorrect return value for fwide function 2014-07-01 18:49:54 -04:00
fwprintf.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
fwrite.c fix multiple stdio functions' behavior on zero-length operations 2014-09-04 22:21:17 -04:00
fwscanf.c Add ABI compatability aliases. 2013-04-05 23:20:28 -07:00
getc.c separate getc/putc from fgetc/fputc 2012-10-27 19:52:40 -04:00
getc_unlocked.c add some ugly aliases for LSB ABI compatibility 2012-06-02 21:20:21 -04:00
getchar.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
getchar_unlocked.c major stdio overhaul, using readv/writev, plus other changes 2011-03-28 01:14:44 -04:00
getdelim.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
getline.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
gets.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
getw.c make sure getw/putw agree with prototypes by defining _GNU_SOURCE 2012-07-04 12:18:46 -04:00
getwc.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
getwchar.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
open_memstream.c always add memory streams to stdio open file list 2012-11-09 14:26:25 -05:00
open_wmemstream.c always add memory streams to stdio open file list 2012-11-09 14:26:25 -05:00
pclose.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
perror.c minor perror behavior fix 2012-06-20 09:27:28 -04:00
popen.c fix special-case breakage in popen due to reversed argument order 2013-09-01 17:02:35 -04:00
printf.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
putc.c separate getc/putc from fgetc/fputc 2012-10-27 19:52:40 -04:00
putc_unlocked.c add some ugly aliases for LSB ABI compatibility 2012-06-02 21:20:21 -04:00
putchar.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
putchar_unlocked.c major stdio overhaul, using readv/writev, plus other changes 2011-03-28 01:14:44 -04:00
puts.c minor optimization in puts: use inline putc_unlocked macro for newline 2011-05-01 20:12:51 -04:00
putw.c putw is supposed to return 0 (not the value written) on success 2012-07-04 12:21:22 -04:00
putwc.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
putwchar.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
remove.c support linux kernel apis (new archs) with old syscalls removed 2014-05-29 21:01:32 -04:00
rename.c support linux kernel apis (new archs) with old syscalls removed 2014-05-29 21:01:32 -04:00
rewind.c rewind must clear the error indicator in addition to seeking 2011-02-22 17:11:35 -05:00
scanf.c Add ABI compatability aliases. 2013-04-05 23:20:28 -07:00
setbuf.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
setbuffer.c add more legacy functions: setlinebuf and setbuffer 2011-04-05 12:25:31 -04:00
setlinebuf.c add more legacy functions: setlinebuf and setbuffer 2011-04-05 12:25:31 -04:00
setvbuf.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
snprintf.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
sprintf.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
sscanf.c Add ABI compatability aliases. 2013-04-05 23:20:28 -07:00
stderr.c work around constant folding bug 61144 in gcc 4.9.0 and 4.9.1 2014-07-16 21:32:06 -04:00
stdin.c work around constant folding bug 61144 in gcc 4.9.0 and 4.9.1 2014-07-16 21:32:06 -04:00
stdout.c work around constant folding bug 61144 in gcc 4.9.0 and 4.9.1 2014-07-16 21:32:06 -04:00
swprintf.c include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
swscanf.c include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
tempnam.c support linux kernel apis (new archs) with old syscalls removed 2014-05-29 21:01:32 -04:00
tmpfile.c fix fd leak in tmpfile when the fdopen operation fails 2014-06-06 03:17:47 -04:00
tmpnam.c support linux kernel apis (new archs) with old syscalls removed 2014-05-29 21:01:32 -04:00
ungetc.c major stdio overhaul, using readv/writev, plus other changes 2011-03-28 01:14:44 -04:00
ungetwc.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
vasprintf.c simplify vasprintf implementation 2014-06-04 03:39:22 -04:00
vdprintf.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
vfprintf.c use cleaner code for handling float rounding in vfprintf 2014-05-30 13:06:51 -04:00
vfscanf.c add __isoc99_vfscanf weak alias to vfscanf 2014-01-08 22:52:26 +01:00
vfwprintf.c fix failure of wide printf/scanf functions to set wide orientation 2014-07-02 12:09:48 -04:00
vfwscanf.c fix failure of wide printf/scanf functions to set wide orientation 2014-07-02 12:09:48 -04:00
vprintf.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
vscanf.c Add ABI compatability aliases. 2013-04-05 23:20:28 -07:00
vsnprintf.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
vsprintf.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
vsscanf.c Add ABI compatability aliases. 2013-04-05 23:20:28 -07:00
vswprintf.c clean up stdio_impl.h 2012-11-08 16:39:41 -05:00
vswscanf.c Add ABI compatability aliases. 2013-04-05 23:20:28 -07:00
vwprintf.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
vwscanf.c Add ABI compatability aliases. 2013-04-05 23:20:28 -07:00
wprintf.c use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
wscanf.c Add ABI compatability aliases. 2013-04-05 23:20:28 -07:00