date and time created 83/11/10 16:04:16 by ralph
[unix-history] / usr / src / lib / libc / stdio / rewind.c
CommitLineData
d8af6b8b 1/* @(#)rewind.c 4.2 (Berkeley) %G% */
8c222d3d
BJ
2#include <stdio.h>
3
4rewind(iop)
5register struct _iobuf *iop;
6{
7 fflush(iop);
8 lseek(fileno(iop), 0L, 0);
9 iop->_cnt = 0;
10 iop->_ptr = iop->_base;
11 iop->_flag &= ~(_IOERR|_IOEOF);
d8af6b8b
MT
12 if (iop->_flag & _IORW)
13 iop->_flag &= ~(_IOREAD|_IOWRT);
8c222d3d 14}