xref: /csrg-svn/lib/libc/stdio/rewind.c (revision 22144)
1 #ifndef lint
2 static char sccsid[] = "@(#)rewind.c	5.1 (Berkeley) 06/05/85";
3 #endif not lint
4 
5 #include	<stdio.h>
6 
7 rewind(iop)
8 register FILE *iop;
9 {
10 	fflush(iop);
11 	lseek(fileno(iop), 0L, 0);
12 	iop->_cnt = 0;
13 	iop->_ptr = iop->_base;
14 	iop->_flag &= ~(_IOERR|_IOEOF);
15 	if (iop->_flag & _IORW)
16 		iop->_flag &= ~(_IOREAD|_IOWRT);
17 }
18