int do_sigaction(int sig, const struct target_sigaction *act,

                 struct target_sigaction *oact)

{

    struct emulated_sigaction *k;



    if (sig < 1 || sig > TARGET_NSIG)

        return -EINVAL;

    k = &sigact_table[sig - 1];

#if defined(DEBUG_SIGNAL) && 0

    fprintf(stderr, "sigaction sig=%d act=0x%08x, oact=0x%08x\n", 

            sig, (int)act, (int)oact);

#endif

    if (oact) {

        oact->_sa_handler = tswapl(k->sa._sa_handler);

        oact->sa_flags = tswapl(k->sa.sa_flags);

        oact->sa_restorer = tswapl(k->sa.sa_restorer);

        oact->sa_mask = k->sa.sa_mask;

    }

    if (act) {

        k->sa._sa_handler = tswapl(act->_sa_handler);

        k->sa.sa_flags = tswapl(act->sa_flags);

        k->sa.sa_restorer = tswapl(act->sa_restorer);

        k->sa.sa_mask = act->sa_mask;

    }

    return 0;

}

int do_sigaction(int sig, const struct target_sigaction *act,

                 struct target_sigaction *oact)

{

    struct emulated_sigaction *k;



    if (sig < 1 || sig > TARGET_NSIG)

        return -EINVAL;

    k = &sigact_table[sig - 1];

#if defined(DEBUG_SIGNAL) && 0

    fprintf(stderr, "sigaction sig=%d act=0x%08x, oact=0x%08x\n", 

            sig, (int)act, (int)oact);

#endif

    if (oact) {

        oact->_sa_handler = tswapl(k->sa._sa_handler);

        oact->sa_flags = tswapl(k->sa.sa_flags);

        oact->sa_restorer = tswapl(k->sa.sa_restorer);

        oact->sa_mask = k->sa.sa_mask;

    }

    if (act) {

        k->sa._sa_handler = tswapl(act->_sa_handler);

        k->sa.sa_flags = tswapl(act->sa_flags);

        k->sa.sa_restorer = tswapl(act->sa_restorer);

        k->sa.sa_mask = act->sa_mask;

    }

    return 0;

}

#endif #endif #if defined(DEBUG_SIGNAL) && 0
int FUNC_0(int VAR_0, const struct target_sigaction *VAR_1,

                 struct target_sigaction *VAR_2)

{

    struct emulated_sigaction *VAR_3;



    if (VAR_0 < 1 || VAR_0 > TARGET_NSIG)

        return -EINVAL;

    VAR_3 = &sigact_table[VAR_0 - 1];

#if defined(DEBUG_SIGNAL) && 0

    fprintf(stderr, "sigaction VAR_0=%d VAR_1=0x%08x, VAR_2=0x%08x\n", 

            VAR_0, (int)VAR_1, (int)VAR_2);

#endif

    if (VAR_2) {

        VAR_2->_sa_handler = tswapl(VAR_3->sa._sa_handler);

        VAR_2->sa_flags = tswapl(VAR_3->sa.sa_flags);

        VAR_2->sa_restorer = tswapl(VAR_3->sa.sa_restorer);

        VAR_2->sa_mask = VAR_3->sa.sa_mask;

    }

    if (VAR_1) {

        VAR_3->sa._sa_handler = tswapl(VAR_1->_sa_handler);

        VAR_3->sa.sa_flags = tswapl(VAR_1->sa_flags);

        VAR_3->sa.sa_restorer = tswapl(VAR_1->sa_restorer);

        VAR_3->sa.sa_mask = VAR_1->sa_mask;

    }

    return 0;

}

int FUNC_0(int VAR_0, const struct target_sigaction *VAR_1,
struct target_sigaction *VAR_2)
{ struct emulated_sigaction *VAR_3; if (VAR_0 < 1 || VAR_0 > TARGET_NSIG)
return -EINVAL; VAR_3 = &sigact_table[VAR_0 - 1]; #if defined(DEBUG_SIGNAL) && 0
fprintf(stderr, "sigaction VAR_0=%d VAR_1=0x%08x, VAR_2=0x%08x\n",
VAR_0, (int)VAR_1, (int)VAR_2); #endif
if (VAR_2) { VAR_2->_sa_handler = tswapl(VAR_3->sa._sa_handler); VAR_2->sa_flags = tswapl(VAR_3->sa.sa_flags); VAR_2->sa_restorer = tswapl(VAR_3->sa.sa_restorer); VAR_2->sa_mask = VAR_3->sa.sa_mask; } if (VAR_1) { VAR_3->sa._sa_handler = tswapl(VAR_1->_sa_handler); VAR_3->sa.sa_flags = tswapl(VAR_1->sa_flags); VAR_3->sa.sa_restorer = tswapl(VAR_1->sa_restorer); VAR_3->sa.sa_mask = VAR_1->sa_mask; } return 0; }