![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|