ZEROCOPY between kernel and userland

thefly thefly at acaro.org
Tue Jul 6 06:33:03 PDT 2004


could you point me pls to some code of that? To me read-only access is
ok, userspace doesn't need to write anything on it, kernelspace does.
But what about locking issues between userspace read access and
kernelspace write access?



On Tue, Jul 06, 2004 at 09:22:39AM -0400, Don Bowman wrote:
> From: thefly [mailto:thefly at acaro.org]
> > 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?
> 
> We did a device, and 'mmap' some shared memory between the two.
> The user space has read-only access.
> 
> 
> 

-- 
    Claudio "thefly" Martella
    thefly at acaro.org
    GNU/PG keyid: 0x8EA95625
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20040706/921cc691/attachment.bin


More information about the freebsd-hackers mailing list