mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-19 23:53:55 +00:00
Read 'main()' function arguments from config file
This patch reads program arguments from the config file and makes them available to the application via the 'argc' and 'argv' arguments of the 'main()' function. The configuration syntax looks like this: <config> <arg value="..."> <arg value="..."> ... </config> The 'value' attribute of the first <arg> node becomes 'argv[0]' and so on. Fixes #184.
This commit is contained in:
committed by
Norman Feske
parent
afe996df74
commit
de92956220
@ -48,6 +48,16 @@ __attribute__((constructor(101))) void lx_hybrid_init()
|
||||
lx_environ = environ;
|
||||
}
|
||||
|
||||
/*
|
||||
* Dummy symbols to let generic tests programs (i.e., 'test-config_args') link
|
||||
* successfully. Please note that such programs are not expected to work when
|
||||
* built as hybrid Linux/Genode programs because when using the glibc startup
|
||||
* code, we cannot manipulate argv prior executing main. However, by defining
|
||||
* these symbols, we prevent the automated build bot from stumbling over such
|
||||
* binaries.
|
||||
*/
|
||||
char **genode_argv = 0;
|
||||
int genode_argc = 1;
|
||||
|
||||
/************
|
||||
** Thread **
|
||||
|
Reference in New Issue
Block a user