Re: character device driver

2001-02-27 Thread Brian Somers
[.] > In my mind, it is important that (in the general case) we provide a struct > file state hook rather than having per-process state, to allow things like > threads, process teams, aio, file descriptor passing, etc, to work > properly. One advantage to tying VFS statefulness to device stat

Re: character device driver

2001-02-18 Thread Robert Watson
On Sun, 18 Feb 2001, Drew Eckhardt wrote: > 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 e

Re: character device driver

2001-02-18 Thread Drew Eckhardt
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

Re: character device driver

2001-02-13 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, Warner Losh writes: >In message <[EMAIL PROTECTED]> Luigi Rizzo writes: >: > In message <[EMAIL PROTECTED]> David Rufino writes: >: > : I'm writing a character device driver in which each minor device can be >: > : opened more than once. When a device is opened is

Re: character device driver

2001-02-13 Thread Luigi Rizzo
> In message <[EMAIL PROTECTED]> David Rufino writes: > : 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 ? Thanks. > > No. You only get one clos

Re: character device driver

2001-02-13 Thread Warner Losh
In message <[EMAIL PROTECTED]> David Rufino writes: : 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 ? Thanks. No. You only get one close call and i

Re: character device driver

2001-02-13 Thread Warner Losh
In message <[EMAIL PROTECTED]> Luigi Rizzo writes: : > In message <[EMAIL PROTECTED]> David Rufino writes: : > : 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 eac

Re: character device driver

2001-02-13 Thread Warner Losh
In message <[EMAIL PROTECTED]> Luigi Rizzo writes: : (you still get to know the pid of the process issuing the close() but : this is not always enough). Yes, but if I open it twice in the same process, call dup2, fork, etc, etc, etc. With the cooperation of the userland process more things are

Re: character device driver

2001-02-13 Thread Luigi Rizzo
> : > No. You only get one close call and in the kernel all instances of a > : > minor device are treated identically. > : > : this is not true anymore, there is some special flag you can > : specify in cdevsw or so which passes all close calls to the driver. > > It is only half untrue. There'

Re: character device driver

2001-02-13 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, David Rufino writes: >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 ? Thanks. It is not possible to do this. T

Re: character device driver

2001-02-13 Thread Luigi Rizzo
> 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 ? Thanks. allocation is easy -- what is complex is looking up the private data on each syst