Commit | Line | Data |
---|---|---|
914b7558 BJ |
1 | #include "fio.h" |
2 | f_rew(a) alist *a; | |
3 | { | |
4 | unit *b; | |
5 | if(a->aunit>=MXUNIT || a->aunit<0) err(a->aerr,101,"rewind"); | |
6 | b = &units[a->aunit]; | |
7 | if(b->ufd == NULL) return(0); | |
8 | if(!b->useek) err(a->aerr,106,"rewind") | |
9 | if(b->uwrt) | |
10 | { nowreading(b); | |
11 | t_runc(b); | |
12 | } | |
13 | rewind(b->ufd); | |
14 | b->uend=0; | |
15 | return(0); | |
16 | } |