From: Jamie Lokier <lk@tantalophile.demon.co.uk>
To: Dan Maas <dmaas@maasdigital.com>
Cc: davem@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: sendfile(2) behaviour has changed?
Date: Thu, 24 Oct 2002 23:37:49 +0100 [thread overview]
Message-ID: <20021024223749.GA852@bjl1.asuk.net> (raw)
In-Reply-To: <20021020055020.A3289@morpheus>
Dan Maas wrote:
> >> It really needs a new interface for recvfile/copyfile/whatever
> >> anyway, as you can only specify an off_t for the from fd at
> >> present.
> >
> > Ummm, you can use lseek() on the 'to' fd perhaps?
>
> Wouldn't that be non-atomic and therefore likely to cause problems
> with concurrent writes?
sendfile() from a mapped tmpfs file is a nice way to get zero-copy
writes of program-generated data, for example HTTP headers.
If it were possible to recvfile() _to_ a tmpfs file, you could use
this to implement zero-copy forwarding between sockets, in userspace,
while still having a program inspect part of the data and possibly
change it. There are lots of proxy services that could potentially
use this.
This is an example of when you'd want many concurrent writes to the
same file. (Naturally, for performance, you'd want to use one large
tmpfs file and allocate portions of it on the fly, rather then
multiple opens or lots of small files).
enjoy,
-- Jamie
next prev parent reply other threads:[~2002-10-24 22:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-20 9:50 sendfile(2) behaviour has changed? Dan Maas
2002-10-24 22:37 ` Jamie Lokier [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-10-16 8:49 sendfile(2) behaviour has changed ? Zilvinas Valinskas
2002-10-16 9:10 ` Matti Aarnio
2002-10-16 9:59 ` David S. Miller
2002-10-16 10:25 ` bert hubert
2002-10-17 20:51 ` James Antill
2002-10-17 22:41 ` David S. Miller
2002-10-17 23:23 ` James Antill
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=20021024223749.GA852@bjl1.asuk.net \
--to=lk@tantalophile.demon.co.uk \
--cc=davem@redhat.com \
--cc=dmaas@maasdigital.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox