From f0b4968b623074bf747550ea61847a7712255533 Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Wed, 2 Jul 2014 16:18:40 -0700 Subject: [PATCH] Add memcpy --- sys/kern/libc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/kern/libc.c b/sys/kern/libc.c index e16bdff..1fe76ab 100644 --- a/sys/kern/libc.c +++ b/sys/kern/libc.c @@ -49,3 +49,18 @@ memset(void *dst, uint8_t c, size_t length) return dst; } +void * +memcpy(void *dst, const void *src, size_t length) +{ + uint8_t *d = (uint8_t *)dst; + const uint8_t *s = (const uint8_t *)src; + + do { + *d = *s; + d += 1; + s += 1; + } while (--length != 0); + + return dst; +} +