In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writ
es:
>Hi,
>
>I'm writing a character device driver in which each minor device can be
>opened more than once.  When a device is opened is there a way to associate
>some private data for each opened instance ?

As other people have noted, not in the general case.

The solution I've used is to split the device minor number into a physical
unit and open instance part.  You keep the existing per-unit structure, and
add per-instance data including a busy flag which causes opens to return
EBUSY.  In your user land application, you iterate over the devices in 
round-robin fashion as long as you get back EBUSY as you would for pty 
masters.

-- 
<a href="http://www.poohsticks.org/drew/">Home Page</a>
For those who do, no explanation is necessary.  
For those who don't, no explanation is possible.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to