]> xenbits.xensource.com Git - unikraft/libs/click.git/commitdiff
Initial public release: stubs.cc for unfinished glue implementations
authorFlorian Schmidt <florian.schmidt@neclab.eu>
Wed, 5 Jun 2019 12:43:26 +0000 (14:43 +0200)
committerFelipe Huici <felipe.huici@neclab.eu>
Wed, 5 Jun 2019 12:57:29 +0000 (14:57 +0200)
Signed-off-by: Florian Schmidt <florian.schmidt@neclab.eu>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Makefile.uk
stubs.cc [new file with mode: 0644]

index 98855205c51420000c18514133772a2ad105b88c..02b58f80a7075643703a177646b51adaf57d80ab 100644 (file)
@@ -134,6 +134,7 @@ LIBCLICK_CXXFLAGS-y += $(LIBCLICK_SUPPRESS_FLAGS)
 # Unikraft <-> Click glue code
 ################################################################################
 LIBCLICK_SRCS-y += $(LIBCLICK_BASE)/click.cc
+LIBCLICK_SRCS-y += $(LIBCLICK_BASE)/stubs.cc
 
 ################################################################################
 # Click sources
diff --git a/stubs.cc b/stubs.cc
new file mode 100644 (file)
index 0000000..fcc72d8
--- /dev/null
+++ b/stubs.cc
@@ -0,0 +1,36 @@
+#include <errno.h>
+#include <click/config.h>
+#include <click/error.hh>
+#include <click/string.hh>
+
+/* Unikraft does not support files yet, this function is to
+   be able to read Click configs from files. */
+String file_string(String s __unused, ErrorHandler *errh)
+{
+       errh->error("no support for files yet!");
+       return String();
+}
+
+String clickpath_find_file(const String &filename __unused,
+               const char *subdir __unused, String default_path __unused,
+               ErrorHandler *errh)
+{
+       errh->error("no support for finding files!");
+       return String();
+}
+
+void click_signal(int signum __unused, void (*handler)(int) __unused,
+               bool resethand __unused)
+{
+}
+
+extern "C" {
+int dup(int oldfd); /* we don't have a header file, but the symbol is there */
+
+int pipe(int pipefd[2])
+{
+       pipefd[0] = dup(0);
+       pipefd[1] = dup(1);
+       return 0;
+}
+} /* extern "C" */