summaryrefslogtreecommitdiffstats
path: root/plugins/utils.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2019-07-18 08:40:35 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2019-07-18 08:40:35 +0200
commit34cc70c3c6428ba0d1f42994f5f0d6b4b8fc8711 (patch)
treec434bba834da4b42c85d00a2083c205307c8d55a /plugins/utils.c
parent2f4d6764d78cf085601b34ac92486405bd11095d (diff)
parente8325b39c47e6fbf7c8c1e31f9026870d9520af5 (diff)
downloadmonitoring-plugins-34cc70c3c6428ba0d1f42994f5f0d6b4b8fc8711.tar.gz
Merge branch 'master' into feature_check_curl
Diffstat (limited to 'plugins/utils.c')
-rw-r--r--plugins/utils.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/utils.c b/plugins/utils.c
index ee620133..348ec022 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -678,3 +678,19 @@ char *sperfdata_int (const char *label,
678 678
679 return data; 679 return data;
680} 680}
681
682int
683open_max (void)
684{
685 errno = 0;
686 if (maxfd > 0)
687 return(maxfd);
688
689 if ((maxfd = sysconf (_SC_OPEN_MAX)) < 0) {
690 if (errno == 0)
691 maxfd = DEFAULT_MAXFD; /* it's indeterminate */
692 else
693 die (STATE_UNKNOWN, _("sysconf error for _SC_OPEN_MAX\n"));
694 }
695 return(maxfd);
696}