# Windows uses a specialised env handler
mingw*)
+$as_echo "#define HAVE_SETENV 1" >>confdefs.h
+
+
$as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
+ ac_cv_func_setenv=yes
ac_cv_func_unsetenv=yes
;;
*)
- ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
+ ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv"
+if test "x$ac_cv_func_setenv" = xyes; then :
+ $as_echo "#define HAVE_SETENV 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" setenv.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS setenv.$ac_objext"
+ ;;
+esac
+
+fi
+
+ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
if test "x$ac_cv_func_unsetenv" = xyes; then :
$as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
case $host_os in
# Windows uses a specialised env handler
mingw*)
+ AC_DEFINE(HAVE_SETENV, 1, [Define to 1 because replacement version used.])
AC_DEFINE(HAVE_UNSETENV, 1, [Define to 1 because replacement version used.])
+ ac_cv_func_setenv=yes
ac_cv_func_unsetenv=yes
;;
*)
- AC_REPLACE_FUNCS([unsetenv])
+ AC_REPLACE_FUNCS([setenv unsetenv])
;;
esac
-- Initialization that requires path substitution.
-CREATE FUNCTION putenv(text)
+CREATE FUNCTION setenv(text, text)
RETURNS void
- AS '@libdir@/regress@DLSUFFIX@', 'regress_putenv'
+ AS '@libdir@/regress@DLSUFFIX@', 'regress_setenv'
LANGUAGE C STRICT;
CREATE FUNCTION wait_pid(int)
LANGUAGE C STRICT;
CREATE FUNCTION set_pgservicefile(text) RETURNS void LANGUAGE SQL
- AS $$SELECT putenv('PGSERVICEFILE=@abs_srcdir@/' || $1)$$;
+ AS $$SELECT setenv('PGSERVICEFILE', '@abs_srcdir@/' || $1)$$;
-- Initialization that requires path substitution.
-CREATE FUNCTION putenv(text)
+CREATE FUNCTION setenv(text, text)
RETURNS void
- AS '@libdir@/regress@DLSUFFIX@', 'regress_putenv'
+ AS '@libdir@/regress@DLSUFFIX@', 'regress_setenv'
LANGUAGE C STRICT;
CREATE FUNCTION wait_pid(int)
RETURNS void
AS '@libdir@/regress@DLSUFFIX@'
LANGUAGE C STRICT;
CREATE FUNCTION set_pgservicefile(text) RETURNS void LANGUAGE SQL
- AS $$SELECT putenv('PGSERVICEFILE=@abs_srcdir@/' || $1)$$;
+ AS $$SELECT setenv('PGSERVICEFILE', '@abs_srcdir@/' || $1)$$;
static bool CurrentLocaleConvValid = false;
static bool CurrentLCTimeValid = false;
-/* Environment variable storage area */
-
-#define LC_ENV_BUFSIZE (NAMEDATALEN + 20)
-
-static char lc_collate_envbuf[LC_ENV_BUFSIZE];
-static char lc_ctype_envbuf[LC_ENV_BUFSIZE];
-
-#ifdef LC_MESSAGES
-static char lc_messages_envbuf[LC_ENV_BUFSIZE];
-#endif
-static char lc_monetary_envbuf[LC_ENV_BUFSIZE];
-static char lc_numeric_envbuf[LC_ENV_BUFSIZE];
-static char lc_time_envbuf[LC_ENV_BUFSIZE];
-
/* Cache for collation-related knowledge */
typedef struct
{
char *result;
const char *envvar;
- char *envbuf;
#ifndef WIN32
result = setlocale(category, locale);
*/
if (category == LC_CTYPE)
{
- static char save_lc_ctype[LC_ENV_BUFSIZE];
+ static char save_lc_ctype[NAMEDATALEN + 20];
/* copy setlocale() return value before callee invokes it again */
strlcpy(save_lc_ctype, result, sizeof(save_lc_ctype));
{
case LC_COLLATE:
envvar = "LC_COLLATE";
- envbuf = lc_collate_envbuf;
break;
case LC_CTYPE:
envvar = "LC_CTYPE";
- envbuf = lc_ctype_envbuf;
break;
#ifdef LC_MESSAGES
case LC_MESSAGES:
envvar = "LC_MESSAGES";
- envbuf = lc_messages_envbuf;
#ifdef WIN32
result = IsoLocaleName(locale);
if (result == NULL)
#endif /* LC_MESSAGES */
case LC_MONETARY:
envvar = "LC_MONETARY";
- envbuf = lc_monetary_envbuf;
break;
case LC_NUMERIC:
envvar = "LC_NUMERIC";
- envbuf = lc_numeric_envbuf;
break;
case LC_TIME:
envvar = "LC_TIME";
- envbuf = lc_time_envbuf;
break;
default:
elog(FATAL, "unrecognized LC category: %d", category);
- envvar = NULL; /* keep compiler quiet */
- envbuf = NULL;
- return NULL;
+ return NULL; /* keep compiler quiet */
}
- snprintf(envbuf, LC_ENV_BUFSIZE - 1, "%s=%s", envvar, result);
-
- if (putenv(envbuf))
+ if (setenv(envvar, result, 1) != 0)
return NULL;
return result;
void
setup_pgdata(void)
{
- char *pgdata_get_env,
- *pgdata_set_env;
+ char *pgdata_get_env;
if (!pg_data)
{
* need quotes otherwise on Windows because paths there are most likely to
* have embedded spaces.
*/
- pgdata_set_env = psprintf("PGDATA=%s", pg_data);
- putenv(pgdata_set_env);
+ if (setenv("PGDATA", pg_data, 1) != 0)
+ {
+ pg_log_error("could not set environment");
+ exit(1);
+ }
}
*/
#ifndef WIN32
{
- static char env_var[32];
+ char env_var[32];
- snprintf(env_var, sizeof(env_var), "PG_GRANDPARENT_PID=%d",
- (int) getppid());
- putenv(env_var);
+ snprintf(env_var, sizeof(env_var), "%d", (int) getppid());
+ setenv("PG_GRANDPARENT_PID", env_var, 1);
}
#endif
case 'D':
{
char *pgdata_D;
- char *env_var;
pgdata_D = pg_strdup(optarg);
canonicalize_path(pgdata_D);
- env_var = psprintf("PGDATA=%s", pgdata_D);
- putenv(env_var);
+ setenv("PGDATA", pgdata_D, 1);
/*
* We could pass PGDATA just in an environment
* 'ps' display
*/
pgdata_opt = psprintf("-D \"%s\" ", pgdata_D);
+ free(pgdata_D);
break;
}
case 'e':
if (getenv("LC_MESSAGES"))
lc_messages = pg_strdup(getenv("LC_MESSAGES"));
- pg_putenv("LC_COLLATE", NULL);
- pg_putenv("LC_CTYPE", NULL);
- pg_putenv("LC_MONETARY", NULL);
- pg_putenv("LC_NUMERIC", NULL);
- pg_putenv("LC_TIME", NULL);
+ unsetenv("LC_COLLATE");
+ unsetenv("LC_CTYPE");
+ unsetenv("LC_MONETARY");
+ unsetenv("LC_NUMERIC");
+ unsetenv("LC_TIME");
#ifndef WIN32
- pg_putenv("LANG", NULL);
+ unsetenv("LANG");
#else
/* On Windows the default locale may not be English, so force it */
- pg_putenv("LANG", "en");
+ setenv("LANG", "en", 1);
#endif
- pg_putenv("LANGUAGE", NULL);
- pg_putenv("LC_ALL", NULL);
- pg_putenv("LC_MESSAGES", "C");
+ unsetenv("LANGUAGE");
+ unsetenv("LC_ALL");
+ setenv("LC_MESSAGES", "C", 1);
/*
* Check for clean shutdown
pclose(output);
/*
- * Restore environment variables
+ * Restore environment variables. Note all but LANG and LC_MESSAGES were
+ * unset above.
*/
- pg_putenv("LC_COLLATE", lc_collate);
- pg_putenv("LC_CTYPE", lc_ctype);
- pg_putenv("LC_MONETARY", lc_monetary);
- pg_putenv("LC_NUMERIC", lc_numeric);
- pg_putenv("LC_TIME", lc_time);
- pg_putenv("LANG", lang);
- pg_putenv("LANGUAGE", language);
- pg_putenv("LC_ALL", lc_all);
- pg_putenv("LC_MESSAGES", lc_messages);
+ if (lc_collate)
+ setenv("LC_COLLATE", lc_collate, 1);
+ if (lc_ctype)
+ setenv("LC_CTYPE", lc_ctype, 1);
+ if (lc_monetary)
+ setenv("LC_MONETARY", lc_monetary, 1);
+ if (lc_numeric)
+ setenv("LC_NUMERIC", lc_numeric, 1);
+ if (lc_time)
+ setenv("LC_TIME", lc_time, 1);
+ if (lang)
+ setenv("LANG", lang, 1);
+ else
+ unsetenv("LANG");
+ if (language)
+ setenv("LANGUAGE", language, 1);
+ if (lc_all)
+ setenv("LC_ALL", lc_all, 1);
+ if (lc_messages)
+ setenv("LC_MESSAGES", lc_messages, 1);
+ else
+ unsetenv("LC_MESSAGES");
pg_free(lc_collate);
pg_free(lc_ctype);
* Push the user name into the environment so pre-9.1
* pg_ctl/libpq uses it.
*/
- pg_putenv("PGUSER", os_info.user);
+ setenv("PGUSER", os_info.user, 1);
break;
case 'v':
char *pgoptions = psprintf("%s %s", FIX_DEFAULT_READ_ONLY,
getenv("PGOPTIONS"));
- pg_putenv("PGOPTIONS", pgoptions);
+ setenv("PGOPTIONS", pgoptions, 1);
pfree(pgoptions);
}
else
- pg_putenv("PGOPTIONS", FIX_DEFAULT_READ_ONLY);
+ setenv("PGOPTIONS", FIX_DEFAULT_READ_ONLY, 1);
/* Get values from env if not already set */
check_required_directory(&old_cluster.bindir, "PGBINOLD", false,
void prep_status(const char *fmt,...) pg_attribute_printf(1, 2);
void check_ok(void);
unsigned int str2uint(const char *str);
-void pg_putenv(const char *var, const char *val);
/* version.c */
{
return strtoul(str, NULL, 10);
}
-
-
-/*
- * pg_putenv()
- *
- * This is like putenv(), but takes two arguments.
- * It also does unsetenv() if val is NULL.
- */
-void
-pg_putenv(const char *var, const char *val)
-{
- if (val)
- {
-#ifndef WIN32
- char *envstr;
-
- envstr = psprintf("%s=%s", var, val);
- putenv(envstr);
-
- /*
- * Do not free envstr because it becomes part of the environment on
- * some operating systems. See port/unsetenv.c::unsetenv.
- */
-#else
- SetEnvironmentVariableA(var, val);
-#endif
- }
- else
- {
-#ifndef WIN32
- unsetenv(var);
-#else
- SetEnvironmentVariableA(var, "");
-#endif
- }
-}
else
{
/* Set variable to the value of the next argument */
- char *newval;
-
- newval = psprintf("%s=%s", envvar, envval);
- putenv(newval);
+ setenv(envvar, envval, 1);
success = true;
-
- /*
- * Do not free newval here, it will screw up the environment if
- * you do. See putenv man page for details. That means we leak a
- * bit of memory here, but not enough to worry about.
- */
}
free(envvar);
free(envval);
{
char path[MAXPGPATH];
char my_exec_path[MAXPGPATH];
- char env_path[MAXPGPATH + sizeof("PGSYSCONFDIR=")]; /* longer than
- * PGLOCALEDIR */
- char *dup_path;
/* don't set LC_ALL in the backend */
if (strcmp(app, PG_TEXTDOMAIN("postgres")) != 0)
get_locale_path(my_exec_path, path);
bindtextdomain(app, path);
textdomain(app);
-
- if (getenv("PGLOCALEDIR") == NULL)
- {
- /* set for libpq to use */
- snprintf(env_path, sizeof(env_path), "PGLOCALEDIR=%s", path);
- canonicalize_path(env_path + 12);
- dup_path = strdup(env_path);
- if (dup_path)
- putenv(dup_path);
- }
+ /* set for libpq to use, but don't override existing setting */
+ setenv("PGLOCALEDIR", path, 0);
#endif
if (getenv("PGSYSCONFDIR") == NULL)
{
get_etc_path(my_exec_path, path);
-
/* set for libpq to use */
- snprintf(env_path, sizeof(env_path), "PGSYSCONFDIR=%s", path);
- canonicalize_path(env_path + 13);
- dup_path = strdup(env_path);
- if (dup_path)
- putenv(dup_path);
+ setenv("PGSYSCONFDIR", path, 0);
}
}
cmdline = pg_strdup(GetCommandLine());
- putenv("PG_RESTRICT_EXEC=1");
+ setenv("PG_RESTRICT_EXEC", "1", 1);
if ((restrictedToken = CreateRestrictedProcess(cmdline, &pi)) == 0)
{
/* Define to 1 if you have the <security/pam_appl.h> header file. */
#undef HAVE_SECURITY_PAM_APPL_H
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
/* Define to 1 if you have the `setproctitle' function. */
#undef HAVE_SETPROCTITLE
extern long random(void);
#endif
+#ifndef HAVE_SETENV
+extern int setenv(const char *name, const char *value, int overwrite);
+#endif
+
#ifndef HAVE_UNSETENV
-extern void unsetenv(const char *name);
+extern int unsetenv(const char *name);
#endif
#ifndef HAVE_SRANDOM
/* in port/win32env.c */
extern int pgwin32_putenv(const char *);
-extern void pgwin32_unsetenv(const char *);
+extern int pgwin32_setenv(const char *name, const char *value, int overwrite);
+extern int pgwin32_unsetenv(const char *name);
+
+#define putenv(x) pgwin32_putenv(x)
+#define setenv(x,y,z) pgwin32_setenv(x,y,z)
+#define unsetenv(x) pgwin32_unsetenv(x)
/* in port/win32security.c */
extern int pgwin32_is_service(void);
/* Windows security token manipulation (in src/common/exec.c) */
extern BOOL AddUserToTokenDacl(HANDLE hToken);
-#define putenv(x) pgwin32_putenv(x)
-#define unsetenv(x) pgwin32_unsetenv(x)
-
/* Things that exist in MinGW headers, but need to be added to MSVC */
#ifdef _MSC_VER
outfile_stdout,
outfile_stderr);
- appnameenv = psprintf("PGAPPNAME=ecpg/%s", testname_dash.data);
- putenv(appnameenv);
+ appnameenv = psprintf("ecpg/%s", testname_dash.data);
+ setenv("PGAPPNAME", appnameenv, 1);
+ free(appnameenv);
pid = spawn_process(cmd);
}
unsetenv("PGAPPNAME");
- free(appnameenv);
free(testname_dash.data);
--- /dev/null
+/*-------------------------------------------------------------------------
+ *
+ * setenv.c
+ * setenv() emulation for machines without it
+ *
+ * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ * src/port/setenv.c
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "c.h"
+
+
+int
+setenv(const char *name, const char *value, int overwrite)
+{
+ char *envstr;
+
+ /* Error conditions, per POSIX */
+ if (name == NULL || name[0] == '\0' || strchr(name, '=') != NULL ||
+ value == NULL)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* No work if variable exists and we're not to replace it */
+ if (overwrite == 0 && getenv(name) != NULL)
+ return 0;
+
+ /*
+ * Add or replace the value using putenv(). This will leak memory if the
+ * same variable is repeatedly redefined, but there's little we can do
+ * about that when sitting atop putenv().
+ */
+ envstr = (char *) malloc(strlen(name) + strlen(value) + 2);
+ if (!envstr) /* not much we can do if no memory */
+ return -1;
+
+ sprintf(envstr, "%s=%s", name, value);
+
+ return putenv(envstr);
+}
#include "c.h"
-void
+int
unsetenv(const char *name)
{
char *envstr;
+ /* Error conditions, per POSIX */
+ if (name == NULL || name[0] == '\0' || strchr(name, '=') != NULL)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
if (getenv(name) == NULL)
- return; /* no work */
+ return 0; /* no work */
/*
* The technique embodied here works if libc follows the Single Unix Spec
envstr = (char *) malloc(strlen(name) + 2);
if (!envstr) /* not much we can do if no memory */
- return;
+ return -1;
/* Override the existing setting by forcibly defining the var */
sprintf(envstr, "%s=", name);
- putenv(envstr);
+ if (putenv(envstr))
+ return -1;
/* Now we can clobber the variable definition this way: */
strcpy(envstr, "=");
* This last putenv cleans up if we have multiple zero-length names as a
* result of unsetting multiple things.
*/
- putenv(envstr);
+ return putenv(envstr);
}
/*-------------------------------------------------------------------------
*
* win32env.c
- * putenv() and unsetenv() for win32, which update both process environment
- * and caches in (potentially multiple) C run-time library (CRT) versions.
+ * putenv(), setenv(), and unsetenv() for win32.
+ *
+ * These functions update both the process environment and caches in
+ * (potentially multiple) C run-time library (CRT) versions.
*
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
#include "c.h"
+
+/*
+ * Note that unlike POSIX putenv(), this doesn't use the passed-in string
+ * as permanent storage.
+ */
int
pgwin32_putenv(const char *envval)
{
}
*cp = '\0';
cp++;
- if (strlen(cp))
+ if (*cp)
{
/*
* Only call SetEnvironmentVariable() when we are adding a variable,
return _putenv(envval);
}
-void
+int
+pgwin32_setenv(const char *name, const char *value, int overwrite)
+{
+ int res;
+ char *envstr;
+
+ /* Error conditions, per POSIX */
+ if (name == NULL || name[0] == '\0' || strchr(name, '=') != NULL ||
+ value == NULL)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* No work if variable exists and we're not to replace it */
+ if (overwrite == 0 && getenv(name) != NULL)
+ return 0;
+
+ envstr = (char *) malloc(strlen(name) + strlen(value) + 2);
+ if (!envstr) /* not much we can do if no memory */
+ return -1;
+
+ sprintf(envstr, "%s=%s", name, value);
+
+ res = pgwin32_putenv(envstr);
+ free(envstr);
+ return res;
+}
+
+int
pgwin32_unsetenv(const char *name)
{
+ int res;
char *envbuf;
envbuf = (char *) malloc(strlen(name) + 2);
if (!envbuf)
- return;
+ return -1;
sprintf(envbuf, "%s=", name);
- pgwin32_putenv(envbuf);
+ res = pgwin32_putenv(envbuf);
free(envbuf);
+ return res;
}
exit(2);
}
- appnameenv = psprintf("PGAPPNAME=isolation/%s", testname);
- putenv(appnameenv);
+ appnameenv = psprintf("isolation/%s", testname);
+ setenv("PGAPPNAME", appnameenv, 1);
+ free(appnameenv);
pid = spawn_process(psql_cmd);
}
unsetenv("PGAPPNAME");
- free(appnameenv);
return pid;
}
return NULL;
}
-/*
- * Handy subroutine for setting an environment variable "var" to "val"
- */
-static void
-doputenv(const char *var, const char *val)
-{
- char *s;
-
- s = psprintf("%s=%s", var, val);
- putenv(s);
-}
-
/*
* Prepare environment variables for running regression tests
*/
* Set default application_name. (The test_function may choose to
* override this, but if it doesn't, we have something useful in place.)
*/
- putenv("PGAPPNAME=pg_regress");
+ setenv("PGAPPNAME", "pg_regress", 1);
if (nolocale)
{
* variables unset; see PostmasterMain().
*/
#if defined(WIN32) || defined(__CYGWIN__) || defined(__darwin__)
- putenv("LANG=C");
+ setenv("LANG", "C", 1);
#endif
}
*/
unsetenv("LANGUAGE");
unsetenv("LC_ALL");
- putenv("LC_MESSAGES=C");
+ setenv("LC_MESSAGES", "C", 1);
/*
* Set encoding as requested
*/
if (encoding)
- doputenv("PGCLIENTENCODING", encoding);
+ setenv("PGCLIENTENCODING", encoding, 1);
else
unsetenv("PGCLIENTENCODING");
/*
* Set timezone and datestyle for datetime-related tests
*/
- putenv("PGTZ=PST8PDT");
- putenv("PGDATESTYLE=Postgres, MDY");
+ setenv("PGTZ", "PST8PDT", 1);
+ setenv("PGDATESTYLE", "Postgres, MDY", 1);
/*
* Likewise set intervalstyle to ensure consistent results. This is a bit
if (!old_pgoptions)
old_pgoptions = "";
- new_pgoptions = psprintf("PGOPTIONS=%s %s",
+ new_pgoptions = psprintf("%s %s",
old_pgoptions, my_pgoptions);
- putenv(new_pgoptions);
+ setenv("PGOPTIONS", new_pgoptions, 1);
+ free(new_pgoptions);
}
if (temp_instance)
unsetenv("PGDATA");
#ifdef HAVE_UNIX_SOCKETS
if (hostname != NULL)
- doputenv("PGHOST", hostname);
+ setenv("PGHOST", hostname, 1);
else
{
sockdir = getenv("PG_REGRESS_SOCK_DIR");
if (!sockdir)
sockdir = make_temp_sockdir();
- doputenv("PGHOST", sockdir);
+ setenv("PGHOST", sockdir, 1);
}
#else
Assert(hostname != NULL);
- doputenv("PGHOST", hostname);
+ setenv("PGHOST", hostname, 1);
#endif
unsetenv("PGHOSTADDR");
if (port != -1)
char s[16];
sprintf(s, "%d", port);
- doputenv("PGPORT", s);
+ setenv("PGPORT", s, 1);
}
}
else
*/
if (hostname != NULL)
{
- doputenv("PGHOST", hostname);
+ setenv("PGHOST", hostname, 1);
unsetenv("PGHOSTADDR");
}
if (port != -1)
char s[16];
sprintf(s, "%d", port);
- doputenv("PGPORT", s);
+ setenv("PGPORT", s, 1);
}
if (user != NULL)
- doputenv("PGUSER", user);
+ setenv("PGUSER", user, 1);
/*
* However, we *don't* honor PGDATABASE, since we certainly don't wish
fprintf(stderr, _("port %d apparently in use, trying %d\n"), port, port + 1);
port++;
sprintf(s, "%d", port);
- doputenv("PGPORT", s);
+ setenv("PGPORT", s, 1);
}
else
break;
exit(2);
}
- appnameenv = psprintf("PGAPPNAME=pg_regress/%s", testname);
- putenv(appnameenv);
+ appnameenv = psprintf("pg_regress/%s", testname);
+ setenv("PGAPPNAME", appnameenv, 1);
+ free(appnameenv);
pid = spawn_process(psql_cmd);
}
unsetenv("PGAPPNAME");
- free(appnameenv);
return pid;
}
PG_RETURN_POINTER(newtup->t_data);
}
-PG_FUNCTION_INFO_V1(regress_putenv);
+PG_FUNCTION_INFO_V1(regress_setenv);
Datum
-regress_putenv(PG_FUNCTION_ARGS)
+regress_setenv(PG_FUNCTION_ARGS)
{
- MemoryContext oldcontext;
- char *envbuf;
+ char *envvar = text_to_cstring(PG_GETARG_TEXT_PP(0));
+ char *envval = text_to_cstring(PG_GETARG_TEXT_PP(1));
if (!superuser())
elog(ERROR, "must be superuser to change environment variables");
- oldcontext = MemoryContextSwitchTo(TopMemoryContext);
- envbuf = text_to_cstring((text *) PG_GETARG_POINTER(0));
- MemoryContextSwitchTo(oldcontext);
-
- if (putenv(envbuf) != 0)
+ if (setenv(envvar, envval, 1) != 0)
elog(ERROR, "could not set environment variable: %m");
PG_RETURN_VOID();
HAVE_RL_FILENAME_QUOTING_FUNCTION => undef,
HAVE_RL_RESET_SCREEN_SIZE => undef,
HAVE_SECURITY_PAM_APPL_H => undef,
+ HAVE_SETENV => undef,
HAVE_SETPROCTITLE => undef,
HAVE_SETPROCTITLE_FAST => undef,
HAVE_SETSID => undef,