setenv.3c (2010 09)
s
setenv(3C) setenv(3C)
setenv(envname,envval,1);
The following code removes the variable NEWHOME from the current environment.
unsetenv("NEWHOME");
WARNINGS
The setenv() and unsetenv() functions manipulate the environment pointed to by environ , and can
be used in conjunction with
getenv(). However, envp (the third argument to main) is not changed.
The
setenv() uses malloc() to enlarge the environment (see malloc (3C)).
After the
setenv() or unsetenv() function is called, environment variables may not be in alphabeti-
cal order.
AUTHOR
setenv() and unsetenv() were developed by HP.
SEE ALSO
exec(2), getenv(3C), malloc(3C), putenv(3C), environ(5), thread_safety(5).
STANDARDS CONFORMANCE
setenv(): UNIX 03
unsetenv(): UNIX 03
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010