distinguish good solaris from bad solaris

pull/434/head
Rick V 5 years ago
parent db44a1c106
commit 67845e342a
No known key found for this signature in database
GPG Key ID: C0EDC8723FDC3465

@ -31,6 +31,24 @@ if(CCACHE_PROGRAM)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
# check if we have the (saner) emulation of epoll here
# it's basically linux epoll but with a sane method of
# dealing with closed file handles that still exist in the
# epoll set
#
# Note that the zombie of Oracle Solaris 2.11.x will NOT have
# this, the header check is the only method we have to distinguish
# them. -rick the svr4 guy
INCLUDE(CheckIncludeFiles)
CHECK_INCLUDE_FILES(sys/epoll.h SOLARIS_HAVE_EPOLL)
if (SOLARIS_HAVE_EPOLL)
message("Using fast emulation of Linux epoll(5) on Solaris.")
else()
message("Falling back to poll(2) based event loop.")
endif()
endif()
if(WIN32)
set(CMAKE_CXX_STANDARD 17)
ENABLE_LANGUAGE(RC)

@ -6,7 +6,7 @@
#include <stddef.h>
// apparently current Solaris will emulate epoll.
#if __linux__ || __sun__
#if __linux__ || SOLARIS_HAVE_EPOLL
#include <ev/ev_epoll.hpp>
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \
|| (__APPLE__ && __MACH__)

@ -12,6 +12,9 @@
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* solaris port of libtuntap (c)2019 rick v
* all rights reserved, see LICENSE in top-level folder (../../LICENSE)
*/
#include <sys/types.h>

Loading…
Cancel
Save