My application's main process will open the driver and fork()'s 10 child processes.If I press control+c ,child process is calling the release function inside the driver. I want parent process to call the release function. I have a resource which can be freed only if I get the process ID of parent. If I check for the parent Id of the child process inside the driver it is showing as 1.How to make parent to release the driver on control+c.And I don't want to use signal handler.
Asked
Active
Viewed 17 times
0
-
http://stackoverflow.com/questions/17766550/ctrl-c-interrupt-event-handling-in-linux – Mark Adelsberger Feb 08 '17 at 13:53
-
If you haven't done it yet, please take some time to [read about how to ask good questions](http://stackoverflow.com/help/how-to-ask) and learn how to create a [Minimal, Complete, and Verifiable Example](http://stackoverflow.com/help/mcve). – Some programmer dude Feb 08 '17 at 13:53
-
In Linux the `Ctrl-C` is sent to the top process as a `SIGINT` signal. Unless you reconfigure the terminal emulator to not handle special keys like that and instead send you the raw keyboard input, signals are the best way to handle `Ctrl-C`. It's definitely the easiest, and in a POSIX environment (like Linux) the most "natural". – Some programmer dude Feb 08 '17 at 14:15