OPT_END() \
};
-static void handle_sigalrm(int sig)
+static void handle_sigalrm(int sig, siginfo_t *si, void *uc)
{
+ struct kvm *kvm = si->si_value.sival_ptr;
+
kvm__arch_periodic_poll(kvm);
}
{
static char real_cmdline[2048], default_name[20];
unsigned int nr_online_cpus;
+ struct sigaction sa;
kvm = kvm__new();
if (IS_ERR(kvm))
return PTR_ERR(kvm);
- signal(SIGALRM, handle_sigalrm);
+ sa.sa_flags = SA_SIGINFO;
+ sa.sa_sigaction = handle_sigalrm;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGALRM, &sa, NULL);
nr_online_cpus = sysconf(_SC_NPROCESSORS_ONLN);
kvm->cfg.custom_rootfs_name = "default";
sev.sigev_value.sival_int = 0;
sev.sigev_notify = SIGEV_THREAD_ID;
sev.sigev_signo = SIGALRM;
+ sev.sigev_value.sival_ptr = kvm;
sev._sigev_un._tid = syscall(__NR_gettid);
r = timer_create(CLOCK_REALTIME, &sev, &kvm->timerid);