Subject: Re: mmap() from kernel to user
To: Kamal R. Prasad <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 11/21/2004 15:52:45
> I have a device driver in the works for a usb device.  I want to
> mmap(ANON_MAP) and pass the fd to userspace

...what fd?  mmap doesn't create fds.

> and have it read the fd for the bulk data obtained by the kernel.

Sounds as though you want the kernel to create a file descriptor for
userland to read.  How you get it to userland is a minor detail.

If I wanted to do this, I'd create a socketpair - in modern NetBSD you
could also use a pipe, maybe - and hand one end to userland, keeping
the other end for the driver's use.

I don't know enough about USB to speak to the other questions.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B