Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Annotation of /trunk/gadget/interrupthandler.cc
[mareframe] / trunk / gadget / interrupthandler.cc Repository:
ViewVC logotype

Annotation of /trunk/gadget/interrupthandler.cc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifdef INTERRUPT_HANDLER
2 :    
3 :     #include "interrupthandler.h"
4 :     #include "gadget.h"
5 :    
6 :     volatile int* irhInterrupted;
7 :    
8 :     void registerInterrupts(volatile int* interrupted) {
9 :     irhInterrupted = interrupted;
10 :     struct sigaction act;
11 :     sigemptyset(&act.sa_mask);
12 :     sigaddset(&act.sa_mask, SIGINT);
13 :     sigaddset(&act.sa_mask, SIGTSTP);
14 :     act.sa_handler = interruptHandler;
15 :     act.sa_flags = 0;
16 :     sigaction(SIGINT, &act, 0);
17 :     sigaction(SIGTSTP, &act, 0);
18 :     }
19 :    
20 :     void interruptHandler(int signal) {
21 :     *irhInterrupted = 1;
22 :     }
23 :    
24 :     #endif

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge