void rewind(FILE *fp) { int serrno = errno; /* make sure stdio is set up */ if (!__sdidinit) __sinit(); FLOCKFILE(fp); if (_fseeko(fp, (off_t)0, SEEK_SET, 1) == 0) errno = serrno; clearerr_unlocked(fp); /* POSIX: clear stdio error regardless */ FUNLOCKFILE(fp); }
int fseeko(FILE *fp, off_t offset, int whence) { int ret; int serrno = errno; /* make sure stdio is set up */ if (!__sdidinit) __sinit(); FLOCKFILE(fp); ret = _fseeko(fp, offset, whence, 0); FUNLOCKFILE(fp); if (ret == 0) errno = serrno; return (ret); }
void rewind(FILE *fp) { int serrno = errno; /* make sure stdio is set up */ if (!__sdidinit) __sinit(); FLOCKFILE(fp); if (_fseeko(fp, (off_t)0, SEEK_SET, 1) == 0) { clearerr_unlocked(fp); errno = serrno; } FUNLOCKFILE(fp); }
int fseek(FILE *fp, long offset, int whence) { int ret; int serrno = errno; /* make sure stdio is set up */ if (!__sdidinit) __sinit(); FLOCKFILE_CANCELSAFE(fp); ret = _fseeko(fp, (off_t)offset, whence, 1); FUNLOCKFILE_CANCELSAFE(); if (ret == 0) errno = serrno; return (ret); }
EXPORT_C void rewind(FILE *fp) { int serrno = errno; /* make sure stdio is set up */ if (!__sdidinit) __sinit(); FLOCKFILE(fp); if (_fseeko(fp, (off_t)0, SEEK_SET, 1) == 0) { #ifndef __SYMBIAN32__ clearerr_unlocked(fp); errno = serrno; #endif } #ifdef __SYMBIAN32__ clearerr_unlocked(fp); errno = serrno; #endif FUNLOCKFILE(fp); }