[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [torsocks/master] syscall: OS X doesn't support sched_getaffinity()
commit 98a77168ab839733d069248524200f84d7b04671
Author: David Goulet <dgoulet@xxxxxxxxx>
Date: Sun Oct 16 11:42:31 2016 -0400
syscall: OS X doesn't support sched_getaffinity()
Thanks to jcalvert for reporting this failure through my Github page.
Signed-off-by: David Goulet <dgoulet@xxxxxxxxx>
---
src/common/compat.h | 2 ++
src/lib/syscall.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/src/common/compat.h b/src/common/compat.h
index 41ab8a8..d8949e7 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -192,7 +192,9 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine)(void));
#define TSOCKS_NR_GETPEERNAME SYS_getpeername
#define TSOCKS_NR_LISTEN SYS_listen
#define TSOCKS_NR_RECVMSG SYS_recvmsg
+#ifdef !defined(__darwin__)
#define TSOCKS_NR_SCHED_GETAFFINITY SYS_sched_getaffinity
+#endif /* ! __darwin__ */
#endif /* __FreeBSD__, __FreeBSD_kernel__, __darwin__, __NetBSD__ */
diff --git a/src/lib/syscall.c b/src/lib/syscall.c
index 9495a64..ff5a4da 100644
--- a/src/lib/syscall.c
+++ b/src/lib/syscall.c
@@ -164,6 +164,7 @@ static LIBC_RECVMSG_RET_TYPE handle_recvmsg(va_list args)
return tsocks_recvmsg(sockfd, msg, flags);
}
+#if !defined(__darwin__)
/*
* Handle sched_getaffinity(2) syscall.
* NOTE: ffmpeg is one of the application that needs this one on the
@@ -182,6 +183,7 @@ static LIBC_SYSCALL_RET_TYPE handle_sched_getaffinity(va_list args)
return tsocks_libc_syscall(TSOCKS_NR_SCHED_GETAFFINITY, pid, cpusetsize,
mask);
}
+#endif /* ! __darwin__ */
#if defined(__linux__)
/*
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits