Availability:built-in
setenv(+Name,
+Value)Set an environment variable. Name and Value must
be instantiated to atoms or integers. The environment variable will be
passed to shell/[0-2]
and can be requested using getenv/2.
They also influence expand_file_name/2.
Environment variables are shared between threads. Depending on the
underlying C library, setenv/2
and unsetenv/1
may not be thread-safe and may cause memory leaks. Only changing the
environment once and before starting threads is safe in all versions of
SWI-Prolog.