Example #1
0
int WRAP(pthread_kill)(pthread_t thread, int portable_signum)
{
    char *portable_signame = map_portable_signum_to_name(portable_signum);
    int mips_signum;
    int portable_ret, ret;

    ALOGV("%s(thread:%lx, portable_signum:%d)", __func__, thread, portable_signum);

    mips_signum = signum_pton(portable_signum);

    if ((portable_signum != 0) && (mips_signum == 0)) {
        /* A signal MIPS doesn't support; all we can do is ignore it. */
        ret = 0;
    } else {
        ALOGV("%s: calling pthread_kill(thread:%lx, mips_signum:%d);", __func__,
                                        thread,     mips_signum);
        ret = REAL(pthread_kill)(thread, mips_signum);
    }
    portable_ret = errno_ntop(ret);

    ALOGV("%s: return portable_ret:%d; ret:%d;", __func__,
                      portable_ret,    ret);

    return portable_ret;
}
Example #2
0
int timer_create_portable(clockid_t clockid, struct sigevent *portable_evp,
                          timer_t *timerid)
{
    struct sigevent native_sigevent, *evp = portable_evp;

    if (!invalid_pointer(portable_evp) &&
        (evp->sigev_notify == SIGEV_SIGNAL ||
         evp->sigev_notify == SIGEV_THREAD_ID)) {

        native_sigevent = *portable_evp;
        evp = &native_sigevent;
        evp->sigev_signo = signum_pton(evp->sigev_signo);
    }
    return timer_create(clockid, evp, timerid);
}