int do_sigprocmask(int how, const sigset_t *set, sigset_t *oldset)

{

    int ret;

    sigset_t val;

    sigset_t *temp = NULL;

    CPUState *cpu = thread_cpu;

    TaskState *ts = (TaskState *)cpu->opaque;

    bool segv_was_blocked = ts->sigsegv_blocked;



    if (set) {

        bool has_sigsegv = sigismember(set, SIGSEGV);

        val = *set;

        temp = &val;



        sigdelset(temp, SIGSEGV);



        switch (how) {

        case SIG_BLOCK:

            if (has_sigsegv) {

                ts->sigsegv_blocked = true;

            }

            break;

        case SIG_UNBLOCK:

            if (has_sigsegv) {

                ts->sigsegv_blocked = false;

            }

            break;

        case SIG_SETMASK:

            ts->sigsegv_blocked = has_sigsegv;

            break;

        default:

            g_assert_not_reached();

        }

    }



    ret = sigprocmask(how, temp, oldset);



    if (oldset && segv_was_blocked) {

        sigaddset(oldset, SIGSEGV);

    }



    return ret;

}

int do_sigprocmask(int how, const sigset_t *set, sigset_t *oldset)

{

    int ret;

    sigset_t val;

    sigset_t *temp = NULL;

    CPUState *cpu = thread_cpu;

    TaskState *ts = (TaskState *)cpu->opaque;

    bool segv_was_blocked = ts->sigsegv_blocked;



    if (set) {

        bool has_sigsegv = sigismember(set, SIGSEGV);

        val = *set;

        temp = &val;



        sigdelset(temp, SIGSEGV);



        switch (how) {

        case SIG_BLOCK:

            if (has_sigsegv) {

                ts->sigsegv_blocked = true;

            }

            break;

        case SIG_UNBLOCK:

            if (has_sigsegv) {

                ts->sigsegv_blocked = false;

            }

            break;

        case SIG_SETMASK:

            ts->sigsegv_blocked = has_sigsegv;

            break;

        default:

            g_assert_not_reached();

        }

    }



    ret = sigprocmask(how, temp, oldset);



    if (oldset && segv_was_blocked) {

        sigaddset(oldset, SIGSEGV);

    }



    return ret;

}

    int ret;     sigset_t val;     sigset_t *temp = NULL;     CPUState *cpu = thread_cpu;     TaskState *ts = (TaskState *)cpu->opaque;     bool segv_was_blocked = ts->sigsegv_blocked;         bool has_sigsegv = sigismember(set, SIGSEGV);         val = *set;         temp = &val;         sigdelset(temp, SIGSEGV);             if (has_sigsegv) {                 ts->sigsegv_blocked = true;             if (has_sigsegv) {                 ts->sigsegv_blocked = false;             ts->sigsegv_blocked = has_sigsegv;     ret = sigprocmask(how, temp, oldset);     if (oldset && segv_was_blocked) {         sigaddset(oldset, SIGSEGV);     return ret;
int FUNC_0(int VAR_0, const sigset_t *VAR_1, sigset_t *VAR_2)

{

    int VAR_3;

    sigset_t val;

    sigset_t *temp = NULL;

    CPUState *cpu = thread_cpu;

    TaskState *ts = (TaskState *)cpu->opaque;

    bool segv_was_blocked = ts->sigsegv_blocked;



    if (VAR_1) {

        bool has_sigsegv = sigismember(VAR_1, SIGSEGV);

        val = *VAR_1;

        temp = &val;



        sigdelset(temp, SIGSEGV);



        switch (VAR_0) {

        case SIG_BLOCK:

            if (has_sigsegv) {

                ts->sigsegv_blocked = true;

            }

            break;

        case SIG_UNBLOCK:

            if (has_sigsegv) {

                ts->sigsegv_blocked = false;

            }

            break;

        case SIG_SETMASK:

            ts->sigsegv_blocked = has_sigsegv;

            break;

        default:

            g_assert_not_reached();

        }

    }



    VAR_3 = sigprocmask(VAR_0, temp, VAR_2);



    if (VAR_2 && segv_was_blocked) {

        sigaddset(VAR_2, SIGSEGV);

    }



    return VAR_3;

}

int FUNC_0(int VAR_0, const sigset_t *VAR_1, sigset_t *VAR_2)
{ int VAR_3; sigset_t val; sigset_t *temp = NULL; CPUState *cpu = thread_cpu; TaskState *ts = (TaskState *)cpu->opaque; bool segv_was_blocked = ts->sigsegv_blocked; if (VAR_1) { bool has_sigsegv = sigismember(VAR_1, SIGSEGV); val = *VAR_1; temp = &val; sigdelset(temp, SIGSEGV); switch (VAR_0) { case SIG_BLOCK:
if (has_sigsegv) { ts->sigsegv_blocked = true; } break; case SIG_UNBLOCK:
if (has_sigsegv) { ts->sigsegv_blocked = false; } break; case SIG_SETMASK:
ts->sigsegv_blocked = has_sigsegv; break; default:
g_assert_not_reached(); } } VAR_3 = sigprocmask(VAR_0, temp, VAR_2); if (VAR_2 && segv_was_blocked) { sigaddset(VAR_2, SIGSEGV); } return VAR_3; }