static void *sigwait_compat(void *opaque)

{

    struct sigfd_compat_info *info = opaque;

    int err;

    sigset_t all;



    sigfillset(&all);

    sigprocmask(SIG_BLOCK, &all, NULL);



    do {

        siginfo_t siginfo;



        err = sigwaitinfo(&info->mask, &siginfo);

        if (err == -1 && errno == EINTR) {

            err = 0;

            continue;

        }



        if (err > 0) {

            char buffer[128];

            size_t offset = 0;



            memcpy(buffer, &err, sizeof(err));

            while (offset < sizeof(buffer)) {

                ssize_t len;



                len = write(info->fd, buffer + offset,

                            sizeof(buffer) - offset);

                if (len == -1 && errno == EINTR)

                    continue;



                if (len <= 0) {

                    err = -1;

                    break;

                }



                offset += len;

            }

        }

    } while (err >= 0);



    return NULL;

}

static void *sigwait_compat(void *opaque)

{

    struct sigfd_compat_info *info = opaque;

    int err;

    sigset_t all;



    sigfillset(&all);

    sigprocmask(SIG_BLOCK, &all, NULL);



    do {

        siginfo_t siginfo;



        err = sigwaitinfo(&info->mask, &siginfo);

        if (err == -1 && errno == EINTR) {

            err = 0;

            continue;

        }



        if (err > 0) {

            char buffer[128];

            size_t offset = 0;



            memcpy(buffer, &err, sizeof(err));

            while (offset < sizeof(buffer)) {

                ssize_t len;



                len = write(info->fd, buffer + offset,

                            sizeof(buffer) - offset);

                if (len == -1 && errno == EINTR)

                    continue;



                if (len <= 0) {

                    err = -1;

                    break;

                }



                offset += len;

            }

        }

    } while (err >= 0);



    return NULL;

}

static void *sigwait_compat(void *opaque)     struct sigfd_compat_info *info = opaque;     int err;     sigset_t all;     sigfillset(&all);     sigprocmask(SIG_BLOCK, &all, NULL);     do {         siginfo_t siginfo;         err = sigwaitinfo(&info->mask, &siginfo);         if (err == -1 && errno == EINTR) {             err = 0;             continue;         if (err > 0) {             char buffer[128];             size_t offset = 0;             memcpy(buffer, &err, sizeof(err));             while (offset < sizeof(buffer)) {                 ssize_t len;                 len = write(info->fd, buffer + offset,                             sizeof(buffer) - offset);                 if (len == -1 && errno == EINTR)                     continue;                 if (len <= 0) {                     err = -1;                     break;                 offset += len;     } while (err >= 0);     return NULL;
static void *FUNC_0(void *VAR_0)

{

    struct sigfd_compat_info *VAR_1 = VAR_0;

    int VAR_2;

    sigset_t all;



    sigfillset(&all);

    sigprocmask(SIG_BLOCK, &all, NULL);



    do {

        siginfo_t siginfo;



        VAR_2 = sigwaitinfo(&VAR_1->mask, &siginfo);

        if (VAR_2 == -1 && errno == EINTR) {

            VAR_2 = 0;

            continue;

        }



        if (VAR_2 > 0) {

            char VAR_3[128];

            size_t offset = 0;



            memcpy(VAR_3, &VAR_2, sizeof(VAR_2));

            while (offset < sizeof(VAR_3)) {

                ssize_t len;



                len = write(VAR_1->fd, VAR_3 + offset,

                            sizeof(VAR_3) - offset);

                if (len == -1 && errno == EINTR)

                    continue;



                if (len <= 0) {

                    VAR_2 = -1;

                    break;

                }



                offset += len;

            }

        }

    } while (VAR_2 >= 0);



    return NULL;

}

static void *FUNC_0(void *VAR_0)
{ struct sigfd_compat_info *VAR_1 = VAR_0; int VAR_2; sigset_t all; sigfillset(&all); sigprocmask(SIG_BLOCK, &all, NULL); do { siginfo_t siginfo; VAR_2 = sigwaitinfo(&VAR_1->mask, &siginfo); if (VAR_2 == -1 && errno == EINTR) { VAR_2 = 0; continue; } if (VAR_2 > 0) { char VAR_3[128]; size_t offset = 0; memcpy(VAR_3, &VAR_2, sizeof(VAR_2)); while (offset < sizeof(VAR_3)) { ssize_t len; len = write(VAR_1->fd, VAR_3 + offset,
sizeof(VAR_3) - offset); if (len == -1 && errno == EINTR)
continue; if (len <= 0) { VAR_2 = -1; break; } offset += len; } } } while (VAR_2 >= 0); return NULL; }