Subject: Re: sendfile()
To: None <netbsd-users@netbsd.org>
From: Christian Biere <christianbiere@gmx.de>
List: netbsd-users
Date: 07/08/2003 00:08:25
--=.?_vE9lYRxA5gS=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Manuel Bouyer <bouyer@antioche.eu.org> wrote:

> On Mon, Jul 07, 2003 at 03:55:55PM -0500, Douglas G. Phillips wrote:
> > Is there an equivalent to the linux sendfile() in NetBSD?
> 
> There isn't. However, -current has a zero-copy TCP path for write(),
> so mmap()ing the file and write()ing it in large chunks would probably
> to the same.

mmap() can cause SIGSEGV or SIGBUS for various reasons. IIRC, sendfile()
won't cause a crash but return an error code instead. Recovering from
a SIGSEGV/SIGBUS is somewhat ugly. I think you can prevent this by
using mlock/munlock() but these need root privileges on some operating
systems and I don't know what's their effect on performance.

-- 
Christian

--=.?_vE9lYRxA5gS=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (NetBSD)

iD8DBQE/Ce9j0KQix3oyIMcRArmpAKCD/rqJl2N/FQ2du+JtfH3NW3jYHgCfVn0J
tWquIBQe2QEXDg4o9FJQ4Tg=
=oW+8
-----END PGP SIGNATURE-----

--=.?_vE9lYRxA5gS=--