Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance status with reporting maximum number of open files (sockets) #1016

Closed
wants to merge 6 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/chanprog.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ void tell_verbose_status(int idx)
int i;
time_t now2 = now - online_since, hr, min;
double cputime, cache_total;
struct rlimit rlp;

i = count_users(userlist);
dprintf(idx, "I am %s, running %s: %d user%s (mem: %uk).\n",
Expand Down Expand Up @@ -366,6 +367,12 @@ void tell_verbose_status(int idx)
"Threaded DNS core is disabled.\n"
#endif
"Socket table: %d/%d\n", threaddata()->MAXSOCKS, max_socks);

if (!getrlimit(RLIMIT_NOFILE, &rlp)) /* TODO: should be posix 2001
* make sure this is as portable as expected
* and maybe also add reporting of
* current amount of open files */
dprintf(idx, "Maximum number of open files (sockets): cur %ju max %ju\n", rlp.rlim_cur, rlp.rlim_max);
michaelortmann marked this conversation as resolved.
Show resolved Hide resolved
}

/* Show all internal state variables
Expand Down