[issue29269] test_socket failing in solaris

Brian Vandenberg report at bugs.python.org
Tue Aug 4 00:04:56 EDT 2020


Brian Vandenberg <phantall at gmail.com> added the comment:

I accidentally hit submit too early.

I tried changing the code in posixmodule.c to use lseek(), something like the following:

offset = lseek( in, 0, SEEK_CUR );

do {
  ret = sendfile(...);
} while( ... );
lseek( in, offset, SEEK_SET );

... however, in addition to readfile not advancing the file pointer it also doesn't seem to cause an EOF condition.  In my first attempt at the above I was doing this after the loop:

lseek( in, offset, SEEK_CUR );

... and it just kept advancing the file pointer well beyond the end of the file and sendfile() had absolutely no qualms about reading beyond the end of the file.

I even tried adding a read() after the 2nd lseek to see if I could force an EOF condition but that didn't do it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29269>
_______________________________________


More information about the Python-bugs-list mailing list