+#include <sys/mman.h>
+#include <stdarg.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <signal.h>
+
+#include "marker.h"
+#include "usterr.h"
+#include "tracer.h"
+#include "marker-control.h"
+#include "relay.h"
+#include "tp.h"
+
+
+void inthandler(int sig)
+{
+ printf("in handler\n");
+ exit(0);
+}
+
+int init_int_handler(void)
+{
+ int result;
+ struct sigaction act;
+
+ result = sigemptyset(&act.sa_mask);
+ if(result == -1) {
+ PERROR("sigemptyset");
+ return -1;
+ }
+
+ act.sa_handler = inthandler;
+ act.sa_flags = SA_RESTART;
+
+ /* Only defer ourselves. Also, try to restart interrupted
+ * syscalls to disturb the traced program as little as possible.
+ */
+ result = sigaction(SIGINT, &act, NULL);
+ if(result == -1) {
+ PERROR("sigaction");
+ return -1;
+ }
+
+ return 0;
+}