summaryrefslogtreecommitdiffstats
path: root/plugins/common.h
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2021-12-02 14:11:21 (GMT)
committerGitHub <noreply@github.com>2021-12-02 14:11:21 (GMT)
commitdf1e9e975f69c8f7965bab91684870fe509739c6 (patch)
tree526b0c77c524b2219d5a48fd78b8302f055a4a5b /plugins/common.h
parent6246b8f1830e8a375bc656deafd28aab715b4fd9 (diff)
parent1a3a715702a5b6709fed2a1eb53ec644c9968057 (diff)
downloadmonitoring-plugins-df1e9e975f69c8f7965bab91684870fe509739c6.tar.gz
Merge branch 'master' into mailq-add-config-dir
Diffstat (limited to 'plugins/common.h')
-rw-r--r--plugins/common.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/common.h b/plugins/common.h
index 8719b50..0f08e2f 100644
--- a/plugins/common.h
+++ b/plugins/common.h
@@ -174,6 +174,11 @@
174 * 174 *
175 */ 175 */
176 176
177/* MariaDB 10.2 client does not set MYSQL_PORT */
178#ifndef MYSQL_PORT
179# define MYSQL_PORT 3306
180#endif
181
177enum { 182enum {
178 OK = 0, 183 OK = 0,
179 ERROR = -1 184 ERROR = -1
@@ -220,4 +225,18 @@ enum {
220# define __attribute__(x) /* do nothing */ 225# define __attribute__(x) /* do nothing */
221#endif 226#endif
222 227
228/* Try sysconf(_SC_OPEN_MAX) first, as it can be higher than OPEN_MAX.
229 * If that fails and the macro isn't defined, we fall back to an educated
230 * guess. There's no guarantee that our guess is adequate and the program
231 * will die with SIGSEGV if it isn't and the upper boundary is breached. */
232#define DEFAULT_MAXFD 256 /* fallback value if no max open files value is set */
233#define MAXFD_LIMIT 8192 /* upper limit of open files */
234#ifdef _SC_OPEN_MAX
235static long maxfd = 0;
236#elif defined(OPEN_MAX)
237# define maxfd OPEN_MAX
238#else /* sysconf macro unavailable, so guess (may be wildly inaccurate) */
239# define maxfd DEFAULT_MAXFD
240#endif
241
223#endif /* _COMMON_H_ */ 242#endif /* _COMMON_H_ */