mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-16 06:08:16 +00:00
Hook for passing env pointer to main function
The new 'genode_envp' variable declared in '_main.cc' allows libc plugins to supplying custom environment pointers to the main function. This is needed by 3rd-party software such as GNU make, which expects the environment pointer as third argument of the main function.
This commit is contained in:
@ -31,7 +31,7 @@
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
extern int main(int argc, char **argv);
|
||||
extern int main(int argc, char **argv, char **envp);
|
||||
extern void init_exception_handling(); /* implemented in base/cxx */
|
||||
|
||||
enum { ATEXIT_SIZE = 256 };
|
||||
@ -212,6 +212,7 @@ static char *argv[1] = { argv0 };
|
||||
*/
|
||||
char **genode_argv = argv;
|
||||
int genode_argc = 1;
|
||||
char **genode_envp = 0;
|
||||
|
||||
|
||||
/**
|
||||
@ -250,7 +251,7 @@ extern "C" int _main()
|
||||
/* now, it is save to call printf */
|
||||
|
||||
/* call real main function */
|
||||
int ret = main(genode_argc, genode_argv);
|
||||
int ret = main(genode_argc, genode_argv, genode_envp);
|
||||
|
||||
genode_exit(ret);
|
||||
|
||||
|
Reference in New Issue
Block a user