From: Jens Axboe <axboe@suse.de>
To: Michael Kerrisk <mtk-manpages@gmx.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: splice() and file offsets
Date: Mon, 10 Jul 2006 18:51:20 +0200 [thread overview]
Message-ID: <20060710165120.GI5210@suse.de> (raw)
In-Reply-To: <20060710154854.26270@gmx.net>
On Mon, Jul 10 2006, Michael Kerrisk wrote:
> Jens,
>
> > > 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...
No worries, glad we got it sorted out :-)
--
Jens Axboe
prev parent reply other threads:[~2006-07-10 16:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-10 12:11 splice() and file offsets Michael Kerrisk
2006-07-10 12:51 ` Jens Axboe
2006-07-10 13:07 ` Michael Kerrisk
2006-07-10 13:25 ` Jens Axboe
2006-07-10 13:54 ` Michael Kerrisk
2006-07-10 14:22 ` Jens Axboe
2006-07-10 15:48 ` Michael Kerrisk
2006-07-10 16:51 ` Jens Axboe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060710165120.GI5210@suse.de \
--to=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mtk-manpages@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.