Skip to contentSkip to conversation

Process Termination Indication in the Device Driver

DISCUSSION Srini 2 participants 3 messages Jun 27, 2003 – Jun 30, 2003

lore
Share & tools
lore

Srini

author
#0 lore raw

Hi,
I am new to Linux Kernel. I am experimenting with Device Driver in Kernel
version 2.4. Is there a method by which the device driver could be indicated by the
kernel of the termination of a "user process" asynchronously.

I know of the function find_task_by_pid that the driver could call to get the task
structure given the pid.

Thanks in Advance

Srini

#1 lore raw
Quoted 8 lines · Srini

I am new to Linux Kernel. I am experimenting with Device Driver in Kernel
version 2.4. Is there a method by which the device driver could be indicated by the
kernel of the termination of a "user process" asynchronously.

I know of the function find_task_by_pid that the driver could call to get the task
structure given the pid.

If the application has files open then your device will receive flush events (and/or release events if its the last open) for each file handle as it is closed. Linux drivers dont normally care about process exit information in the general case therefore since the OS will ensure drivers get told when handles are cleaned up

author
#2 lore raw

Hi Alan,
Thanks for the Reply. Using multiple instances of driver, which inturn
causes the kernel to closes the driver when the application dies is the approach we
have planned to go about.

Thanks Again
Srini

-----Original Message-----
From: Alan Cox [mailto:[email protected]]
Sent: Saturday, June 28, 2003 12:24 PM
To: Srini
Cc: Linux Kernel Mailing List
Subject: Re: Process Termination Indication in the Device Driver

Quoted 2 lines · Srini

I am new to Linux Kernel. I am experimenting with Device Driver in Kernel
version 2.4. Is there a method by which the device driver could be

indicated

Quoted 6 lines

by the
kernel of the termination of a "user process" asynchronously.

I know of the function find_task_by_pid that the driver could call to get the task
structure given the pid.

If the application has files open then your device will receive flush events (and/or release events if its the last open) for each file handle as it is closed. Linux drivers dont normally care about process exit information in the general case therefore since the OS will ensure drivers get told when handles are cleaned up