aboutsummaryrefslogtreecommitdiff
path: root/src/userspace/mlibc/string/memcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/userspace/mlibc/string/memcpy.c')
-rw-r--r--src/userspace/mlibc/string/memcpy.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/userspace/mlibc/string/memcpy.c b/src/userspace/mlibc/string/memcpy.c
new file mode 100644
index 0000000..e4e9c76
--- /dev/null
+++ b/src/userspace/mlibc/string/memcpy.c
@@ -0,0 +1,9 @@
+#include <stddef.h>
+
+void *memcpy(void *dest, const void *src, size_t count)
+{
+ const char *sp = (const char *) src;
+ char *dp = (char *) dest;
+ for (; count != 0; count--) *dp++ = *sp++;
+ return dest;
+} \ No newline at end of file