MAJOR: polling: add event ports support (Solaris)
Event ports are kqueue/epoll polling class for Solaris. Code is based
on https://github.com/joyent/haproxy-1.8/tree/joyent/dev-v1.8.8.
Event ports are available only on SunOS systems derived from
Solaris 10 and later (including illumos systems).
diff --git a/Makefile b/Makefile
index fcd1581..8fde90b 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@
# explicitly specified :
# USE_EPOLL : enable epoll() on Linux 2.6. Automatic.
# USE_KQUEUE : enable kqueue() on BSD. Automatic.
+# USE_EVPORTS : enable event ports on SunOS systems. Automatic.
# USE_MY_EPOLL : redefine epoll_* syscalls. Automatic.
# USE_MY_SPLICE : redefine the splice syscall if build fails without.
# USE_NETFILTER : enable netfilter on Linux. Automatic.
@@ -285,7 +286,7 @@
USE_GETADDRINFO USE_OPENSSL USE_LUA USE_FUTEX USE_ACCEPT4 \
USE_MY_ACCEPT4 USE_ZLIB USE_SLZ USE_CPU_AFFINITY USE_TFO USE_NS \
USE_DL USE_RT USE_DEVICEATLAS USE_51DEGREES USE_WURFL USE_SYSTEMD \
- USE_OBSOLETE_LINKER USE_PRCTL USE_THREAD_DUMP
+ USE_OBSOLETE_LINKER USE_PRCTL USE_THREAD_DUMP USE_EVPORTS
#### Target system options
# Depending on the target platform, some options are set, as well as some
@@ -352,7 +353,7 @@
# We also enable getaddrinfo() which works since solaris 8.
set_target_defaults = $(call default_opts, \
USE_POLL USE_TPROXY USE_LIBCRYPT USE_CRYPT_H USE_GETADDRINFO USE_THREAD \
- USE_OBSOLETE_LINKER)
+ USE_OBSOLETE_LINKER USE_EVPORTS)
TARGET_CFLAGS = -DFD_SETSIZE=65536 -D_REENTRANT -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
TARGET_LDFLAGS = -lnsl -lsocket
endif
@@ -515,6 +516,11 @@
OPTIONS_OBJS += src/ev_kqueue.o
endif
+ifneq ($(USE_EVPORTS),)
+OPTIONS_CFLAGS += -DENABLE_EVPORTS
+OPTIONS_OBJS += src/ev_evports.o
+endif
+
ifneq ($(USE_VSYSCALL),)
OPTIONS_OBJS += src/i386-linux-vsys.o
OPTIONS_CFLAGS += -DCONFIG_HAP_LINUX_VSYSCALL