]> xenbits.xensource.com Git - people/liuw/rumprun.git/commitdiff
push libc_stubs to librumprun_base
authorAntti Kantee <pooka@iki.fi>
Wed, 15 Apr 2015 09:25:44 +0000 (09:25 +0000)
committerAntti Kantee <pooka@iki.fi>
Wed, 15 Apr 2015 09:25:44 +0000 (09:25 +0000)
lib/librumprun_base/Makefile
lib/librumprun_base/libc_stubs.c [new file with mode: 0644]
platform/baremetal/undefs.c
platform/xen/Makefile
platform/xen/lib/libc_stubs.c [deleted file]

index d3ad73816bb5340f71b7a5dcc343480237f0d943..b368b188fc215cca75b604fd4faafffd8945d2cc 100644 (file)
@@ -6,7 +6,7 @@ LIB=            rumprun_base
 LIBISPRIVATE=  # defined
 
 SRCS=          malloc.c netbsd_initfini.c syscall_misc.c
-SRCS+=         __errno.c _lwp.c
+SRCS+=         __errno.c _lwp.c libc_stubs.c
 
 CPPFLAGS+=     -I${.CURDIR}/../../include
 
diff --git a/lib/librumprun_base/libc_stubs.c b/lib/librumprun_base/libc_stubs.c
new file mode 100644 (file)
index 0000000..9890e55
--- /dev/null
@@ -0,0 +1,71 @@
+/*-
+ * Copyright (c) 2014 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <errno.h>
+#include <stdio.h>
+
+#define STUB(name)                             \
+  int name(void); int name(void) {             \
+       static int done = 0;                    \
+       errno = ENOTSUP;                        \
+       if (done) return ENOTSUP; done = 1;     \
+       printf("STUB ``%s'' called\n", #name);  \
+       return ENOTSUP;}
+
+STUB(__sigaction14);
+STUB(__sigaction_sigtramp);
+STUB(sigaction);
+STUB(sigprocmask);
+STUB(__getrusage50);
+
+STUB(__fork);
+STUB(__vfork14);
+STUB(kill);
+STUB(getpriority);
+STUB(setpriority);
+STUB(posix_spawn);
+
+STUB(mlockall);
+
+/* for pthread_cancelstub */
+STUB(_sys_mq_send);
+STUB(_sys_mq_receive);
+STUB(_sys___mq_timedsend50);
+STUB(_sys___mq_timedreceive50);
+STUB(_sys_msgrcv);
+STUB(_sys_msgsnd);
+STUB(_sys___msync13);
+STUB(_sys___wait450);
+STUB(_sys___sigsuspend14);
+
+int execve(const char *, char *const[], char *const[]);
+int
+execve(const char *file, char *const argv[], char *const envp[])
+{
+
+       printf("execve not implemented\n");
+       errno = ENOTSUP;
+       return -1;
+}
index 05e4a8f09dae4ab189149f43a07fc58360cbf5f9..f0aec63808113f9d1283e96badf28fcff38d459b 100644 (file)
@@ -40,39 +40,3 @@ NOTHING(rumpuser_open)
 NOTHING(rumpuser_close)
 REALNOTHING(rumpuser_getfileinfo)
 NOTHING(rumpuser_bio)
-
-/* libc */
-
-REALNOTHING(__sigaction14);
-NOTHING(__getrusage50);
-//REALNOTHING(__sigprocmask14);
-REALNOTHING(sigqueueinfo);
-//REALNOTHING(rasctl);
-//NOTHING(_lwp_self);
-
-//NOTHING(__libc_static_tls_setup);
-
-NOTHING(__fork);
-NOTHING(__vfork14);
-NOTHING(kill);
-NOTHING(getpriority);
-NOTHING(setpriority);
-
-int execve(const char *, char *const[], char *const[]);
-int
-execve(const char *file, char *const argv[], char *const envp[])
-{
-
-       bmk_cons_puts("execve not implemented\n");
-       return -1;
-}
-
-NOTHING(_sys_mq_send);
-NOTHING(_sys_mq_receive);
-NOTHING(_sys___mq_timedsend50);
-NOTHING(_sys___mq_timedreceive50);
-NOTHING(_sys_msgrcv);
-NOTHING(_sys_msgsnd);
-NOTHING(_sys___msync13);
-NOTHING(_sys___wait450);
-NOTHING(_sys___sigsuspend14);
index c1bd7ca9eba8e36ff0ca85e6f13eae1fd475c7b6..8284f1db3c88477a6db1cc7756198eec2d0ad056 100644 (file)
@@ -51,8 +51,6 @@ RUMP_LDLIBS := ${RUMP_LDLIBS} -L${BASEDIR}/xen -L${COREDIR}/xen -L${RUMPUSERDIR}
 
 LDFLAGS := -L$(abspath rump/lib)
 
-rump-src-y += lib/libc_stubs.c
-
 rump-src-y += rumphyper_base.c
 rump-src-y += rumphyper_bio.c
 rump-src-y += rumphyper_net.c
diff --git a/platform/xen/lib/libc_stubs.c b/platform/xen/lib/libc_stubs.c
deleted file mode 100644 (file)
index 008af34..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <errno.h>
-#include <stdio.h>
-
-#define STUB(name)                             \
-  int name(void); int name(void) {             \
-       static int done = 0;                    \
-       errno = ENOTSUP;                        \
-       if (done) return ENOTSUP; done = 1;     \
-       printf("STUB ``%s'' called\n", #name);  \
-       return ENOTSUP;}
-
-STUB(__sigaction14);
-STUB(__sigaction_sigtramp);
-STUB(sigaction);
-STUB(sigprocmask);
-STUB(__getrusage50);
-
-STUB(__fork);
-STUB(__vfork14);
-STUB(execve);
-STUB(kill);
-STUB(getpriority);
-STUB(setpriority);
-STUB(posix_spawn);
-
-STUB(mlockall);
-
-/* for pthread_cancelstub */
-STUB(_sys_mq_send);
-STUB(_sys_mq_receive);
-STUB(_sys___mq_timedsend50);
-STUB(_sys___mq_timedreceive50);
-STUB(_sys_msgrcv);
-STUB(_sys_msgsnd);
-STUB(_sys___msync13);
-STUB(_sys___wait450);
-STUB(_sys___sigsuspend14);