summaryrefslogtreecommitdiff
path: root/user/ulib.c
diff options
context:
space:
mode:
Diffstat (limited to 'user/ulib.c')
-rw-r--r--user/ulib.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/user/ulib.c b/user/ulib.c
index ddda0f5..8bfba5d 100644
--- a/user/ulib.c
+++ b/user/ulib.c
@@ -107,3 +107,23 @@ memmove(void *vdst, const void *vsrc, int n)
*dst++ = *src++;
return vdst;
}
+
+int
+memcmp(const void *s1, const void *s2, uint n)
+{
+ const char *p1 = s1, *p2 = s2;
+ while (n-- > 0) {
+ if (*p1 != *p2) {
+ return *p1 - *p2;
+ }
+ p1++;
+ p2++;
+ }
+ return 0;
+}
+
+void *
+memcpy(void *dst, const void *src, uint n)
+{
+ return memmove(dst, src, n);
+}