예제 #1
0
파일: ptrace.c 프로젝트: Kelimion/wine
/* send a signal to a specific thread */
static inline int tkill( int tgid, int pid, int sig )
{
#ifdef __linux__
    int ret = syscall( __NR_tgkill, tgid, pid, sig );
    if (ret < 0 && errno == ENOSYS) ret = syscall( __NR_tkill, pid, sig );
    return ret;
#elif (defined(__FreeBSD__) || defined (__FreeBSD_kernel__)) && defined(HAVE_THR_KILL2)
    return thr_kill2( tgid, pid, sig );
#else
    errno = ENOSYS;
    return -1;
#endif
}
예제 #2
0
파일: ptrace.c 프로젝트: r6144/wine
/* send a signal to a specific thread */
static inline int tkill( int tgid, int pid, int sig )
{
#ifdef __linux__
# ifdef __i386__
    int ret = syscall(270 /*SYS_tgkill*/, tgid, pid, sig);
    if (ret < 0 && errno == -ENOSYS)
        ret = syscall(238 /*SYS_tkill*/, pid, sig);
    return ret;
# elif defined(__x86_64__)
    return syscall(234 /*SYS_tgkill*/, tgid, pid, sig);
# else
    errno = ENOSYS;
    return -1;
# endif
#elif defined(__FreeBSD__) && defined(HAVE_THR_KILL2)
    return thr_kill2( tgid, pid, sig );
#else
    errno = ENOSYS;
    return -1;
#endif
}