diff options
Diffstat (limited to 'newlib/libc/stdio/makebuf.c')
-rw-r--r-- | newlib/libc/stdio/makebuf.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/newlib/libc/stdio/makebuf.c b/newlib/libc/stdio/makebuf.c index c4d03ecb6..4a09c4d50 100644 --- a/newlib/libc/stdio/makebuf.c +++ b/newlib/libc/stdio/makebuf.c @@ -1,3 +1,5 @@ +/* No user fns here. Pesch 15apr92. */ + /* * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -14,14 +16,13 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -/* No user fns here. Pesch 15apr92. */ -#include <_ansi.h> #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/unistd.h> + #include "local.h" /* @@ -32,9 +33,9 @@ * optimization) right after the _fstat() that finds the buffer size. */ -_VOID -_DEFUN(__smakebuf, (fp), - register FILE *fp) +void +__smakebuf (fp) + register FILE *fp; { register size_t size, couldbetty; register _PTR p; @@ -46,11 +47,7 @@ _DEFUN(__smakebuf, (fp), fp->_bf._size = 1; return; } -#ifdef __USE_INTERNAL_STAT64 - if (fp->_file < 0 || _fstat64_r (_REENT, fp->_file, &st) < 0) -#else - if (fp->_file < 0 || _fstat_r (_REENT, fp->_file, &st) < 0) -#endif + if (fp->_file < 0 || _fstat_r (fp->_data, fp->_file, &st) < 0) { couldbetty = 0; size = BUFSIZ; @@ -81,7 +78,7 @@ _DEFUN(__smakebuf, (fp), else fp->_flags |= __SNPT; } - if ((p = _malloc_r (_REENT, size)) == NULL) + if ((p = _malloc_r (fp->_data, size)) == NULL) { fp->_flags |= __SNBF; fp->_bf._base = fp->_p = fp->_nbuf; @@ -89,7 +86,7 @@ _DEFUN(__smakebuf, (fp), } else { - _REENT->__cleanup = _cleanup_r; + fp->_data->__cleanup = _cleanup_r; fp->_flags |= __SMBF; fp->_bf._base = fp->_p = (unsigned char *) p; fp->_bf._size = size; |