summaryrefslogtreecommitdiff
path: root/userspace/test_env.c
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/test_env.c')
-rw-r--r--userspace/test_env.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/userspace/test_env.c b/userspace/test_env.c
new file mode 100644
index 0000000..0a04791
--- /dev/null
+++ b/userspace/test_env.c
@@ -0,0 +1,31 @@
+#include <stdlib.h>
+
+extern char **environ;
+
+int main(int argc, char **argv)
+{
+
+ printf("argv: 0x%08X\n",argv);
+ printf("env: 0x%08X\n",environ);
+
+ int i=0;
+ while(environ[i]!=NULL)
+ {
+ printf("envvar %s (0x%08X)\n" ,environ[i],environ[i]);
+ i++;
+ }
+
+ putenv("supa=dupa");
+ printf("env: 0x%08X\n",environ);
+
+ i=0;
+ while(environ[i]!=NULL)
+ {
+ printf("envvar %s (0x%08X)\n" ,environ[i],environ[i]);
+ i++;
+ }
+
+ return 0;
+}
+
+