diff options
Diffstat (limited to 'userspace/simple.c')
| -rw-r--r-- | userspace/simple.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/userspace/simple.c b/userspace/simple.c index 5322584..bd42d9c 100644 --- a/userspace/simple.c +++ b/userspace/simple.c @@ -1,14 +1,23 @@ +#include <stdlib.h> + +extern char **environ; int main(int argc, char **argv) { - int i; printf("argv: 0x%08X\n",argv); + printf("env: 0x%08X\n",environ); + + putenv("test=11"); - for(i=0;i<argc;i++) + + int i=0; + while(environ[i]!=NULL) { - if(!strcmp(argv[i],"-v"))puts("version 1"); + printf("envvar %s (0x%08X)\n" ,environ[i],environ[i]); + i++; } + puts("bye"); return 0; |
