timer_create can apparently return -1 and set errno to EAGAIN if the
kernel suffered a temporary failure when allocating a timer. This
happens from time to time, so we need to handle it.
sev.sigev_notify = SIGEV_SIGNAL;
sev.sigev_signo = signo;
sev.sigev_value.sival_ptr = NULL;
- if (timer_create(clockID, &sev, &timer) == -1)
- panic("timer_create");
+
+ while (timer_create(clockID, &sev, &timer) == -1) {
+ if (errno != EAGAIN)
+ panic("timer_create: %i", errno);
+ }
}
PosixKvmTimer::~PosixKvmTimer()