/* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. * * %sccs.include.redist.c% */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)rewind.c 5.5 (Berkeley) 06/01/90"; #endif /* LIBC_SCCS and not lint */ #include #include #include rewind(iop) register FILE *iop; { off_t lseek(); (void)fflush(iop); (void)lseek(fileno(iop), 0L, L_SET); iop->_cnt = 0; iop->_ptr = iop->_base; iop->_flag &= ~(_IOERR|_IOEOF); if (iop->_flag & _IORW) iop->_flag &= ~(_IOREAD|_IOWRT); }