#include"common.h"#ifdef __APPLE__#define INHERIT_NONE 0#endif /* __APPLE__ */#if defined(__FreeBSD__) || defined(__APPLE__)# define O_NOATIME 0# define MADV_DONTFORK INHERIT_NONE#endif /* __FreeBSD__ || __APPLE__*/char*netdata_configured_hostname=NULL;char*netdata_configured_config_dir=NULL;char*netdata_configured_log_dir=NULL;char*netdata_configured_plugins_dir=NULL;char*netdata_configured_web_dir=NULL;char*netdata_configured_cache_dir=NULL;char*netdata_configured_varlib_dir=NULL;char*netdata_configured_home_dir=NULL;char*netdata_configured_host_prefix=NULL;char*netdata_configured_timezone=NULL;structrlimitrlimit_nofile={.rlim_cur=1024,.rlim_max=1024};intenable_ksm=1;volatilesig_atomic_tnetdata_exit=0;constchar*os_type=NETDATA_OS_TYPE;constchar*program_version=VERSION;// ----------------------------------------------------------------------------// memory allocation functions that handle failures// although netdata does not use memory allocations too often (netdata tries to// maintain its memory footprint stable during runtime, i.e. all buffers are// allocated during initialization and are adapted to current use throughout// its lifetime), these can be used to override the default system allocation// routines.#ifdef NETDATA_LOG_ALLOCATIONSstaticstructmemory_statistics{volatilesize_tmalloc_calls_made;volatilesize_tcalloc_calls_made;volatilesize_trealloc_calls_made;volatilesize_tstrdup_calls_made;volatile