I have the method below, and it correctly sets the ret value to 0 (indicating success in setenv), but when I check to see if this environment variable is actually set, it's absent. Why would this be happening?
void Class::mysetenv(char* a, char* b)
{
if(a==0 || b==0)
return;
int ret = setenv(strdup(a), strdup(b), 1);
printf("ret: %d %s %s\n", ret, a, b);
}