Research V6 development
[unix-history] / usr / source / iolib / cflush.c
CommitLineData
6215cbd0
DR
1# include "ciodec.c"
2cflush (fn)
3int fn;
4{
5struct fileps *fp;
6if (nargs() != 1)
7 IEHzap("cflush");
8if (fn < 0 || fn >15) return;
9fp = &IEH3fpts[fn];
10if (fp->nchars > 0 && fp->wrflag >= 2)
11 {
12 write (fn, fp->buff,fp->nchars);
13 fp->bptr = fp->buff;
14 fp -> nchars = fp->eoferr = 0;
15 }
16if (fp->wrflag == 1)
17 seek(fn, -(fp->nchars),1);
18return;
19}