diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2013-04-10 18:47:46 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2013-04-10 18:47:46 +0000 |
commit | 602cec7f1eb17b96525d09752fd1f0ad474e3202 (patch) | |
tree | 32e10a62bf758fcbb8951c4361a974a7066461c3 /newlib/libc/stdio/makebuf.c | |
parent | b49dae4a4443858b2ce51daac3883ad0f1473145 (diff) | |
download | newlib-602cec7f1eb17b96525d09752fd1f0ad474e3202.zip newlib-602cec7f1eb17b96525d09752fd1f0ad474e3202.tar.gz newlib-602cec7f1eb17b96525d09752fd1f0ad474e3202.tar.bz2 |
2013-04-10 Bin Cheng <bin.cheng@arm.com>
* acconfig.h (_FSEEK_OPTIMIZATION): Undef
* newlib.hin (_FSEEK_OPTIMIZATION): Undef
* configure.in (--disable-newlib-fseek-optimization): New option.
* configure: Regenerated.
* libc/stdio/fflush.c (__sflush_r): Use _FSEEK_OPTIMIZATION to
control fseek optimization.
* libc/stdio/fseeko.c (_fseeko_r): Ditto.
* libc/stdio/makebuf.c (__smakebuf_r): Ditto.
* libc/stdio64/fseeko64.c (_fseeko64_r): Ditto.
Diffstat (limited to 'newlib/libc/stdio/makebuf.c')
-rw-r--r-- | newlib/libc/stdio/makebuf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/newlib/libc/stdio/makebuf.c b/newlib/libc/stdio/makebuf.c index a3f47e2..349783d 100644 --- a/newlib/libc/stdio/makebuf.c +++ b/newlib/libc/stdio/makebuf.c @@ -65,8 +65,10 @@ _DEFUN(__smakebuf_r, (ptr, fp), size = _DEFAULT_ASPRINTF_BUFSIZE; else size = BUFSIZ; +#ifdef _FSEEK_OPTIMIZATION /* do not try to optimise fseek() */ fp->_flags |= __SNPT; +#endif } else { @@ -76,6 +78,7 @@ _DEFUN(__smakebuf_r, (ptr, fp), #else size = BUFSIZ; #endif +#ifdef _FSEEK_OPTIMIZATION /* * Optimize fseek() only if it is a regular file. * (The test for __sseek is mainly paranoia.) @@ -91,6 +94,7 @@ _DEFUN(__smakebuf_r, (ptr, fp), } else fp->_flags |= __SNPT; +#endif } if ((p = _malloc_r (ptr, size)) == NULL) { |