From 3c432b5a1965cab38e4988a8f4484bf182cd8811 Mon Sep 17 00:00:00 2001 From: Scott Mitchell Date: Tue, 2 Jun 2015 12:17:32 -0700 Subject: [PATCH] TCP_NOTSENT_LOWAT older kernel compatibility Motiviation: TCP_NOTSENT_LOWAT is only supported in linux kernel 3.12 or newer. The addition of this socket option prevents older kernels from building. Modifications: - Conditionally define TCP_NOTSENT_LOWAT if it is not defined Result: Kernels older than 3.12 can still compile the EPOLL module. --- .../src/main/c/io_netty_channel_epoll_Native.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c b/transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c index 16f3c954cb..9ecdc95eae 100644 --- a/transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c +++ b/transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c @@ -35,6 +35,11 @@ #include "io_netty_channel_epoll_Native.h" #include "exception_helper.h" +// TCP_NOTSENT_LOWAT is defined in linux 3.12. We define this here so older kernels can compile. +#ifndef TCP_NOTSENT_LOWAT +#define TCP_NOTSENT_LOWAT 25 +#endif + /** * On older Linux kernels, epoll can't handle timeout * values bigger than (LONG_MAX - 999ULL)/HZ.