[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torsocks/master] Fix: support kfreebsd for mmap()



commit 144827af33b7ae731eb0e8ef7fff249f1e34cbae
Author: Jérémy Bobbio <lunar@xxxxxxxxxx>
Date:   Tue Mar 18 21:48:41 2014 -0400

    Fix: support kfreebsd for mmap()
    
    Signed-off-by: David Goulet <dgoulet@xxxxxxxxx>
---
 configure.ac      |    2 +-
 src/lib/syscall.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 88b5338..1444cc7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,7 +118,7 @@ dnl location on Unixish system.
 AC_MSG_CHECKING(file name of the C library)
 AS_CASE([$host_os],
 	[darwin*], [libc_name="libSystem.dylib"],
-	[linux*],
+	[linux*|kfreebsd*-gnu],
 	[
 		libc_name=`ldd /usr/bin/yes | grep 'libc\.' | cut -d ' ' -f 1 | tr -d '\t'`
 		if test "${libc_name}" == ""; then
diff --git a/src/lib/syscall.c b/src/lib/syscall.c
index 2539855..36d28ad 100644
--- a/src/lib/syscall.c
+++ b/src/lib/syscall.c
@@ -122,7 +122,7 @@ LIBC_SYSCALL_RET_TYPE tsocks_syscall(long int number, va_list args)
 		ret = handle_close(args);
 		break;
 	case TSOCKS_NR_MMAP:
-#if (defined(__NetBSD__) || defined(__FreeBSD__)) && defined(__x86_64)
+#if (defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(__x86_64)
 		/*
 		 * On an 64 bit *BSD system, __syscall(2) should be used for mmap().
 		 * This is NOT suppose to happen but for protection we deny that call.
@@ -151,7 +151,7 @@ LIBC_SYSCALL_RET_TYPE tsocks_syscall(long int number, va_list args)
 		 * own memory using mmap() called by syscall(). Same for munmap().
 		 */
 		ret = handle_mmap(args);
-#endif /* __NetBSD__, __FreeBSD__, __x86_64 */
+#endif /* __NetBSD__, __FreeBSD__, __FreeBSD_kernel__, __x86_64 */
 		break;
 	case TSOCKS_NR_MUNMAP:
 		ret = handle_munmap(args);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits