bsd versus linux device drivers

Kostik Belousov kostikbel at gmail.com
Mon Sep 8 10:04:22 UTC 2008


On Mon, Sep 08, 2008 at 02:02:00AM -0700, vehemens wrote:
> In linux drivers, there is a one to one relationship to an open and a calling 
> argument structure called struct file.  It provides a private data pointer 
> that allows the driver to preserve unique state information across other 
> calls such as read/write/ioctl/mmap/close etc.
> 
> For bsd drivers, my understanding there is not an equivalent.  As a result it 
> is not possible to preserve different state information for multiple opens by 
> the same thread of the same device major/minor #'s.
> 
> Is this correct, or did i miss something?

There is devfs_{get,set}_cdevpriv() KPI. Still no manpage, I shall fix
this ASAP.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20080908/82670bd7/attachment.pgp


More information about the freebsd-current mailing list