-#if !defined(HAVE_SETENV)
-static char env_interval[64];
-// max hostname len is 255, so this should be enough
-static char env_hostname[300];
-#endif
-
-static void set_environment(void) /* {{{ */
-{
-#ifdef HAVE_SETENV
- char buffer[1024];
-
- snprintf(buffer, sizeof(buffer), "%.3f",
- CDTIME_T_TO_DOUBLE(plugin_get_interval()));
- setenv("COLLECTD_INTERVAL", buffer, /* overwrite = */ 1);
-
- sstrncpy(buffer, hostname_g, sizeof(buffer));
- setenv("COLLECTD_HOSTNAME", buffer, /* overwrite = */ 1);
-#else
- snprintf(env_interval, sizeof(env_interval), "COLLECTD_INTERVAL=%.3f",
- CDTIME_T_TO_DOUBLE(plugin_get_interval()));
- putenv(env_interval);
-
- snprintf(env_hostname, sizeof(env_hostname), "COLLECTD_HOSTNAME=%s",
- hostname_g);
- putenv(env_hostname);
-#endif
-} /* }}} void set_environment */
-
-static void unset_environment(void) /* {{{ */
-{
-#ifdef HAVE_SETENV
- unsetenv("COLLECTD_INTERVAL");
- unsetenv("COLLECTD_HOSTNAME");
-#else
- snprintf(env_interval, sizeof(env_interval), "COLLECTD_INTERVAL");
- putenv(env_interval);
- snprintf(env_hostname, sizeof(env_hostname), "COLLECTD_HOSTNAME");
- putenv(env_hostname);
-#endif
-} /* }}} void unset_environment */
-
-__attribute__((noreturn)) static void exec_child(program_list_t *pl, int uid,
- int gid, int egid) /* {{{ */