genode/repos/libports/src/test/libc_getenv/main.c
Emery Hemingway 9b3ecb114d lib/posix: populate environment variables from config
Parse ``<env key="..." value=".."/>`` nodes from the config ROM and
populate a list at the 'genode_envp' and 'environ' symbols.

Test script at run/libc_getenv.

Fix #2236
2017-01-31 12:01:16 +01:00

27 lines
475 B
C

/*
* \brief Libc getenv(...) test
* \author Emery Hemingway
* \date 2017-01-24
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv)
{
int i;
for (i = 1; i < argc; ++i) {
char const *key = argv[i];
printf("%s=\"%s\"\n", key, getenv(key));
}
return 0;
}