--- main/asterisk.c (Asterisk 13.9.1) +++ main/asterisk.c (working copy) @@ -608,2 +608,4 @@ char eid_str[128]; + struct rlimit limits; + getrlimit(RLIMIT_NOFILE, &limits); @@ -629,6 +631,7 @@ ast_cli(a->fd, " Maximum calls: Not set\n"); - if (ast_option_maxfiles) - ast_cli(a->fd, " Maximum open file handles: %d\n", ast_option_maxfiles); - else - ast_cli(a->fd, " Maximum open file handles: Not set\n"); + if (limits.rlim_cur < ast_option_maxfiles) { + ast_cli(a->fd, " Maximum open file handles: %d (is) %d (requested)\n", (int) limits.rlim_cur, ast_option_maxfiles); + } else { + ast_cli(a->fd, " Maximum open file handles: %d\n", (int) limits.rlim_cur); + } ast_cli(a->fd, " Root console verbosity: %d\n", option_verbose);