how to get evironment variables ? is there a function to get it? or run setenv with execv?C:char *argv[] = { "ls", (char *)0 }; char *envp[] = { (char *)0 }; execve("/bin/ls", argv, envp);
how to get evironment variables ? is there a function to get it? or run setenv with execv?
The argument envp is also a pointer to a null-terminated array of character pointers to null-terminated strings.
A pointer to this array is normally stored in the global variable environ.
A process can query, update, and delete these strings using the getenv(3), setenv(3), and unsetenv(3) functions, respectively.