summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fread.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Restore the optimization for unbuffered I/O. The buffer needs tomillert2018-12-161-1/+31
| | | | | be reset before each call to __srefill(). Passes new regress. OK semarie@
* Back out rev 1.17 for now, it causes issues with python when buildingmillert2018-12-161-31/+1
| | | | databases/tdb from ports.
* Revisit the optimization for unbuffered I/O. We can use the buffermillert2018-12-141-1/+31
| | | | | | passed to fread(3) directly in the FILE * and call __srefill() in a loop without the memcpy(). This preserves the expected behavior in all cases. OK semarie@, "This is neat" tedu@
* Back out the optimization in rev 1.13, it does not update flags onmillert2018-12-141-16/+1
| | | | EOF or error. This caused a regression in the cPickle python extension.
* Delete casts to off_t and size_t that are implied by assignmentsguenther2016-09-211-3/+3
| | | | | | | or prototypes. Ditto for some of the char* and void* casts too. verified no change to instructions on ILP32 (i386) and LP64 (amd64) ok natano@ abluhm@ deraadt@ millert@
* Add framework for resolving (pun intended) libc namespace issues, usingguenther2015-08-311-1/+2
| | | | | | | | | | | | wrapper .h files and asm labels to let internal calls resolve directly and not be overridable or use the PLT. Then, apply that framework to most of the functions in stdio.h, string.h, err.h, and wchar.h. Delete the should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here. tests clean on i386, amd64, sparc64, powerpc, and mips64 naming feedback from kettenis@ and millert@ ok kettenis@
* don't do silly (and slow) one byte reads in unbuffered mode.tedu2014-12-081-1/+16
| | | | from enh at google
* Extend fread() and fwrite() to check for integer overflow, in which casederaadt2014-05-011-1/+15
| | | | | errno EOVERFLOW is returned and error is set on the FILE. ok kettenis miod beck
* Several stdio functions were failing to set the stream orientationguenther2009-11-211-1/+2
| | | | | | to 'narrow' as they should. "looks correct" millert@ "makes sense" blambert@
* Fix the handle locking in stdio to use flockfile/funlockfilekurt2009-11-091-1/+4
| | | | | | | | | | | | | internally when and where required. Macros in <stdio.h> are updated to automatically call the underlying functions when the process is threaded to obtain the necessary locking. A private mutex is added to protect __sglue, the internal list of FILE handles, and another to protect the one-time initialization. Some routines in libc that use getc() change to use getc_unlocked() as they're either protected by their own lock or aren't thread-safe routines anyway. committing on behalf of and okay guenther@ now that we have install media space available.
* Back out previous commit, as it caused too much growth for the installguenther2009-10-221-4/+1
| | | | media to fit
* Fix the handle locking in stdio to use flockfile/funlockfileguenther2009-10-211-1/+4
| | | | | | | | | | | | internally when and where required. Macros in <stdio.h> are updated to automatically call the underlying functions when the process is threaded to obtain the necessary locking. A private mutex is added to protect __sglue, the internal list of FILE handles, and another to protect the one-time initialization. Some routines in libc that use getc() change to use getc_unlocked() as they're either protected by their own lock or aren't thread-safe routines anyway. ok kurt@, earlier version tested by sthen@ and jj@
* fwrite() should also return 0 if either size or nmemb are 0.millert2009-07-121-4/+2
| | | | Adapted from FreeBSD. OK deraadt@
* zap remaining rcsid.espie2005-08-081-4/+1
| | | | | | Kill old files that are no longer compiled. okay theo
* deregister + ansify, no change in object code. ok deraadt@ millert@otto2004-09-281-8/+5
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* a first pass at -Wallderaadt2001-07-091-1/+2
|
* Fix RCS idstholo1996-08-191-6/+1
| | | | Make sure everything uses {SYS,}LIBC_SCCS properly
* initial import of NetBSD treederaadt1995-10-181-0/+86