Commit 71afde43 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Port to AIX 4.2: limit the number of open file descriptors in a more

portable way.
parent d731afa8
2002-10-27 Per Cederqvist <>
Port to AIX 4.2: limit the number of open file descriptors in a
more portable way.
* src/include/kom-config.h (PROTECTED_FDS): Added parenthesis
around the number.
(USING_RLIMIT_NOFILE): Define if we have a good setrlimit.
(fd_ceiling): New variable.
* src/server/server-config.c (MAX_NO_OF_CONNECTIONS): Removed.
(fd_ceiling): New variable.
* src/server/connections.c (toploop): Transform ISC_EVENT_LOGIN to
ISC_EVENT_LOGIN_UNRELOCATED if the file descriptor is above
fd_ceiling. This can only happen if USING_RLIMIT_NOFILE is
undefined, so ifdef out this code.
* src/server/ramkomd.c (go_daemon): Close everything below
fd_ceiling instead of using MAX_NO_OF_CONNECTIONS + PROTECTED_FDS.
(initialize): Use getrlimit/setrlimit if USING_RLIMIT_NOFILE is
defined. Check that getrlimit after setrlimit returns a sane
value. Don't use sysconf(_SC_OPEN_MAX), since getrlimit provides
a better value. Set fd_ceiling instead of MAX_NO_OF_CONNECTIONS.
Make it possible to lower the ceiling even when we don't have a
working setrlimit. Removed the final sanity checks; the world
ain't sane.
* src/server/testsuite/testfd.c (main): Adjusted logic for error
checks to be similar to the code now used. In particular, don't
test sysconf(_SC_OPEN_MAX), and don't test getrlimit if
2002-10-26 Per Cederqvist <>
Prepare for more portable handling of the number of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment