diff --git a/defs.h b/defs.h index bcfab5594ac861d3a0929f9c24c3fb77fec95fb0..525c05b08ad11b360beec2e02c75bcd6b92e6f26 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 cb890eebf08db9a604e5f58cadebdd5553584970..b35689528ce9933e6b4dda1511c45f9b28e43201 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 8280b2e2de69dcaf426aeb52f85a6a59a377caf4..18faadbe233ce25f59d06a4370d6a9ef2c2c6296 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*, ...);