long do_sigreturn(CPUX86State *env)

{

    struct sigframe *frame;

    abi_ulong frame_addr = env->regs[R_ESP] - 8;

    target_sigset_t target_set;

    sigset_t set;

    int eax, i;



#if defined(DEBUG_SIGNAL)

    fprintf(stderr, "do_sigreturn\n");

#endif

    if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1))

        goto badframe;

    /* set blocked signals */

    if (__get_user(target_set.sig[0], &frame->sc.oldmask))

        goto badframe;

    for(i = 1; i < TARGET_NSIG_WORDS; i++) {

        if (__get_user(target_set.sig[i], &frame->extramask[i - 1]))

            goto badframe;

    }



    target_to_host_sigset_internal(&set, &target_set);

    do_sigprocmask(SIG_SETMASK, &set, NULL);



    /* restore registers */

    if (restore_sigcontext(env, &frame->sc, &eax))

        goto badframe;

    unlock_user_struct(frame, frame_addr, 0);

    return eax;



badframe:

    unlock_user_struct(frame, frame_addr, 0);

    force_sig(TARGET_SIGSEGV);

    return 0;

}

long do_sigreturn(CPUX86State *env)

{

    struct sigframe *frame;

    abi_ulong frame_addr = env->regs[R_ESP] - 8;

    target_sigset_t target_set;

    sigset_t set;

    int eax, i;



#if defined(DEBUG_SIGNAL)

    fprintf(stderr, "do_sigreturn\n");

#endif

    if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1))

        goto badframe;

    

    if (__get_user(target_set.sig[0], &frame->sc.oldmask))

        goto badframe;

    for(i = 1; i < TARGET_NSIG_WORDS; i++) {

        if (__get_user(target_set.sig[i], &frame->extramask[i - 1]))

            goto badframe;

    }



    target_to_host_sigset_internal(&set, &target_set);

    do_sigprocmask(SIG_SETMASK, &set, NULL);



    

    if (restore_sigcontext(env, &frame->sc, &eax))

        goto badframe;

    unlock_user_struct(frame, frame_addr, 0);

    return eax;



badframe:

    unlock_user_struct(frame, frame_addr, 0);

    force_sig(TARGET_SIGSEGV);

    return 0;

}

    if (__get_user(target_set.sig[0], &frame->sc.oldmask))         goto badframe;         if (__get_user(target_set.sig[i], &frame->extramask[i - 1]))             goto badframe;             goto badframe;         goto badframe;         if (__get_user(target_set.sig[i], &frame->extramask[i - 1]))             goto badframe;     unlock_user_struct(frame, frame_addr, 0);         goto badframe;     unlock_user_struct(frame, frame_addr, 0);         goto badframe;         if (__get_user(target_set.sig[i], &frame->extramask[i - 1]))             goto badframe;     unlock_user_struct(frame, frame_addr, 0);         goto badframe;
long FUNC_0(CPUX86State *VAR_0)

{

    struct sigframe *VAR_1;

    abi_ulong frame_addr = VAR_0->regs[R_ESP] - 8;

    target_sigset_t target_set;

    sigset_t set;

    int VAR_2, VAR_3;



#if defined(DEBUG_SIGNAL)

    fprintf(stderr, "FUNC_0\n");

#endif

    if (!lock_user_struct(VERIFY_READ, VAR_1, frame_addr, 1))

        goto badframe;

    

    if (__get_user(target_set.sig[0], &VAR_1->sc.oldmask))

        goto badframe;

    for(VAR_3 = 1; VAR_3 < TARGET_NSIG_WORDS; VAR_3++) {

        if (__get_user(target_set.sig[VAR_3], &VAR_1->extramask[VAR_3 - 1]))

            goto badframe;

    }



    target_to_host_sigset_internal(&set, &target_set);

    do_sigprocmask(SIG_SETMASK, &set, NULL);



    

    if (restore_sigcontext(VAR_0, &VAR_1->sc, &VAR_2))

        goto badframe;

    unlock_user_struct(VAR_1, frame_addr, 0);

    return VAR_2;



badframe:

    unlock_user_struct(VAR_1, frame_addr, 0);

    force_sig(TARGET_SIGSEGV);

    return 0;

}

long FUNC_0(CPUX86State *VAR_0)
{ struct sigframe *VAR_1; abi_ulong frame_addr = VAR_0->regs[R_ESP] - 8; target_sigset_t target_set; sigset_t set; int VAR_2, VAR_3; #if defined(DEBUG_SIGNAL)
fprintf(stderr, "FUNC_0\n"); #endif
if (!lock_user_struct(VERIFY_READ, VAR_1, frame_addr, 1))
goto badframe; if (__get_user(target_set.sig[0], &VAR_1->sc.oldmask))
goto badframe; for(VAR_3 = 1; VAR_3 < TARGET_NSIG_WORDS; VAR_3++) { if (__get_user(target_set.sig[VAR_3], &VAR_1->extramask[VAR_3 - 1]))
goto badframe; } target_to_host_sigset_internal(&set, &target_set); do_sigprocmask(SIG_SETMASK, &set, NULL); if (restore_sigcontext(VAR_0, &VAR_1->sc, &VAR_2))
goto badframe; unlock_user_struct(VAR_1, frame_addr, 0); return VAR_2; badframe:
unlock_user_struct(VAR_1, frame_addr, 0); force_sig(TARGET_SIGSEGV); return 0; }