diff --git a/gems/src/server/file_terminal/target.mk b/gems/src/server/file_terminal/target.mk
index 16adf95723..89810dd182 100644
--- a/gems/src/server/file_terminal/target.mk
+++ b/gems/src/server/file_terminal/target.mk
@@ -1,3 +1,3 @@
TARGET = file_terminal
SRC_CC = main.cc
-LIBS = libc libc_vfs
+LIBS = libc
diff --git a/gems/src/server/tcp_terminal/target.mk b/gems/src/server/tcp_terminal/target.mk
index 18d42ff193..ef5a26c941 100644
--- a/gems/src/server/tcp_terminal/target.mk
+++ b/gems/src/server/tcp_terminal/target.mk
@@ -1,3 +1,3 @@
TARGET = tcp_terminal
SRC_CC = main.cc
-LIBS = libc libc_lwip_nic_dhcp libc_vfs libc_lock_pipe
+LIBS = libc libc_lwip_nic_dhcp libc_lock_pipe
diff --git a/libports/lib/mk/libc.mk b/libports/lib/mk/libc.mk
index cb031c0d1f..51b10c540b 100644
--- a/libports/lib/mk/libc.mk
+++ b/libports/lib/mk/libc.mk
@@ -14,7 +14,9 @@ SRC_CC = atexit.cc dummies.cc rlimit.cc sysctl.cc \
gettimeofday.cc malloc.cc progname.cc fd_alloc.cc file_operations.cc \
plugin.cc plugin_registry.cc select.cc exit.cc environ.cc nanosleep.cc \
libc_mem_alloc.cc pread_pwrite.cc readv_writev.cc poll.cc \
- libc_pdbg.cc
+ libc_pdbg.cc vfs_plugin.cc
+
+INC_DIR += $(REP_DIR)/src/lib/libc
#
# Files from string library that are not included in libc-raw_string because
diff --git a/libports/lib/mk/libc_fuse_exfat.mk b/libports/lib/mk/libc_fuse_exfat.mk
index 6d7ac68a36..492c122d4e 100644
--- a/libports/lib/mk/libc_fuse_exfat.mk
+++ b/libports/lib/mk/libc_fuse_exfat.mk
@@ -4,7 +4,7 @@ EXFAT_DIR = $(REP_DIR)/contrib/$(EXFAT)
SRC_C = $(notdir $(EXFAT_DIR)/fuse/main.c)
SRC_CC = init.cc
-LIBS = libc libc_vfs libc_fuse libfuse libexfat
+LIBS = libc libc_fuse libfuse libexfat
vpath %.c $(EXFAT_DIR)/fuse
vpath %.cc $(REP_DIR)/src/lib/exfat
diff --git a/libports/lib/mk/libc_fuse_ext2.mk b/libports/lib/mk/libc_fuse_ext2.mk
index 0d59b73744..2e4b9fd530 100644
--- a/libports/lib/mk/libc_fuse_ext2.mk
+++ b/libports/lib/mk/libc_fuse_ext2.mk
@@ -5,7 +5,7 @@ FILTER_OUT = fuse-ext2.probe.c fuse-ext2.wait.c
SRC_C = $(filter-out $(FILTER_OUT), $(notdir $(wildcard $(FUSE_EXT2_DIR)/*.c)))
SRC_CC = init.cc
-LIBS = libc libc_vfs libc_fuse libfuse libext2fs
+LIBS = libc libc_fuse libfuse libext2fs
CC_OPT = -DHAVE_CONFIG_H -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
diff --git a/libports/lib/mk/libc_fuse_ntfs-3g.mk b/libports/lib/mk/libc_fuse_ntfs-3g.mk
index ec69a0d872..8af00ada7f 100644
--- a/libports/lib/mk/libc_fuse_ntfs-3g.mk
+++ b/libports/lib/mk/libc_fuse_ntfs-3g.mk
@@ -4,7 +4,7 @@ NTFS_3G_DIR = $(REP_DIR)/contrib/$(NTFS_3G)
SRC_C = ntfs-3g.c ntfs-3g_common.c
SRC_CC = init.cc
-LIBS = libc libc_vfs libc_fuse libfuse libntfs-3g
+LIBS = libc libc_fuse libfuse libntfs-3g
CC_OPT = -DHAVE_TIMESPEC -DHAVE_CONFIG_H -DRECORD_LOCKING_NOT_IMPLEMENTED
diff --git a/libports/lib/mk/libc_vfs.mk b/libports/lib/mk/libc_vfs.mk
deleted file mode 100644
index a33e1b9747..0000000000
--- a/libports/lib/mk/libc_vfs.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-SRC_CC = plugin.cc
-LIBS += libc
-INC_DIR += $(REP_DIR)/src/lib/libc
-
-vpath plugin.cc $(REP_DIR)/src/lib/libc_vfs
diff --git a/libports/src/app/avplay/target.mk b/libports/src/app/avplay/target.mk
index 8dad463f5b..622956e7e0 100644
--- a/libports/src/app/avplay/target.mk
+++ b/libports/src/app/avplay/target.mk
@@ -3,7 +3,7 @@ include $(REP_DIR)/lib/import/import-av.inc
TARGET = avplay
SRC_C = avplay.c cmdutils.c libc_dummies.c
LIBS += avfilter avformat avcodec avutil swscale
-LIBS += sdl libc libm libc_vfs config_args
+LIBS += sdl libc libm config_args
CC_WARN += -Wno-parentheses -Wno-switch -Wno-uninitialized \
-Wno-format-zero-length -Wno-pointer-sign
diff --git a/libports/src/app/eglgears/target.mk b/libports/src/app/eglgears/target.mk
index b016b70524..241d29b399 100644
--- a/libports/src/app/eglgears/target.mk
+++ b/libports/src/app/eglgears/target.mk
@@ -1,3 +1,3 @@
TARGET = eglgears
SRC_C = eglgears.c
-LIBS = libc libc_vfs libm gallium
+LIBS = libc libm gallium
diff --git a/libports/src/app/mupdf/target.mk b/libports/src/app/mupdf/target.mk
index 6e02a790e2..f8d75d1802 100644
--- a/libports/src/app/mupdf/target.mk
+++ b/libports/src/app/mupdf/target.mk
@@ -2,7 +2,7 @@ MUPDF_DIR = $(REP_DIR)/contrib/mupdf-0.9
TARGET = mupdf
SRC_C = pdfapp.c
SRC_CC = main.cc
-LIBS = libc mupdf libc_vfs
+LIBS = libc mupdf
INC_DIR += $(MUPDF_DIR)/apps
vpath pdfapp.c $(MUPDF_DIR)/apps
diff --git a/libports/src/app/qt5/tmpl/target_final.inc b/libports/src/app/qt5/tmpl/target_final.inc
index bcda8bab35..2fba3410b7 100644
--- a/libports/src/app/qt5/tmpl/target_final.inc
+++ b/libports/src/app/qt5/tmpl/target_final.inc
@@ -1,6 +1,6 @@
INC_DIR += $(PRG_DIR)
-LIBS += libc libc_vfs
+LIBS += libc
# set the stack size of the main thread
CC_CXX_OPT += -DQT_MAIN_STACK_SIZE=$(QT_MAIN_STACK_SIZE)
diff --git a/libports/src/lib/libc_vfs/plugin.cc b/libports/src/lib/libc/vfs_plugin.cc
similarity index 93%
rename from libports/src/lib/libc_vfs/plugin.cc
rename to libports/src/lib/libc/vfs_plugin.cc
index 247c30c8f0..3c5cfc2f99 100644
--- a/libports/src/lib/libc_vfs/plugin.cc
+++ b/libports/src/lib/libc/vfs_plugin.cc
@@ -162,63 +162,71 @@ class Libc_file_system_factory : public Vfs::File_system_factory
};
-static Genode::Xml_node libc_config()
-{
- return Genode::config()->xml_node().sub_node("libc");
-}
+namespace Libc {
+
+ static Genode::Xml_node config()
+ {
+ return Genode::config()->xml_node().sub_node("libc");
+ }
-static Genode::Xml_node libc_vfs_config()
-{
- return libc_config().sub_node("vfs");
-}
+ Genode::Xml_node vfs_config() __attribute__((weak));
+ Genode::Xml_node vfs_config()
+ {
+ return Libc::config().sub_node("vfs");
+ }
-class Libc_config_attr
-{
- private:
+ class Config_attr
+ {
+ private:
- char _buf[Vfs::MAX_PATH_LEN];
+ char _buf[Vfs::MAX_PATH_LEN];
- public:
+ public:
- Libc_config_attr(char const *attr_name, char const *default_value)
- {
- strncpy(_buf, default_value, sizeof(_buf));
- try {
- libc_config().attribute(attr_name).value(_buf, sizeof(_buf));
- } catch (...) { }
- }
+ Config_attr(char const *attr_name, char const *default_value)
+ {
+ Genode::strncpy(_buf, default_value, sizeof(_buf));
+ try {
+ Libc::config().attribute(attr_name).value(_buf, sizeof(_buf));
+ } catch (...) { }
+ }
- char const *string() const { return _buf; }
-};
+ char const *string() const { return _buf; }
+ };
-static char const *libc_initial_cwd()
-{
- static Libc_config_attr initial_cwd("cwd", "/");
- return initial_cwd.string();
-}
+ char const *initial_cwd() __attribute__((weak));
+ char const *initial_cwd()
+ {
+ static Config_attr initial_cwd("cwd", "/");
+ return initial_cwd.string();
+ }
-static char const *libc_config_stdin()
-{
- static Libc_config_attr stdin("stdin", "");
- return stdin.string();
-}
+ char const *config_stdin() __attribute__((weak));
+ char const *config_stdin()
+ {
+ static Config_attr stdin("stdin", "");
+ return stdin.string();
+ }
-static char const *libc_config_stdout()
-{
- static Libc_config_attr stdout("stdout", "");
- return stdout.string();
-}
+ char const *config_stdout() __attribute__((weak));
+ char const *config_stdout()
+ {
+ static Config_attr stdout("stdout", "");
+ return stdout.string();
+ }
-static char const *libc_config_stderr()
-{
- static Libc_config_attr stderr("stderr", "");
- return stderr.string();
+ char const *config_stderr() __attribute__((weak));
+ char const *config_stderr()
+ {
+ static Config_attr stderr("stderr", "");
+ return stderr.string();
+ }
}
@@ -236,7 +244,7 @@ class Libc::Vfs_plugin : public Libc::Plugin
Genode::Xml_node _vfs_config()
{
try {
- return libc_vfs_config();
+ return vfs_config();
} catch (...) {
PINF("no VFS configured");
return Genode::Xml_node("");
@@ -275,11 +283,11 @@ class Libc::Vfs_plugin : public Libc::Plugin
*/
Vfs_plugin() : _root_dir(_vfs_config(), _fs_factory)
{
- chdir(libc_initial_cwd());
+ chdir(initial_cwd());
- _open_stdio(0, libc_config_stdin(), O_RDONLY);
- _open_stdio(1, libc_config_stdout(), O_WRONLY);
- _open_stdio(2, libc_config_stderr(), O_WRONLY);
+ _open_stdio(0, config_stdin(), O_RDONLY);
+ _open_stdio(1, config_stdout(), O_WRONLY);
+ _open_stdio(2, config_stderr(), O_WRONLY);
}
~Vfs_plugin() { }
diff --git a/libports/src/server/fs_log/target.mk b/libports/src/server/fs_log/target.mk
index e280fae3eb..40f3b0a189 100644
--- a/libports/src/server/fs_log/target.mk
+++ b/libports/src/server/fs_log/target.mk
@@ -1,3 +1,3 @@
TARGET = fs_log
SRC_CC = main.cc
-LIBS = base libc_vfs libc
+LIBS = base libc
diff --git a/libports/src/server/fuse_fs/exfat/target.mk b/libports/src/server/fuse_fs/exfat/target.mk
index 514660947c..33f4389619 100644
--- a/libports/src/server/fuse_fs/exfat/target.mk
+++ b/libports/src/server/fuse_fs/exfat/target.mk
@@ -7,7 +7,7 @@ SRC_C = $(notdir $(EXFAT_DIR)/fuse/main.c)
SRC_CC = fuse_fs_main.cc \
init.cc
-LIBS = base config server libc libc_vfs libfuse libexfat
+LIBS = base config server libc libfuse libexfat
INC_DIR += $(PRG_DIR)/..
CC_OPT += -Wno-unused-function
diff --git a/libports/src/server/fuse_fs/ext2/target.mk b/libports/src/server/fuse_fs/ext2/target.mk
index 4f7e990d54..54a7d1924c 100644
--- a/libports/src/server/fuse_fs/ext2/target.mk
+++ b/libports/src/server/fuse_fs/ext2/target.mk
@@ -10,7 +10,7 @@ SRC_C = $(filter-out $(FILTER_OUT), $(notdir $(wildcard $(FUSE_EXT2_DIR)/*.c)))
SRC_CC = fuse_fs_main.cc \
init.cc
-LIBS = base config server libc libc_vfs libfuse libext2fs
+LIBS = base config server libc libfuse libext2fs
CC_OPT += -DHAVE_CONFIG_H -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
diff --git a/libports/src/server/fuse_fs/ntfs-3g/target.mk b/libports/src/server/fuse_fs/ntfs-3g/target.mk
index 3b04d1ff8d..86b254bb53 100644
--- a/libports/src/server/fuse_fs/ntfs-3g/target.mk
+++ b/libports/src/server/fuse_fs/ntfs-3g/target.mk
@@ -7,7 +7,7 @@ SRC_C = ntfs-3g.c ntfs-3g_common.c
SRC_CC = fuse_fs_main.cc \
init.cc
-LIBS = base config server libc libc_vfs libfuse libntfs-3g
+LIBS = base config server libc libfuse libntfs-3g
CC_OPT = -DHAVE_TIMESPEC -DHAVE_CONFIG_H -DRECORD_LOCKING_NOT_IMPLEMENTED
diff --git a/libports/src/test/expat/target.mk b/libports/src/test/expat/target.mk
index 3dac897b48..c81c877fcd 100644
--- a/libports/src/test/expat/target.mk
+++ b/libports/src/test/expat/target.mk
@@ -1,3 +1,3 @@
TARGET = test-expat
SRC_CC = main.cc
-LIBS = expat libc libc_vfs
+LIBS = expat libc
diff --git a/libports/src/test/libc/target.mk b/libports/src/test/libc/target.mk
index c1b4a58a18..c3d25f0bd3 100644
--- a/libports/src/test/libc/target.mk
+++ b/libports/src/test/libc/target.mk
@@ -1,3 +1,3 @@
TARGET = test-libc
SRC_CC = main.cc
-LIBS = libm libc libc_vfs
+LIBS = libm libc
diff --git a/libports/src/test/libc_block/target.mk b/libports/src/test/libc_block/target.mk
index 326b070bd1..a7c277b0de 100644
--- a/libports/src/test/libc_block/target.mk
+++ b/libports/src/test/libc_block/target.mk
@@ -1,3 +1,3 @@
TARGET = test-libc_block
-LIBS = libc libc_vfs
+LIBS = libc
SRC_CC = main.cc
diff --git a/libports/src/test/libc_ffat/target.mk b/libports/src/test/libc_ffat/target.mk
index 1b7fdd85a5..3b2a9e960b 100644
--- a/libports/src/test/libc_ffat/target.mk
+++ b/libports/src/test/libc_ffat/target.mk
@@ -1,3 +1,3 @@
TARGET = test-libc_ffat
-LIBS = libc libc_vfs libc_ffat
+LIBS = libc libc_ffat
SRC_CC = main.cc
diff --git a/libports/src/test/libc_fs_tar_fs/target.mk b/libports/src/test/libc_fs_tar_fs/target.mk
index 15b6d5891a..c6c642ce56 100644
--- a/libports/src/test/libc_fs_tar_fs/target.mk
+++ b/libports/src/test/libc_fs_tar_fs/target.mk
@@ -1,3 +1,3 @@
TARGET = test-libc_fs_tar_fs
-LIBS = libc libc_vfs
+LIBS = libc
SRC_CC = main.cc
diff --git a/libports/src/test/libc_fuse_exfat/target.mk b/libports/src/test/libc_fuse_exfat/target.mk
index b2e2c7497b..2588fe2434 100644
--- a/libports/src/test/libc_fuse_exfat/target.mk
+++ b/libports/src/test/libc_fuse_exfat/target.mk
@@ -1,5 +1,5 @@
TARGET = test-libc_fuse_exfat
-LIBS = libc libc_vfs libc_fuse_exfat
+LIBS = libc libc_fuse_exfat
SRC_CC = main.cc
vpath %.cc $(PRG_DIR)/../libc_ffat/
diff --git a/libports/src/test/libc_fuse_ext2/target.mk b/libports/src/test/libc_fuse_ext2/target.mk
index 4c3c28dbdf..08ade3c366 100644
--- a/libports/src/test/libc_fuse_ext2/target.mk
+++ b/libports/src/test/libc_fuse_ext2/target.mk
@@ -1,5 +1,5 @@
TARGET = test-libc_fuse_ext2
-LIBS = libc libc_vfs libc_fuse_ext2
+LIBS = libc libc_fuse_ext2
SRC_CC = main.cc
vpath %.cc $(PRG_DIR)/../libc_ffat
diff --git a/libports/src/test/libc_fuse_ntfs-3g/target.mk b/libports/src/test/libc_fuse_ntfs-3g/target.mk
index 4c59c63478..e1e843b2c5 100644
--- a/libports/src/test/libc_fuse_ntfs-3g/target.mk
+++ b/libports/src/test/libc_fuse_ntfs-3g/target.mk
@@ -1,5 +1,5 @@
TARGET = test-libc_fuse_ntfs-3g
-LIBS = libc libc_vfs libc_fuse_ntfs-3g
+LIBS = libc libc_fuse_ntfs-3g
SRC_CC = main.cc
vpath %.cc $(PRG_DIR)/../libc_ffat
diff --git a/libports/src/test/libc_vfs/target.mk b/libports/src/test/libc_vfs/target.mk
index 1c0c7d2e0c..c49e6ca3c5 100644
--- a/libports/src/test/libc_vfs/target.mk
+++ b/libports/src/test/libc_vfs/target.mk
@@ -1,5 +1,5 @@
TARGET = test-libc_vfs
-LIBS = libc libc_vfs
+LIBS = libc
SRC_CC = main.cc
# we re-use the libc_ffat test
diff --git a/libports/src/test/lwip/http_clnt/target.mk b/libports/src/test/lwip/http_clnt/target.mk
index e2fea9dfdf..445417bf2f 100644
--- a/libports/src/test/lwip/http_clnt/target.mk
+++ b/libports/src/test/lwip/http_clnt/target.mk
@@ -1,5 +1,5 @@
TARGET = test-http_clnt
-LIBS = lwip libc libc_vfs
+LIBS = lwip libc
SRC_CC = main.cc
REQUIRES = foc
diff --git a/libports/src/test/lwip/http_srv_static/target.mk b/libports/src/test/lwip/http_srv_static/target.mk
index 8221218a4d..b688ef91dd 100644
--- a/libports/src/test/lwip/http_srv_static/target.mk
+++ b/libports/src/test/lwip/http_srv_static/target.mk
@@ -1,5 +1,5 @@
TARGET = test-lwip_httpsrv_static
-LIBS = lwip libc libc_vfs
+LIBS = lwip libc
SRC_CC = main.cc
INC_DIR += $(REP_DIR)/src/lib/lwip/include
diff --git a/libports/src/test/lwip/http_srv_tracing/target.mk b/libports/src/test/lwip/http_srv_tracing/target.mk
index 9b8bde8ce7..8683c8f045 100644
--- a/libports/src/test/lwip/http_srv_tracing/target.mk
+++ b/libports/src/test/lwip/http_srv_tracing/target.mk
@@ -1,5 +1,5 @@
TARGET = test-lwip_httpsrv_tracing
-LIBS = lwip libc libc_vfs
+LIBS = lwip libc
SRC_CC = main.cc
REQUIRES = foc
diff --git a/libports/src/test/lwip/http_srv_tracing_nonblocking/target.mk b/libports/src/test/lwip/http_srv_tracing_nonblocking/target.mk
index 68e3b0d1c3..08893fc208 100644
--- a/libports/src/test/lwip/http_srv_tracing_nonblocking/target.mk
+++ b/libports/src/test/lwip/http_srv_tracing_nonblocking/target.mk
@@ -1,5 +1,5 @@
TARGET = test-lwip_httpsrv_tracing_nob
-LIBS = lwip libc libc_vfs
+LIBS = lwip libc
SRC_CC = main.cc
REQUIRES = foc
diff --git a/libports/src/test/lwip/loopback/target.mk b/libports/src/test/lwip/loopback/target.mk
index ce657b7b99..3ef9b05ccf 100644
--- a/libports/src/test/lwip/loopback/target.mk
+++ b/libports/src/test/lwip/loopback/target.mk
@@ -1,3 +1,3 @@
TARGET = test-lwip_loop
-LIBS = lwip libc libc_lwip_loopback libc_vfs
+LIBS = lwip libc libc_lwip_loopback
SRC_CC = main.cc
diff --git a/libports/src/test/lwip/pingpong/client/libc_lwip/target.mk b/libports/src/test/lwip/pingpong/client/libc_lwip/target.mk
index 80ac385370..c4b21f2753 100644
--- a/libports/src/test/lwip/pingpong/client/libc_lwip/target.mk
+++ b/libports/src/test/lwip/pingpong/client/libc_lwip/target.mk
@@ -1,5 +1,5 @@
TARGET = test-ping_client_libc_lwip
-LIBS = base libc lwip libc_lwip_nic_dhcp libc_vfs config_args
+LIBS = base libc lwip libc_lwip_nic_dhcp config_args
SRC_CC = main.cc pingpong.cc
vpath main.cc $(PRG_DIR)/..
diff --git a/libports/src/test/lwip/pingpong/client/lwip/target.mk b/libports/src/test/lwip/pingpong/client/lwip/target.mk
index 93e821f811..868b597ebd 100644
--- a/libports/src/test/lwip/pingpong/client/lwip/target.mk
+++ b/libports/src/test/lwip/pingpong/client/lwip/target.mk
@@ -1,5 +1,5 @@
TARGET = test-ping_client_lwip
-LIBS = base libc lwip libc_vfs config_args
+LIBS = base libc lwip config_args
SRC_CC = main.cc pingpong.cc
INC_DIR += $(REP_DIR)/src/lib/lwip/include
diff --git a/libports/src/test/lwip/pingpong/server/libc_lwip/target.mk b/libports/src/test/lwip/pingpong/server/libc_lwip/target.mk
index 423d12ea5c..7d150f8aad 100644
--- a/libports/src/test/lwip/pingpong/server/libc_lwip/target.mk
+++ b/libports/src/test/lwip/pingpong/server/libc_lwip/target.mk
@@ -1,5 +1,5 @@
TARGET = test-ping_server_libc_lwip
-LIBS = base libc libc_vfs libc_lwip_nic_dhcp libc_lwip lwip config_args
+LIBS = base libc libc_lwip_nic_dhcp libc_lwip lwip config_args
SRC_CC = main.cc pingpong.cc
vpath main.cc $(PRG_DIR)/..
diff --git a/libports/src/test/lwip/pingpong/server/lwip/target.mk b/libports/src/test/lwip/pingpong/server/lwip/target.mk
index 0b98decb84..3bc9171d77 100644
--- a/libports/src/test/lwip/pingpong/server/lwip/target.mk
+++ b/libports/src/test/lwip/pingpong/server/lwip/target.mk
@@ -1,5 +1,5 @@
TARGET = test-ping_server_lwip
-LIBS = base libc lwip libc_vfs config_args
+LIBS = base libc lwip config_args
SRC_CC = main.cc pingpong.cc
CC_OPT += -DLWIP_NATIVE
diff --git a/libports/src/test/moon/target.mk b/libports/src/test/moon/target.mk
index 2360fc4035..4a833fba7b 100644
--- a/libports/src/test/moon/target.mk
+++ b/libports/src/test/moon/target.mk
@@ -1,3 +1,3 @@
TARGET = test-moon
-LIBS = luacxx libc libm libc_vfs
+LIBS = luacxx libc libm
SRC_CC = main.cc
diff --git a/libports/src/test/pthread/target.mk b/libports/src/test/pthread/target.mk
index 445829338b..7e00299a02 100644
--- a/libports/src/test/pthread/target.mk
+++ b/libports/src/test/pthread/target.mk
@@ -1,3 +1,3 @@
TARGET = test-pthread
SRC_CC = main.cc
-LIBS = libc libc_vfs pthread
+LIBS = libc pthread
diff --git a/libports/src/test/python/target.mk b/libports/src/test/python/target.mk
index 394b4c4b62..76e4a6cff7 100644
--- a/libports/src/test/python/target.mk
+++ b/libports/src/test/python/target.mk
@@ -1,4 +1,4 @@
TARGET = test-python
-LIBS = python libc libc_vfs libm
+LIBS = python libc libm
REQUIRES = x86
SRC_CC = main.cc
diff --git a/ports/lib/mk/virtualbox_libc_support.inc b/ports/lib/mk/virtualbox_libc_support.inc
index efa1dbea64..0eac435b31 100644
--- a/ports/lib/mk/virtualbox_libc_support.inc
+++ b/ports/lib/mk/virtualbox_libc_support.inc
@@ -25,7 +25,7 @@ SRC_CC += libc/select.cc
SRC_CC += libc_terminal/plugin.cc
# Genode vfs plugin
-SRC_CC += libc_vfs/plugin.cc
+SRC_CC += libc/vfs_plugin.cc
SRC_CC += libc/pread_pwrite.cc
# Genode lock pipe plugin (needed by VirtualBox "HostSerial" driver)
diff --git a/ports/src/app/dosbox/target.mk b/ports/src/app/dosbox/target.mk
index ca85679344..e9fde95a47 100644
--- a/ports/src/app/dosbox/target.mk
+++ b/ports/src/app/dosbox/target.mk
@@ -54,5 +54,5 @@ CC_WARN += -Wno-unused-variable -Wno-unused-function -Wno-switch -Wno-unused-val
-Wno-sign-compare -Wno-narrowing -Wno-missing-braces -Wno-array-bounds \
-Wno-parentheses
-LIBS += libc libc_vfs libm libpng sdl sdl_net stdcxx zlib
+LIBS += libc libm libpng sdl sdl_net stdcxx zlib
LIBS += libc_lwip_nic_dhcp config_args
diff --git a/ports/src/app/gdb_monitor/target.mk b/ports/src/app/gdb_monitor/target.mk
index 4164181a3c..90d6f43d35 100644
--- a/ports/src/app/gdb_monitor/target.mk
+++ b/ports/src/app/gdb_monitor/target.mk
@@ -10,7 +10,7 @@ INC_DIR += $(GDB_CONTRIB_DIR)/include \
$(PRG_DIR)/gdbserver \
$(PRG_DIR)
-LIBS = libc libc_vfs libc_terminal libc_lock_pipe \
+LIBS = libc libc_terminal libc_lock_pipe \
gdbserver_platform gdbserver_libc_support
SRC_C = event-loop.c \
diff --git a/ports/src/app/lighttpd/target.mk b/ports/src/app/lighttpd/target.mk
index 7e011e3a02..883ad4e8da 100644
--- a/ports/src/app/lighttpd/target.mk
+++ b/ports/src/app/lighttpd/target.mk
@@ -2,4 +2,4 @@ TARGET = lighttpd
include $(REP_DIR)/src/app/lighttpd/target.inc
-LIBS += libc libm libc_vfs libc_lwip_nic_dhcp
+LIBS += libc libm libc_lwip_nic_dhcp
diff --git a/ports/src/app/netperf/target.inc b/ports/src/app/netperf/target.inc
index 0e1d8daeb5..92631a50e2 100644
--- a/ports/src/app/netperf/target.inc
+++ b/ports/src/app/netperf/target.inc
@@ -3,7 +3,7 @@ CONTRIB_DIR = $(REP_DIR)/contrib/netperf
LIBS += base libc libm libc-resolv libc-net libc-nameser libc-isc
# plug-in to libc
-LIBS += libc_vfs config_args
+LIBS += config_args
SRC_C = netserver.c netlib.c netsh.c nettest_bsd.c dscp.c
# omni test
diff --git a/ports/src/lib/libc_noux/plugin.cc b/ports/src/lib/libc_noux/plugin.cc
index 7f59cb5b03..d7876d30db 100644
--- a/ports/src/lib/libc_noux/plugin.cc
+++ b/ports/src/lib/libc_noux/plugin.cc
@@ -62,6 +62,20 @@ enum { verbose = false };
enum { verbose_signals = false };
+/*
+ * Customize libc VFS
+ */
+namespace Libc {
+
+ /*
+ * Override the weak function interface of the VFS plugin as Noux programs
+ * do not obtain a VFS configuration via Genode's config mechansim.
+ */
+ Genode::Xml_node vfs_config() { return Xml_node(""); }
+}
+
+
+
class Noux_connection
{
private:
@@ -805,12 +819,19 @@ namespace {
class Plugin : public Libc::Plugin
{
+ private:
+
+ /*
+ * Override the libc's default VFS plugin
+ */
+ enum { PLUGIN_PRIORITY = 1 };
+
public:
/**
* Constructor
*/
- Plugin()
+ Plugin() : Libc::Plugin(PLUGIN_PRIORITY)
{
/* register inherited open file descriptors */
int fd = 0;
@@ -829,6 +850,7 @@ namespace {
bool supports_unlink(char const *) { return true; }
bool supports_readlink(const char *, char *, size_t) { return true; }
bool supports_rename(const char *, const char *) { return true; }
+ bool supports_rmdir(char const *) { return true; }
bool supports_mkdir(const char *, mode_t) { return true; }
bool supports_socket(int, int, int) { return true; }
bool supports_mmap() { return true; }
@@ -849,12 +871,13 @@ namespace {
::off_t lseek(Libc::File_descriptor *, ::off_t offset, int whence);
ssize_t read(Libc::File_descriptor *, void *, ::size_t);
ssize_t readlink(const char *path, char *buf, size_t bufsiz);
+ int rename(const char *oldpath, const char *newpath);
+ int rmdir(char const *path);
int stat(char const *, struct stat *);
int symlink(const char *, const char *);
int ioctl(Libc::File_descriptor *, int request, char *argp);
int pipe(Libc::File_descriptor *pipefd[2]);
int unlink(char const *path);
- int rename(const char *oldpath, const char *newpath);
int mkdir(const char *path, mode_t mode);
void *mmap(void *addr, ::size_t length, int prot, int flags,
Libc::File_descriptor *, ::off_t offset);
@@ -1563,6 +1586,12 @@ namespace {
}
+ int Plugin::rmdir(char const *path)
+ {
+ return Plugin::unlink(path);
+ }
+
+
ssize_t Plugin::readlink(const char *path, char *buf, size_t bufsiz)
{
if (verbose)
diff --git a/ports/src/test/gdb_monitor/target.mk b/ports/src/test/gdb_monitor/target.mk
index 1c2f832204..72a18a09a6 100644
--- a/ports/src/test/gdb_monitor/target.mk
+++ b/ports/src/test/gdb_monitor/target.mk
@@ -1,3 +1,3 @@
TARGET = test-gdb_monitor
SRC_CC = main.cc
-LIBS = libc libc_vfs
+LIBS = libc
diff --git a/ports/src/virtualbox/autotest/target.mk b/ports/src/virtualbox/autotest/target.mk
index 592292e517..7bd7872327 100644
--- a/ports/src/virtualbox/autotest/target.mk
+++ b/ports/src/virtualbox/autotest/target.mk
@@ -1,3 +1,3 @@
TARGET = vbox-auto-test-helper
SRC_CC = main.cc
-LIBS = libc libc_fs
+LIBS = libc
diff --git a/qt4/src/app/examples/textedit/target.mk b/qt4/src/app/examples/textedit/target.mk
index aabb72ca55..d2be91ee46 100644
--- a/qt4/src/app/examples/textedit/target.mk
+++ b/qt4/src/app/examples/textedit/target.mk
@@ -12,5 +12,3 @@ vpath % $(QMAKE_PROJECT_PATH)
include $(QT4_REP_DIR)/src/app/tmpl/target_defaults.inc
include $(QT4_REP_DIR)/src/app/tmpl/target_final.inc
-
-LIBS += libc_vfs