﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
197	tape_mult_ does not return error_table_$short_record when fewer chars remain than caller requested	Gary Dixon	Eric Swenson	"The iox_$get_chars subroutine document (MPM Subroutines, AG93) specifies:

The desired number of bytes, N, is specified in the call.  Some I/O modules may actually read fewer than N bytes into the buffer, even though N bytes are available from the file or device. In this case the code error table_$short_record is returned.  When this code is returned, the caller may again call the iox_$get_chars entry point to get more bytes. The contents of the buffer beyond the last byte read are undefined.

The meaning of this specification is unclear.  If taken literally, it says that error_table_$short_record should be used only if n_read (the number of bytes returned) is less than n (the number of bytes the caller asked to be read) AND there are more bytes to be read in subsequent calls.  However, some people have interpreted this to mean error_table_$short_record should be returned whenever 0 < n_read < n, even when no more bytes remain to be read.

It is unclear which of these ambiguous interpretations of the iox_$get_chars specification is correct.

This ticket records the fact that the tape_mult_ I/O module does not return error_table_$short_record when\\
 0 < n_read < n for the last set of data read from the tape.  

Instead, it returns error_table_$end_of_info with 0 < n_read < n.

If tape_mult_'s implementation is deemed to be defective, it would have to be changed to return error_table_$short_record when last set of characters read was less than n (number of characters expected by the caller) when reading at end-of-tape.  

NOTES:
It may be difficult to find all programs using tape_mult_ and evaluate whether they would work correctly if such change was made.  Not all tape_mult_ programs are installed in the Multics Libraries.  Some may be owned by users.  

Furthermore, peruse_crossreference is of little help when searching for programs using I/O modules, since the I/O module name is generally a character string in an attach description; not a direct declaration and use of a particular subroutine entrypoint.  print -match tape_mult_ might have to be used to search the Multics Library source directories for such programs.

Given the ambiguity of the iox_$get_chars specification, I am marking this ticket as a ""task"" type.  It is not yet considered either a defect or an enhancement request.

See the description of iox_$get_chars and the tape_mult_ I/O module in the MPM Subroutines manual, AG93 for more details.  See ticket #195 and MCR10071 (https://s3.amazonaws.com/eswenson-multics/public/mcrs/MCR10071.pdf) for more details about how this issue was discovered."	task	new	minor		General				
