|
|
1.1 root 1: /*
2: * flush( ioptr ) writes the characters in the buffer implied by ioptr.
3: */
4:
5: #include "spitblks.h"
6: #include "spitio.h"
7:
8: int
9: flush( ioptr )
10:
11: struct ioblk *ioptr;
12:
13: {
14: register struct bfblk *bfptr;
15: register int n, ioerrcnt = 0;
16:
17: bfptr = ioptr -> buf;
18: if ( bfptr ) {
19: n = bfptr -> off;
20: if ( n > 0 ) {
21: if ( write( ioptr -> fdn, bfptr -> buf, n ) != n )
22: ioerrcnt++;
23: }
24: bfptr -> off = 0;
25: bfptr -> rem = bfptr -> siz;
26: }
27: return ioerrcnt;
28: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.