The problem was in using an int for the return value of a 64-bit
function. All other references to this function in this source file
use a proper 64-bit value. This function returns the offset within
the file, and this int wraps to <0 at 2GB, causing an EOS to be
returned for any offset at any further point in a larger file.