From: Florian Schmidt Date: Wed, 5 Jun 2019 12:43:26 +0000 (+0200) Subject: Initial public release: stubs.cc for unfinished glue implementations X-Git-Tag: RELEASE-0.4~8 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e726cf3868ff9eba5913801f738504f8575aa1cd;p=unikraft%2Flibs%2Fclick.git Initial public release: stubs.cc for unfinished glue implementations Signed-off-by: Florian Schmidt Reviewed-by: Felipe Huici --- diff --git a/Makefile.uk b/Makefile.uk index 9885520..02b58f8 100644 --- a/Makefile.uk +++ b/Makefile.uk @@ -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 index 0000000..fcc72d8 --- /dev/null +++ b/stubs.cc @@ -0,0 +1,36 @@ +#include +#include +#include +#include + +/* 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" */