LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Signal handling......... (https://www.linuxquestions.org/questions/programming-9/signal-handling-337968/)

rajsun 06-28-2005 07:05 AM

Signal handling.........
 
Hi all,
Generaly we use 'signal' or 'sigaction' for signal handler registration. But is there any way to unregister the signal handler. I mean to say taht suppose I have register my handler for SIGINI. Now I want to unregister the signal handler or disable my own signal handler.

How can I do this ? Do any body has any idea ? Please help me in this regard.

Thanking u all,

With Regard,
Rajesh.

sind 06-28-2005 07:22 AM

Hi rajsun,

With "signal" you can reset the handler for SIGINT to the system default with

signal(SIGINT, SIG_DFL);

With "sigaction" you can also use SIG_DFL, or you can supply the third argument to sigaction and save the previous handler and settings, to be restored later by another call to sigaction.

See

man 2 signal

and

man 2 sigaction

They should give you a lot of info on the subject.

~sind

rajsun 06-28-2005 08:10 AM

Thank u sind. Thank u very much. Actully this concept didnt strick to my mind.


All times are GMT -5. The time now is 09:51 AM.