[lkml]   [2006]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: splice() and file offsets

> > Yes, I understand what the code is doing, but *why* do
> > things this way? (To put things another way: why not *always
> > have splice() update the file offset?) I realise there may be
> > some good reason for this, and if there is, it will go into the
> > man page!
> The good reason is why update the current position? I just told the
> kernel to ignore the current position and use the given offset, why
> would I bother updating the current position? The whole point of
> providing an offset is to ignore the current position.
> I must say I cannot understand why you are confused or find this
> illogical, it makes perfect sense to me.

Yes, now it's clear to me too.


> > No! It does not! See the sendfile.2 man page: "sendfile()
> > does not modify the current file offset of in_fd."
> I didn't read the man page, I read the source. And it clearly updates
> the file offset, in fact the actual sendfile portion is just a supplied
> actor to the generic page cache read functions.

Doh! I took what I "knew", re-read the sendfile.2 manual page to
check, misread the source, and then wrote an inadequate
test program :-{. (The sendfile manual page is now fixed.)

> If you don't believe me, read the source and do another test app.
> splice() behaves identically, as previously stated.

Now I believe you; sorry to have wasted your time...


Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7

Want to help with man page maintenance?
Grab the latest tarball at,
read the HOWTOHELP file and grep the source
files for 'FIXME'.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-07-10 17:51    [W:0.058 / U:1.848 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site