static int qemu_signal_init(void)

{

    int sigfd;

    sigset_t set;



#ifdef CONFIG_IOTHREAD

    /* SIGUSR2 used by posix-aio-compat.c */

    sigemptyset(&set);

    sigaddset(&set, SIGUSR2);

    pthread_sigmask(SIG_UNBLOCK, &set, NULL);



    /*

     * SIG_IPI must be blocked in the main thread and must not be caught

     * by sigwait() in the signal thread. Otherwise, the cpu thread will

     * not catch it reliably.

     */

    sigemptyset(&set);

    sigaddset(&set, SIG_IPI);

    pthread_sigmask(SIG_BLOCK, &set, NULL);



    sigemptyset(&set);

    sigaddset(&set, SIGIO);

    sigaddset(&set, SIGALRM);

    sigaddset(&set, SIGBUS);

#else

    sigemptyset(&set);

    sigaddset(&set, SIGBUS);

    if (kvm_enabled()) {

        /*

         * We need to process timer signals synchronously to avoid a race

         * between exit_request check and KVM vcpu entry.

         */

        sigaddset(&set, SIGIO);

        sigaddset(&set, SIGALRM);

    }

#endif

    pthread_sigmask(SIG_BLOCK, &set, NULL);



    sigfd = qemu_signalfd(&set);

    if (sigfd == -1) {

        fprintf(stderr, "failed to create signalfd\n");

        return -errno;

    }



    fcntl_setfl(sigfd, O_NONBLOCK);



    qemu_set_fd_handler2(sigfd, NULL, sigfd_handler, NULL,

                         (void *)(intptr_t)sigfd);



    return 0;

}

static int qemu_signal_init(void)

{

    int sigfd;

    sigset_t set;



#ifdef CONFIG_IOTHREAD

    

    sigemptyset(&set);

    sigaddset(&set, SIGUSR2);

    pthread_sigmask(SIG_UNBLOCK, &set, NULL);



    









    sigemptyset(&set);

    sigaddset(&set, SIG_IPI);

    pthread_sigmask(SIG_BLOCK, &set, NULL);



    sigemptyset(&set);

    sigaddset(&set, SIGIO);

    sigaddset(&set, SIGALRM);

    sigaddset(&set, SIGBUS);

#else

    sigemptyset(&set);

    sigaddset(&set, SIGBUS);

    if (kvm_enabled()) {

        







        sigaddset(&set, SIGIO);

        sigaddset(&set, SIGALRM);

    }

#endif

    pthread_sigmask(SIG_BLOCK, &set, NULL);



    sigfd = qemu_signalfd(&set);

    if (sigfd == -1) {

        fprintf(stderr, "failed to create signalfd\n");

        return -errno;

    }



    fcntl_setfl(sigfd, O_NONBLOCK);



    qemu_set_fd_handler2(sigfd, NULL, sigfd_handler, NULL,

                         (void *)(intptr_t)sigfd);



    return 0;

}

#ifdef CONFIG_IOTHREAD #endif #ifdef CONFIG_IOTHREAD #endif #endif #ifdef CONFIG_IOTHREAD #else     sigemptyset(&set);     sigaddset(&set, SIGBUS);     if (kvm_enabled()) {         sigaddset(&set, SIGIO);         sigaddset(&set, SIGALRM); #endif #ifdef CONFIG_IOTHREAD #else     sigemptyset(&set);     sigaddset(&set, SIG_IPI);     sigaddset(&set, SIGIO);     sigaddset(&set, SIGALRM);     pthread_sigmask(SIG_BLOCK, &set, NULL); #endif #ifdef CONFIG_IOTHREAD #endif     if (kvm_enabled()) { #else #endif #endif #endif #ifdef CONFIG_IOTHREAD #else #endif #endif #ifdef CONFIG_IOTHREAD #endif #endif #endif #ifdef CONFIG_IOTHREAD #else #endif
static int FUNC_0(void)

{

    int VAR_0;

    sigset_t set;



#ifdef CONFIG_IOTHREAD

    

    sigemptyset(&set);

    sigaddset(&set, SIGUSR2);

    pthread_sigmask(SIG_UNBLOCK, &set, NULL);



    









    sigemptyset(&set);

    sigaddset(&set, SIG_IPI);

    pthread_sigmask(SIG_BLOCK, &set, NULL);



    sigemptyset(&set);

    sigaddset(&set, SIGIO);

    sigaddset(&set, SIGALRM);

    sigaddset(&set, SIGBUS);

#else

    sigemptyset(&set);

    sigaddset(&set, SIGBUS);

    if (kvm_enabled()) {

        







        sigaddset(&set, SIGIO);

        sigaddset(&set, SIGALRM);

    }

#endif

    pthread_sigmask(SIG_BLOCK, &set, NULL);



    VAR_0 = qemu_signalfd(&set);

    if (VAR_0 == -1) {

        fprintf(stderr, "failed to create signalfd\n");

        return -errno;

    }



    fcntl_setfl(VAR_0, O_NONBLOCK);



    qemu_set_fd_handler2(VAR_0, NULL, sigfd_handler, NULL,

                         (void *)(intptr_t)VAR_0);



    return 0;

}

static int FUNC_0(void)
{ int VAR_0; sigset_t set; #ifdef CONFIG_IOTHREAD
sigemptyset(&set); sigaddset(&set, SIGUSR2); pthread_sigmask(SIG_UNBLOCK, &set, NULL); sigemptyset(&set); sigaddset(&set, SIG_IPI); pthread_sigmask(SIG_BLOCK, &set, NULL); sigemptyset(&set); sigaddset(&set, SIGIO); sigaddset(&set, SIGALRM); sigaddset(&set, SIGBUS); #else
sigemptyset(&set); sigaddset(&set, SIGBUS); if (kvm_enabled()) { sigaddset(&set, SIGIO); sigaddset(&set, SIGALRM); } #endif
pthread_sigmask(SIG_BLOCK, &set, NULL); VAR_0 = qemu_signalfd(&set); if (VAR_0 == -1) { fprintf(stderr, "failed to create signalfd\n"); return -errno; } fcntl_setfl(VAR_0, O_NONBLOCK); qemu_set_fd_handler2(VAR_0, NULL, sigfd_handler, NULL,
(void *)(intptr_t)VAR_0); return 0; }