summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Clements <[email protected]>2009-10-07 12:05:56 -0400
committerAustin Clements <[email protected]>2009-10-07 12:05:56 -0400
commit6639ce56d986cdae197e4f013dde536178ad23f8 (patch)
treeac619c6602c04cbdc27f701f9a2644377e63d1dc
parent77a9aa55cd0c18ef33ebfa484b534511af4af53d (diff)
downloadxv6-labs-6639ce56d986cdae197e4f013dde536178ad23f8.tar.gz
xv6-labs-6639ce56d986cdae197e4f013dde536178ad23f8.tar.bz2
xv6-labs-6639ce56d986cdae197e4f013dde536178ad23f8.zip
Provide memcpy for compatibility with older versions of gcc
-rw-r--r--defs.h1
-rw-r--r--string.c6
-rw-r--r--user.h1
3 files changed, 8 insertions, 0 deletions
diff --git a/defs.h b/defs.h
index bcfab55..525c05b 100644
--- a/defs.h
+++ b/defs.h
@@ -124,6 +124,7 @@ void popcli();
// string.c
int memcmp(const void*, const void*, uint);
void* memmove(void*, const void*, uint);
+void* memcpy(void*, const void*, uint);
void* memset(void*, int, uint);
char* safestrcpy(char*, const char*, int);
int strlen(const char*);
diff --git a/string.c b/string.c
index cb890ee..b356895 100644
--- a/string.c
+++ b/string.c
@@ -44,6 +44,12 @@ memmove(void *dst, const void *src, uint n)
return dst;
}
+void*
+memcpy(void *dst, const void *src, uint n)
+{
+ return memmove(dst, src, n);
+}
+
int
strncmp(const char *p, const char *q, uint n)
{
diff --git a/user.h b/user.h
index 8280b2e..18faadb 100644
--- a/user.h
+++ b/user.h
@@ -26,6 +26,7 @@ int sleep(int);
int stat(char*, struct stat*);
char* strcpy(char*, char*);
void *memmove(void*, void*, int);
+void *memcpy(void*, void*, int);
char* strchr(const char*, char c);
int strcmp(const char*, const char*);
void printf(int, char*, ...);