With the parameter which I get in ".open/.close" unable to distinguish from which file descriptor the method is being called, can you please let me know the procedure to retrieve the the info so that It can be uniquely identified.
Is there any other alternatives to character device, so that I can establish the connection between user-space and kernel space
typedef int (dev_t, int, int, struct proc *) open_close_fcn_t;
struct cdevsw {
open_close_fcn_t *d_open;
open_close_fcn_t *d_close;
read_write_fcn_t *d_read;
read_write_fcn_t *d_write;
....
}
I have tried to fetch the filedesc structure from "struct proc / proc_self()" so that I can get the info of all open file descriptors corresponding to process
struct filedesc *fdp = p->p_fd;
but able to see "*fpd" as NULL
Thanks
Venkat