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 > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Gnuplot wxt terminal vs x11 terminal cosmologist UNIX for Dummies Questions & Answers 0 06-27-2009 07:39 AM
New to Mac OS X Terminal xsemperidem5 OS X (Apple) 2 12-10-2008 07:43 AM
Pseudo-terminal will not be allocated because stdin is not a terminal. Shivdatta UNIX for Advanced & Expert Users 1 08-04-2008 10:29 AM
Terminal Jono_H UNIX for Dummies Questions & Answers 10 06-23-2007 10:59 AM
connecting to unix through hyper terminal - as a dumb terminal michelle UNIX for Advanced & Expert Users 2 11-05-2001 03:32 PM

Reply
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
  #1 (permalink)  
Old 3 Weeks Ago
ronycsdu ronycsdu is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 1
I need help with SIGIO and the terminal..

I want write a program where I call the pause() function to wait for any signal. Now I have registered the SIGIO signal with the following lines of code:

const int on = 1;

fcntl(STDIN_FILENO,F_SETOWN,getpid());

ioctl(STDIN_FILENO, FIOASYNC, &on);
ioctl(STDIN_FILENO, FIONBIO, &on);

signal(SIGIO,catchSIGIO);

then I called the pause() function. The body of the catchSIGIO() is given below:

void catchSIGIO(int num){
printf("INSIDE SIGIO\n");
}

The program compiles alright. When I run the program, it halts/pauses at the pause() function call. Then when I type something in the keyboard, the SIGIO signal is NOT generated (I guess) because nothing happens. The program remains stuck at the pause() function. I can ONLY get out by pressing ctrl+C.

But I want to detect ANY KEY PRESS by SIGIO signal or any other signal (if there is any).

Can anyone help me on this issue? Thanks in advance.
Reply

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 05:24 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