toaruos/userspace/test-env.c
Kevin Lange 5249138dcd Environment variables, integrated with newlib.
* Patched crt0 to support a pre_main
* pre_main sets up environment variables, can do other things later,
  but then just jumps to main with the same arguments.
* Updated a bunch of apps to pass environment variables around.
2012-10-08 00:17:50 -07:00

14 lines
231 B
C

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char * argv) {
printf("hello world\n");
char * term = getenv("TERM");
if (term) {
printf("TERM=%s\n", term);
} else {
printf("TERM is not set.\n");
}
return 0;
}