#define rsts 1 #include #include fflush(fp) FILE *fp; { register int flags; flags = fp->io_flag; fp->io_flag &= ~(IO_ERR | IO_EOF); if (flags & IO_MOD && flags & IO_BZY) { clrxrb(); xrb.xrlen = fp->io_bsiz; /* Buffer length */ if (flags & IO_REC) { xrb.xrbc = fp->io_bcnt; } else { zero(fp->io_bptr, fp->io_bsiz - fp->io_bcnt); xrb.xrbc = fp->io_bsiz; } xrb.xrloc = fp->io_bbuf; /* Buffer start */ xrb.xrci = fp->io_lun * 2; /* Channel number */ if (flags & IO_FIL) { xrb.xrblk = fp->io_bnbr++; } rstsys(_WRITE); fp->io_flag &= ~IO_BZY; fp->io_bptr = fp->io_bbuf; fp->io_bcnt = 0; } }