On Fri, May 25, 2018 at 01:19:58PM +0900, Kyotaro HORIGUCHI wrote:
> The case is not of an empty file. read() reads 0 bytes without
> error while lseek have told that the file has *more* data. I
> don't think that can happen. How about just commenting with
> something like the following?
Actually it can be useful to report that no data has been read and that
more data was expected, like that:
+ else if (nread == 0)
+ ereport(ERROR,
+ (errmsg("no data read from file \"%s\": expected %zu more bytes",
+ path, bytesleft)));
--
Michael