LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-28-2005, 07:05 AM   #1
rajsun
Member
 
Registered: Mar 2005
Posts: 61

Rep: Reputation: 15
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.
 
Old 06-28-2005, 07:22 AM   #2
sind
Member
 
Registered: Jun 2005
Posts: 75

Rep: Reputation: 15
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

Last edited by sind; 06-28-2005 at 07:23 AM.
 
Old 06-28-2005, 08:10 AM   #3
rajsun
Member
 
Registered: Mar 2005
Posts: 61

Original Poster
Rep: Reputation: 15
Thank u sind. Thank u very much. Actully this concept didnt strick to my mind.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Threads in signal handling shilpig Programming 3 08-20-2009 03:14 AM
Signal handling from bash shy Programming 2 11-20-2004 08:41 AM
how to detect that I'm handling signal igor.kopriva Programming 2 10-01-2004 05:46 AM
Signal Handling with LinuxThrreads TedMaul Programming 1 05-01-2004 01:56 PM
Signal handling Mohsen Programming 2 07-30-2003 06:55 AM


All times are GMT -5. The time now is 06:12 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration