From 1fe3038c15740cf21a2eb7b00edad8d216384c2e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 2 Nov 2015 12:34:45 +0100 Subject: [PATCH] Report RLIMIT_NOFILE MP-631 Filter frontend_net reports this during start. --- configure.ac | 2 +- src/filter_frontend_net.cpp | 13 +++++++++++++ src/filter_frontend_net.hpp | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 78ebd6f..6e15185 100644 --- a/configure.ac +++ b/configure.ac @@ -35,7 +35,7 @@ fi AC_CHECK_LIB([dl],[dlopen]) AC_CHECK_LIB([m],[main]) -AC_CHECK_FUNCS([localtime_r]) +AC_CHECK_FUNCS([localtime_r getrlimit]) USEMARCON_INIT diff --git a/src/filter_frontend_net.cpp b/src/filter_frontend_net.cpp index 7d6b422..2e2ada2 100644 --- a/src/filter_frontend_net.cpp +++ b/src/filter_frontend_net.cpp @@ -18,6 +18,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "config.hpp" +#if HAVE_GETRLIMIT +#include +#endif #include #include #include @@ -585,6 +588,16 @@ void yf::FrontendNet::stop(int signo) const m_p->m_stop_signo = signo; } +void yf::FrontendNet::start() const +{ +#if HAVE_GETRLIMIT + struct rlimit limit_data; + getrlimit(RLIMIT_NOFILE, &limit_data); + yaz_log(YLOG_LOG, "getrlimit NOFILE cur=%ld max=%ld", + (long) limit_data.rlim_cur, (long) limit_data.rlim_max); +#endif +} + bool yf::FrontendNet::My_Timer_Thread::timeout() { return m_timeout; diff --git a/src/filter_frontend_net.hpp b/src/filter_frontend_net.hpp index 6562c15..5af4d7c 100644 --- a/src/filter_frontend_net.hpp +++ b/src/filter_frontend_net.hpp @@ -42,6 +42,7 @@ namespace metaproxy_1 { void process(metaproxy_1::Package & package) const; void configure(const xmlNode * ptr, bool test_only, const char *path); + void start() const; void stop(int signo) const; public: /// set ports -- 1.7.10.4