LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Why does Ctrl+C causes module release ? (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/why-does-ctrl-c-causes-module-release-863390/)

zvivered 02-17-2011 03:42 PM

Why does Ctrl+C causes module release ?
 
Hello,

I'm using vanilla 2.6.27.35 on a Core2Duo CPU.

The CPU access customized hardware via PCI using a very simple device driver and a user level driver I wrote.

The application waits for a PCI interrupt received in the device driver and then writes data to the hardware. This process goes forever.

When I press Ctrl+C I see that the release part of the device driver is called.

What is the reason for this ? I expect only the application to stop.

Thanks.

David1357 02-18-2011 03:54 PM

Quote:

Originally Posted by zvivered (Post 4262012)
When I press Ctrl+C I see that the release part of the device driver is called.
What is the reason for this ? I expect only the application to stop.

It could be that the operating system is cleaning up after you and closing the file handle to the device driver:
Quote:

Originally Posted by "Essential Linux Device Drivers", Sreekrishnan Venkateswaran, p. 127
The kernel calls the release() method when an application closes an open device.



All times are GMT -5. The time now is 10:12 AM.