diff --git a/CMakeLists.txt b/CMakeLists.txt index b78c9ac57..5d21bab48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -569,6 +569,7 @@ CHECK_INCLUDE_FILE(sys/capability.h LWS_HAVE_SYS_CAPABILITY_H) CHECK_INCLUDE_FILE(malloc.h LWS_HAVE_MALLOC_H) CHECK_INCLUDE_FILE(pthread.h LWS_HAVE_PTHREAD_H) CHECK_INCLUDE_FILE(inttypes.h LWS_HAVE_INTTYPES_H) +CHECK_INCLUDE_FILE(sys/resource.h LWS_HAVE_SYS_RESOURCE_H) if (WIN32 OR MSVC) CHECK_C_SOURCE_COMPILES("#include diff --git a/cmake/lws_config_private.h.in b/cmake/lws_config_private.h.in index 51c72fcde..7f61e4fcd 100644 --- a/cmake/lws_config_private.h.in +++ b/cmake/lws_config_private.h.in @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine LWS_HAVE_SYS_PRCTL_H +/* Define to 1 if you have the header file. */ +#cmakedefine LWS_HAVE_SYS_RESOURCE_H + /* Define to 1 if you have the header file. */ #cmakedefine LWS_HAVE_SYS_SOCKET_H diff --git a/lib/core/context.c b/lib/core/context.c index 0cdfc7228..8c26d2460 100644 --- a/lib/core/context.c +++ b/lib/core/context.c @@ -30,7 +30,7 @@ static const char *library_version = LWS_LIBRARY_VERSION; -#if defined(__linux__) || defined(__FreeBSD__) || defined(__illumos__) +#if defined(LWS_HAVE_SYS_RESOURCE_H) /* for setrlimit */ #include #endif