1
0
mirror of https://github.com/simh/simh.git synced 2026-02-16 12:44:09 +00:00

H316, NOVA, PDP11, PDP8, PDP18B, KX10: Record Sequential updates consistently

Devices that do single character I/O could be attached to non seekable
host OS devices (tty, pipes, etc.) and thus shouldn't count on fseek()
and ftell().  These DEVICEs on these simulators do single character I/O
and easily can update their POS REGisters to reflect how much data has
been emitted.  Changing such a REGister will have no  useful effect
when attached to a non seekable file.
This commit is contained in:
Mark Pizzolato
2021-06-08 14:25:23 -07:00
parent 3597772a08
commit e519c93ebf
6 changed files with 9 additions and 9 deletions

View File

@@ -181,12 +181,12 @@ t_stat ptp_svc (UNIT *uptr)
return SCPE_OK;
}
fputc (uptr->CHR, uptr->fileref); /* print char */
uptr->pos = ftell (uptr->fileref);
if (ferror (uptr->fileref)) { /* error? */
perror ("PTP I/O error");
clearerr (uptr->fileref);
return SCPE_IOERR;
}
uptr->pos = uptr->pos + 1;
return SCPE_OK;
}