aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorMatt Traudt <sirmatt@ksu.edu>2017-09-13 14:32:27 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-09-15 11:40:59 -0400
commit4bc97c6431a7609cd7e2f5b27238338bc9d2c7cd (patch)
treea1453f0847c292a64a2dfaeed4e9ecc381968ff0 /src/or
parent8ccb2c106afa29f5c44101574775f01cd435adbf (diff)
downloadtor-4bc97c6431a7609cd7e2f5b27238338bc9d2c7cd.tar.gz
tor-4bc97c6431a7609cd7e2f5b27238338bc9d2c7cd.zip
sched: revisist compatibility on non-linux systems
Wrap things in HAVE_KIST_SUPPORT until Tor compiles and tests cleanly on my OS X machine.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/scheduler_kist.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/scheduler_kist.c b/src/or/scheduler_kist.c
index 3c3d26ad5a..0cedecd8fe 100644
--- a/src/or/scheduler_kist.c
+++ b/src/or/scheduler_kist.c
@@ -17,8 +17,10 @@
#define TLS_PER_CELL_OVERHEAD 29
+#ifdef HAVE_KIST_SUPPORT
/* Kernel interface needed for KIST. */
#include <linux/sockios.h>
+#endif /* HAVE_KIST_SUPPORT */
/*****************************************************************************
* Data structures and supporting functions
@@ -27,7 +29,9 @@
/* Indicate if we don't have the kernel support. This can happen if the kernel
* changed and it doesn't recognized the values passed to the syscalls needed
* by KIST. In that case, fallback to the naive approach. */
+#ifdef HAVE_KIST_SUPPORT
static unsigned int kist_no_kernel_support = 0;
+#endif /* HAVE_KIST_SUPPORT */
/* Socket_table hash table stuff. The socket_table keeps track of per-socket
* limit information imposed by kist and used by kist. */
@@ -182,6 +186,7 @@ free_socket_info_by_chan(socket_table_t *table, const channel_t *chan)
MOCK_IMPL(void,
update_socket_info_impl, (socket_table_ent_t *ent))
{
+#ifdef HAVE_KIST_SUPPORT
int64_t tcp_space, extra_space;
const tor_socket_t sock =
TO_CONN(BASE_CHAN_TO_TLS((channel_t *) ent->chan)->conn)->s;
@@ -244,6 +249,10 @@ update_socket_info_impl, (socket_table_ent_t *ent))
ent->limit = tcp_space + extra_space;
return;
+#else /* HAVE_KIST_SUPPORT */
+ goto fallback;
+#endif /* HAVE_KIST_SUPPORT */
+
fallback:
/* If all of a sudden we don't have kist support, we just zero out all the
* variables for this socket since we don't know what they should be.