From 5695748b3fbacb140f38ed18d442b961a53986a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Sun, 5 May 2019 00:00:00 +0000 Subject: [PATCH] userland: move posix/environ from cpp-cheat --- userland/posix/environ.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 userland/posix/environ.c diff --git a/userland/posix/environ.c b/userland/posix/environ.c new file mode 100644 index 0000000..39ef1cb --- /dev/null +++ b/userland/posix/environ.c @@ -0,0 +1,15 @@ +/* Print all environment variables. */ + +#include +#include + +extern char **environ; + +int main(void) { + char **env = environ; + while (*env) { + printf("%s\n", *env); + env++; + } + return EXIT_SUCCESS; +}