1 #include <../../nrnconf.h>
7 #if defined(HAVE_SETITIMER) && defined(HAVE_SIGACTION)
15 static struct itimerval
value;
16 static struct sigaction act, oact;
18 #define NRNTIMEOUT_DEBUG 0
24 static void timed_out(
int sig) {
27 printf(
"timed_out(%d) wall_elapse=%g told=%g t=%g\n",
41 void nrn_timeout(
int seconds) {
51 act.sa_handler = timed_out;
52 act.sa_flags = SA_RESTART;
53 if (sigaction(SIGALRM, &act, &oact)) {
54 printf(
"sigaction failed\n");
58 sigaction(SIGALRM, &oact, (
struct sigaction*) 0);
60 value.it_interval.tv_sec = seconds;
61 value.it_interval.tv_usec = 0;
62 value.it_value.tv_sec = seconds;
63 value.it_value.tv_usec = 0;
64 if (setitimer(ITIMER_REAL, &
value, (
struct itimerval*) 0)) {
65 printf(
"setitimer failed\n");
72 void nrn_timeout(
int seconds) {}
void nrnmpi_abort(int errcode)