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] View of /trunk/gadget/interrupthandler.cc
[mareframe] / trunk / gadget / interrupthandler.cc Repository:
ViewVC logotype

View of /trunk/gadget/interrupthandler.cc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (download) (annotate)
Mon Feb 10 17:09:07 2014 UTC (10 years, 4 months ago) by agomez
File size: 507 byte(s)
Initial version based on Gadget 2.2.00
#ifdef INTERRUPT_HANDLER

#include "interrupthandler.h"
#include "gadget.h"

volatile int* irhInterrupted;

void registerInterrupts(volatile int* interrupted) {
  irhInterrupted = interrupted;
  struct sigaction act;
  sigemptyset(&act.sa_mask);
  sigaddset(&act.sa_mask, SIGINT);
  sigaddset(&act.sa_mask, SIGTSTP);
  act.sa_handler = interruptHandler;
  act.sa_flags = 0;
  sigaction(SIGINT, &act, 0);
  sigaction(SIGTSTP, &act, 0);
}

void interruptHandler(int signal) {
  *irhInterrupted = 1;
}

#endif

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

Powered By FusionForge