Re: sendfile(2) idea (was: Thread implementations)

Pavel Machek (pavel@Elf.ucw.cz)
Fri, 26 Jun 1998 00:40:21 +0200


Hi!

> so it would work more like a "read()+write()" combination rather than
> anything else.
>
> The way I'd implement it at least the first cut would have the rule that
> you can only send from a file that can be in the page cache - so you could
> have a source that is ext2 or NFS for example, but you couldn't have a
> socket as the source because the data for a socket isn't in the page
> cache. Thus "sendFILE()", not "copyfd()".

I think interface just _should_ be copyfd, and it should fallback to
read()+write() internaly. It is a little bit strange to describe
pagecache concept on manpage, you see?

Also, if you keep it copyfd(), we may sometime later find out, that
socket-to-socket case is easy and just add it. And - even now
unoptimized case at least saves syscalls.

Maybe we should try to get at least trivial copyfd() into 2.2, so apps
can learn to use it _now_. For other platforms, copyfd() can be safely
library function, so this is clean.

> The nice thing is that I suspect I can implement this (cleanly) in a
> weekend if I just were to have a free weekend somewhere ;)

Pavel

-- 
I'm really pavel@atrey.karlin.mff.cuni.cz. 	   Pavel
Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu