bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sendfile compatibility


From: Eric Blake
Subject: Re: sendfile compatibility
Date: Thu, 27 Jan 2011 11:00:08 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

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).

> 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).

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]