From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 6 00:11:34 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E77C016A4CE for ; Tue, 6 Jul 2004 00:11:34 +0000 (GMT) Received: from ms008msg.fastweb.it (ms008msg.fastweb.it [213.140.2.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D2A143D53 for ; Tue, 6 Jul 2004 00:11:34 +0000 (GMT) (envelope-from thefly@acaro.org) Received: from tyler (1.10.185.81) by ms008msg.fastweb.it (7.0.028) id 40D6E1B100180B93 for freebsd-hackers@freebsd.org; Tue, 6 Jul 2004 02:11:33 +0200 Received: by tyler (Postfix, from userid 1000) id BD65B1AB494; Tue, 6 Jul 2004 02:15:11 +0200 (CEST) Date: Tue, 6 Jul 2004 02:15:11 +0200 From: thefly To: freebsd-hackers@freebsd.org Message-ID: <20040706001511.GA11077@tyler> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Editor: VIM - Vi IMproved 6.2 (2003 Jun 1, compiled May 20 2004 09:35:32) X-OS: Debian GNU/Linux 2.6.6 i686 User-Agent: Mutt/1.5.6+20040523i X-Mailman-Approved-At: Tue, 06 Jul 2004 12:09:19 +0000 Subject: ZEROCOPY between kernel and userland X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2004 00:11:35 -0000 Hello everybody, i'm writing a netgraph module to get some stats about the network traffic. Actually i have to pass all the data gathered all in one piece, to the process which asks me for it. The client should work like this in userland: int * pointer; ioctl(dev, MY_COMMAND, pointer); after this pointer points to the right memory area. The array to pass is about 500Kb, so copying with copyout() would be too expensive, moving the array from kernel's addrespace to process's address space would be fast. The question is: what's the actual API to do that, if there's any, in freebsd 5? TIA -- Claudio "thefly" Martella thefly@acaro.org GNU/PG keyid: 0x8EA95625