* Copyright (c) 1982 Regents of the University of California
static char sccsid
[] = "@(#)asio.c 4.4 %G%";
* Block I/O routines for logical I/O concurrently in
* more than one place in the same file.
int biofd
; /* file descriptor for block I/O file */
off_t boffset
; /* physical position in logical file */
BFILE
*biobufs
; /* the block I/O buffers */
#define error(severity, message) \
{yyerror(message); if (severity) delexit();}
bp
->b_nleft
= BUFSIZ
- off
% BUFSIZ
;
register struct biobuf
*bp
;
asm("movc3 r8,(r11),(r7)");
if (bp
->b_ptr
!= bp
->b_buf
)
put
= cnt
- cnt
% BUFSIZ
;
if (boffset
!= bp
->b_off
)
(void)lseek(biofd
, (long)bp
->b_off
, 0);
if (write(biofd
, p
, put
) != put
) {
error(1, "Output write error");
register struct biobuf
*bp
;
for (bp
= biobufs
; bp
; bp
= bp
->b_link
)
register struct biobuf
*bp
;
register int cnt
= bp
->b_ptr
- bp
->b_buf
;
if (boffset
!= bp
->b_off
)
(void)lseek(biofd
, (long)bp
->b_off
, 0);
if (write(biofd
, bp
->b_buf
, cnt
) != cnt
) {
error(1, "Output write error");
register struct biobuf
*bp
;