|
|
Log in / Subscribe / Register

splice

splice

Posted Dec 22, 2005 8:12 UTC (Thu) by Ross (guest, #4065)
In reply to: splice by thedevil
Parent article: Some new system calls

Using sendfile() is just a shortcut for read() followed by write() with the same buffer and length; it avoids copying into and out of userspace. The difference with splice() is that the reading and writing will happen automatically as data becomes available, not requiring userspace to perform additional system calls, need to determine optimal buffer sizes, etc.

I do wonder how error handling would work...


to post comments

splice

Posted Dec 22, 2005 12:04 UTC (Thu) by nix (subscriber, #2304) [Link] (1 responses)

Plus, Linus has been heard to say that he now believes sendfile() to have been a mistake. This doesn't mean it will go away of course (it's a syscall, it's immortal) but if sendfile() can be implemented in terms of splice(), so much the better!

splice

Posted Dec 23, 2005 7:17 UTC (Fri) by thedevil (guest, #32913) [Link]

Ah, now I looked at the Linux manpage of sendfile and I understand a bit
better. BSD sendfile is _much_ more convenient; it is zero copy, the
special case of count = 0 means "all the data there is", and it has
additional argument that makes it possible to string multiple buffers
a la sendmsg. I have assumed the Linux one was a clone, while in fact
the splice proposal looks more like BSD sendfile.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds