about summary refs log tree commit diff
path: root/configure.ng
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2024-03-28 10:16:44 +0100
committerAlexander Barton <alex@barton.de>2024-03-31 11:19:48 +0200
commit34979250004fb2785ed68c9714a42ddef6523a90 (patch)
tree99f2da39647a4feb842082d5d8ae41705ca3ce0e /configure.ng
parent24e822cff2d0a33c9bfa26fe31d52939bdd3fac7 (diff)
downloadngircd-34979250004fb2785ed68c9714a42ddef6523a90.tar.gz
ngircd-34979250004fb2785ed68c9714a42ddef6523a90.zip
Try to set file descriptor limit to its maximum and show info on startup
The number of possible parallel connections is limited by the process
file descriptor limit (among other things). Therefore try to upgrade the
current "soft" limit to its "hard" maximum (but limit it to 100000), and
show an information or even warning, wenn still less than the configured
"MaxConnections" setting.

Please note that ngIRCd and its linked libraries (like PAM) need file
descriptors not only for incoming and outgoing IRC connections, but for
reading files and inter-process communication, too! Therefore the actual
connection limit is _less_ than the file descriptor limit!

This introduces the new MAX_FD_LIMIT (100000) #define.
Diffstat (limited to 'configure.ng')
-rw-r--r--configure.ng2
1 files changed, 2 insertions, 0 deletions
diff --git a/configure.ng b/configure.ng
index f6c70e5d..ec7b6c35 100644
--- a/configure.ng
+++ b/configure.ng
@@ -192,6 +192,7 @@ AC_CHECK_HEADERS_ONCE([ \
 	stdbool.h \
 	stddef.h \
 	stdint.h \
+	sys/resource.h \
 	varargs.h \
 ])
 
@@ -274,6 +275,7 @@ AC_CHECK_FUNCS_ONCE([
 	getnameinfo \
 	inet_aton \
 	setgroups \
+	setrlimit \
 	sigaction \
 	sigprocmask \
 	snprintf \