Revision d25f89c9

b/compatfd.c
115 115

  
116 116
    return qemu_signalfd_compat(mask);
117 117
}
118

  
119
bool qemu_signalfd_available(void)
120
{
121
#ifdef CONFIG_SIGNALFD
122
    errno = 0;
123
    syscall(SYS_signalfd, -1, NULL, _NSIG / 8);
124
    return errno != ENOSYS;
125
#else
126
    return false;
127
#endif
128
}
b/compatfd.h
39 39
};
40 40

  
41 41
int qemu_signalfd(const sigset_t *mask);
42
bool qemu_signalfd_available(void);
42 43

  
43 44
#endif
b/qemu-timer.c
831 831

  
832 832
#if defined(__linux__)
833 833

  
834
#include "compatfd.h"
835

  
834 836
static int dynticks_start_timer(struct qemu_alarm_timer *t)
835 837
{
836 838
    struct sigevent ev;
......
850 852
    memset(&ev, 0, sizeof(ev));
851 853
    ev.sigev_value.sival_int = 0;
852 854
    ev.sigev_notify = SIGEV_SIGNAL;
855
#ifdef SIGEV_THREAD_ID
856
    if (qemu_signalfd_available()) {
857
        ev.sigev_notify = SIGEV_THREAD_ID;
858
        ev._sigev_un._tid = qemu_get_thread_id();
859
    }
860
#endif /* SIGEV_THREAD_ID */
853 861
    ev.sigev_signo = SIGALRM;
854 862

  
855 863
    if (timer_create(CLOCK_REALTIME, &ev, &host_timer)) {

Also available in: Unified diff