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
So can we conclude that, there is no way to distinguish the uniqueness of the file descripter in driver …
Yes. I thought my initial response was pretty clear on that subject:
The file descriptor table is not part of the macOS KPI … so your current approach is definitely a dead end.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"