Function

GLib-2.0GLibenviron_setenvSince 2.32

  • Sets the environment variable variable in the provided list envp to value.

    Parameters

    • envp: string[]

      an environment list that can be freed using g_strfreev() (e.g., as returned from g_get_environ()), or null for an empty environment list

    • variable: string

      the environment variable to set, must not contain '='

    • value: string

      the value for to set the variable to

    • overwrite: boolean

      whether to change the variable if it already exists

    Returns string[]

    the updated environment list. Free it using g_strfreev().

    2.32