I'm writing a linux kernel driver, which creates a char device file "/dev/my_file".
Multiple userspace applications do open()
of this file and use the ioctl
cmd provided to register app specific data. IOCTL also provides for deregister cmd, which apps can use and deregister themselves(kernel drv removes app data, delete any memory allocation etc) when doing clean exit.
However, if an application gets killed after doing open()
and ioctl
register cmd. How the driver can detect which app got killed and then carry out cleanup task for removing app specific data.
I know the .release
func ptr from struct file_operations
is called and driver is notified, but not sure on how the drv can find the specific app that got killed.
Thanks Sheetal