There's a declaration for memcpy, but no definition for inmates.

Huh? So why did it work so far?
All inmates currently use constant size parameters, and gcc detects
'memcpy' as a builtin name and does magic optimisation.

Signed-off-by: Ralf Ramsauer <[email protected]>
---
 inmates/lib/string.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/inmates/lib/string.c b/inmates/lib/string.c
index e013e5a2..1322f24f 100644
--- a/inmates/lib/string.c
+++ b/inmates/lib/string.c
@@ -12,6 +12,16 @@
 
 #include <inmate.h>
 
+void *memcpy(void *dest, const void *src, unsigned long n)
+{
+       const u8 *s = src;
+       u8 *d = dest;
+
+       while (n-- > 0)
+               *d++ = *s++;
+       return dest;
+}
+
 void *memset(void *s, int c, unsigned long n)
 {
        u8 *p = s;
-- 
2.12.2

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to