Brian Vandenberg <phant...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue29269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to