libc: late intialization of plugins

- for-each plugin iterator
* Call 'init(Genode::env &)' for each plugin bofore 'Libc::construct' or
'main' is called
This commit is contained in:
Sebastian Sumpf
2017-02-07 10:34:49 +01:00
committed by Norman Feske
parent 549c6db064
commit 643a09b518
3 changed files with 24 additions and 0 deletions

View File

@ -23,11 +23,14 @@
#include <sys/stat.h>
#include <sys/mount.h> /* for 'struct statfs' */
namespace Genode { class Env; }
namespace Libc {
using namespace Genode;
class File_descriptor;
typedef Genode::Path<PATH_MAX> Absolute_path;
@ -70,6 +73,11 @@ namespace Libc {
virtual bool supports_unlink(const char *path);
virtual bool supports_mmap();
/*
* Should be overwritten for plugins that require the Genode environment
*/
virtual void init(Genode::Env &env) { }
virtual File_descriptor *accept(File_descriptor *,
struct ::sockaddr *addr,
socklen_t *addrlen);