On Thu, 2011-01-27 at 11:00 -0700, Eric Blake wrote: > On 01/27/2011 02:20 AM, Alan Hourihane wrote: > > Hello, > > > > I'm wondering if gnulib is scheduled to provide sendfile compatibility > > using lseek/read/write ? > > Interesting. The compile-time ease-of-use aspect makes it seem like a > function worth porting into gnulib. For Linux, it opens up the door to > providing the read/write fallback in user space for the case where the > kernel lacks support (that is, the kernel requires mmap-like input and > socket output, but the gnulib version can support much more). > Obviously, the gnulib replacement wouldn't have the efficiency on > non-Linux platforms, but the mere usability aspect of the interface > makes it seem worthwhile to me (you can write more compact code if you > have this interface present, and don't have to worry about writing the > read/write fallback yourself). > > Would you like to take a shot at proposing an implementation for the > module? The gnulib "schedule" is basically that things are added when > someone who cares about using something takes the time to submit it; > while this interface sounds nice, it's not my current itch, so I > probably won't be adding it myself (but I don't mind reviewing if > someone else puts in the work).
O.k. sounds good. I'll take a stab and send out for review. > > I know sendfile is a kernel routine, and I'm unsure of whether the file > > pointer needs restoration after the operation or not in a user-space > > replacement. > > Hence, a good module proposal would include a testsuite that validates > such corner-case behavior on the kernel implementation, and documents > the fallback semantics as well (for example, be sure to test > regular->regular, regular->pipe, pipe->regular, pipe->pipe). Sure. I'll get a test suite for it too. Thanks Eric. Alan.
