104 #define _COMPILING_NEWLIB 117 #include <sys/stat.h> 120 #define POS_ERR (-(_fpos_t) 1) 127 typedef _fpos_t _EXFUN((*seek_fnptr), (
struct _reent *, _PTR, _fpos_t,
int) );
129 int _fseek_r(
struct _reent *ptr,
register FILE *fp,
long offset,
int whence)
131 _fpos_t _EXFUN((*seekfn), (
struct _reent *, _PTR, _fpos_t,
int) );
135 #ifdef __USE_INTERNAL_STAT64 151 if (fp->_flags & __SAPP && fp->_flags & __SWR)
159 if ((seekfn = (seek_fnptr) fp->_seek) == NULL)
161 ptr->_errno = ESPIPE;
166 if (_fflush_r(ptr, fp) ||
167 seekfn(ptr, fp->_cookie, offset, whence) == POS_ERR)
175 fp->_p = fp->_bf._base;
178 fp->_flags &= ~__SEOF;
185 fp->_flags &= ~__SNPT;
193 int fseek(
register FILE *fp,
long offset,
int whence)
195 return _fseek_r(_REENT, fp, offset, whence);