LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 11-14-2004, 12:20 AM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
ncurses-dev


Hi... I need some help with my ncurses program.. Do u know if it is possbile to catch all the signals such as kill or term?

Also do u know any ncurses relating mailing-list or forum?
Thx
 
Old 11-14-2004, 04:13 AM   #2
Nerox
Member
 
Registered: Jul 2004
Location: Spain
Posts: 111

Rep: Reputation: 20
You can catch the term signal, but you cannot handle the kill signal.
 
Old 11-14-2004, 12:57 PM   #3
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
and how i can catch the term signal?
 
Old 11-14-2004, 06:13 PM   #4
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
Code:
#include <signal.h>

sigset(SIGTERM, sigterm_handler); /* put this in main() */


void sigterm_handler(int signo){
/* the code u want to execute every time u catch a SIGTERM */
}
man 7 signal
 
Old 11-14-2004, 06:28 PM   #5
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
u may also use signal function. I don't think it has any difference with sigset in Linux. In unix after catching a signal it restores the handler to its default function. In any case if are not planning to exit after catching the signal u may use something like that:

[CODE]
Code:
#include <signal.h>

signal(SIGTERM, sigterm_handler); /* put this in main() */


void sigterm_handler(int signo){
signal(SIGTERM, sigterm_handler);
/* the code u want to execute every time u catch a SIGTERM */
}
also Ctrl+C = SIGINT and not SIGTERM
 
  


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
I cannot access EITHER CD drive! And there's no /dev/hdc or /dev/hdd or /dev/cdrom! Dmalic Linux - Hardware 13 11-18-2005 07:11 PM
ln: creating symbolic link `/dev/dvd' to `/dev/hdc': Permission denied qazwsx27 Fedora 3 06-14-2005 02:09 PM
ncurses and ncursed-dev are present but the App install throws errors? ServerStorm Linux - Software 16 01-05-2005 04:11 PM
Sandisk USB card Reader not linking /dev/sg0 to /dev/sda acidraven Linux - Hardware 1 06-19-2004 03:56 PM
ncurses-5.2-28 conflicts with file from package ncurses-5.2-12 tubby Linux - Software 4 06-16-2002 12:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:34 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration