2012/4/4 <michael.vancann...@wisa.be>: > Not the current. > > The EXTERNAL variable environ, i.e. the one that the kernel passed on, > which cannot be modified. You can only modify your local copy.
14:00 myname@tux64:~/tmp/c$ ls a.c b.c 14:00 myname@tux64:~/tmp/c$ cat a.c #include <stdlib.h> #include <stdio.h> #include <unistd.h> main() { char *e = getenv("MYVAR"); printf("a1: %s\n", e); setenv("MYVAR", "MYVALUE", 1); e = getenv("MYVAR"); printf("a2: %s\n", e); execv("./b.out", NULL); } 14:00 myname@tux64:~/tmp/c$ cat b.c #include <stdlib.h> #include <stdio.h> main() { char *e = getenv("MYVAR"); printf("b: %s\n", e); } 14:00 myname@tux64:~/tmp/c$ gcc -o a.out a.c && gcc -o b.out b.c && ls a.c a.out b.c b.out 14:00 myname@tux64:~/tmp/c$ ./a.out a1: (null) a2: MYVALUE b: MYVALUE 14:00 myname@tux64:~/tmp/c$ -- jan -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus