The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Cannot catch SIGINT while serial break condition occurs gzz High Level Programming 13 11-23-2007 08:06 AM
file handling problem in perl...... vivekshankar UNIX for Dummies Questions & Answers 2 06-02-2005 09:23 PM
Inter Process File Handling Problem saurabhjain HP-UX 4 05-12-2005 12:49 PM
exception handling RichardS UNIX for Advanced & Expert Users 1 06-16-2004 06:29 PM
Parameter handling AkumaTay UNIX for Dummies Questions & Answers 1 05-18-2002 03:09 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-24-2008
JamesGoh JamesGoh is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 89
Problem with handling SIGINT

For a program I am designing, which involves handling the keyboard input Ctrl^c (SIGINT), it is taking ages for the program to actually recognise and perform the corresponding action whenever I run it and hit Ctrl^C at the CL. I have to do at least 3 Ctrl^Cs before the program will actually register and handle SIGINT appropriately.

Currently Im using signal() to map the various types of unix signals (i.e SIGINT, SIGSTSP) to handler functions I have defined in my program. What the handler functions do is call exit(0) (which quits the program) whenever the corresponding signal has been received by the program. As I mentioned before, it is taking several Ctrl^Cs to get the handler functions to be invoked, when it should just be 1 Ctrl^C.

Im unsure what could be causing my problem. Please feel free to make any suggestions.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0