NetBSD/lib/libc/stdio
lukem fa11ebb133 apparently ansi c only required fread(3) to return 0 if size or nmembs == 0.
however, susv2 adds the same to fwrite(3), so add the explicit check.
document this for both fread & fwrite. move diagassert for buf!=NULL to after
the (size * nmembs) == 0 check.

this has the helpful side effect of preventing the _DIAGASSERT()ion in
fwrite() being triggered by lots of 3rdparty code that calls fwrite() with
buf=NULL count=0
2001-01-25 02:06:25 +00:00
..
Makefile.inc XCU5: Add fseeko() and ftello() functions which provide the functionality of 2000-07-08 13:46:33 +00:00
_fseeko.c XCU5: Add fseeko() and ftello() functions which provide the functionality of 2000-07-08 13:46:33 +00:00
_ftello.c XCU5: Add fseeko() and ftello() functions which provide the functionality of 2000-07-08 13:46:33 +00:00
asprintf.c Initialize f._file for locking primitives. 2000-01-21 19:51:36 +00:00
clrerr.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
fclose.3
fclose.c Do the lock *after* checking that the fp is valid. 2000-01-21 19:53:02 +00:00
fdopen.c This is for completeness only (to make fdopen symmetric with fopen and freopen) 2000-11-29 15:36:42 +00:00
feof.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
ferror.3
ferror.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
fflush.3
fflush.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
fgetc.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
fgetln.3 Sprinkle some __restrict into stdio. 2000-12-29 15:22:48 +00:00
fgetln.c Delint. 2000-01-22 22:19:07 +00:00
fgetpos.c In fgetpos() and fsetpos(), use ftello() and fseeko(), respectively, to avoid 2000-07-08 13:51:27 +00:00
fgets.3 Sprinkle some __restrict into stdio. 2000-12-29 15:22:48 +00:00
fgets.c missing ; 1999-11-14 18:19:57 +00:00
fileno.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
findfp.c Just call fflush() from _cleanup(), since it does the right locking. 2000-01-21 19:55:02 +00:00
flags.c add and "f" flag to fopen that makes sure we are opening a plain file, 2000-01-15 01:11:45 +00:00
floatio.h
fopen.3 Sprinkle some __restrict into stdio. 2000-12-29 15:22:48 +00:00
fopen.c make sure we preserve errno. 2000-11-29 15:30:20 +00:00
fprintf.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
fpurge.c Do the lock *after* checking that the fp is valid. 2000-01-21 19:53:02 +00:00
fputc.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
fputs.3 Sprinkle some __restrict into stdio. 2000-12-29 15:22:48 +00:00
fputs.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
fread.3 apparently ansi c only required fread(3) to return 0 if size or nmembs == 0. 2001-01-25 02:06:25 +00:00
fread.c apparently ansi c only required fread(3) to return 0 if size or nmembs == 0. 2001-01-25 02:06:25 +00:00
freopen.c Add checks for O_NDELAY [which indicates that we only want plain files], 2000-11-29 15:31:10 +00:00
fscanf.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
fseek.3 Sprinkle some __restrict into stdio. 2000-12-29 15:22:48 +00:00
fseek.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
fseeko.c Oops, forgot to define weak aliases for public names. 2000-07-26 08:52:57 +00:00
fsetpos.c In fgetpos() and fsetpos(), use ftello() and fseeko(), respectively, to avoid 2000-07-08 13:51:27 +00:00
ftell.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
ftello.c Oops, forgot to define weak aliases for public names. 2000-07-26 08:52:57 +00:00
funopen.3
funopen.c
fvwrite.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
fvwrite.h
fwalk.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
fwrite.c apparently ansi c only required fread(3) to return 0 if size or nmembs == 0. 2001-01-25 02:06:25 +00:00
getc.3
getc.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
getchar.c
gets.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
gettemp.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
getw.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
glue.h fix duplicate declaration of __glue. 2000-12-10 04:17:28 +00:00
local.h
makebuf.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
mkdtemp.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
mkstemp.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
mktemp.3
mktemp.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
perror.3 Last of the .Os cleanups. .Os is defined in the tmac.doc-common file, 1999-03-22 19:44:33 +00:00
perror.c No need for "namespace.h". 1999-08-22 12:52:28 +00:00
printf.3 Sprinkle some __restrict into stdio. 2000-12-29 15:22:48 +00:00
printf.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
putc.3
putc.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
putchar.c
puts.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
putw.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
refill.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
remove.3 xref symlink(7) 1999-09-26 21:00:25 +00:00
remove.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
rewind.c Call __sclearerr(), nor clearerr(), so we don\`t try to double lock. 2000-01-21 19:54:13 +00:00
rget.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
scanf.3 Sprinkle some __restrict into stdio. 2000-12-29 15:22:48 +00:00
scanf.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
setbuf.3 Sprinkle some __restrict into stdio. 2000-12-29 15:22:48 +00:00
setbuf.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
setbuffer.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
setvbuf.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
snprintf.c Actually EINVAL fits the circumstances better. 2000-10-19 09:47:43 +00:00
sprintf.c Initialize f._file for locking primitives. 2000-01-21 19:51:36 +00:00
sscanf.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
stdio.3 Last of the .Os cleanups. .Os is defined in the tmac.doc-common file, 1999-03-22 19:44:33 +00:00
stdio.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
tempnam.c
tmpfile.c
tmpnam.3
tmpnam.c
ungetc.3
ungetc.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
vasprintf.c Initialize f._file for locking primitives. 2000-01-21 19:51:36 +00:00
vfprintf.c initialize mbstate_t properly. 2000-12-30 04:13:25 +00:00
vfscanf.c Replace internal use of strto{,u}q() with strto{,u}ll(). 2000-03-08 19:33:47 +00:00
vprintf.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
vscanf.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
vsnprintf.c Actually EINVAL fits the circumstances better. 2000-10-19 09:47:43 +00:00
vsprintf.c Initialize f._file for locking primitives. 2000-01-21 19:51:36 +00:00
vsscanf.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
wbuf.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00
wsetup.c back out the #ifdef _DIAGNOSTIC argument checks; too many people complained. 1999-09-20 04:38:56 +00:00