use connect on dg sockets to allow unreachable reporting;
[unix-history] / usr / src / lib / libc / stdio / rewind.c
CommitLineData
b8f253e8
KM
1#ifndef lint
2static char sccsid[] = "@(#)rewind.c 5.1 (Berkeley) %G%";
3#endif not lint
4
8c222d3d
BJ
5#include <stdio.h>
6
7rewind(iop)
41e01b3e 8register FILE *iop;
8c222d3d
BJ
9{
10 fflush(iop);
11 lseek(fileno(iop), 0L, 0);
12 iop->_cnt = 0;
13 iop->_ptr = iop->_base;
14 iop->_flag &= ~(_IOERR|_IOEOF);
d8af6b8b
MT
15 if (iop->_flag & _IORW)
16 iop->_flag &= ~(_IOREAD|_IOWRT);
8c222d3d 17}