1 #include <string.h> 2 #define N 10000 3 4 static void* pmemccpy(void * a1,void * a2,int c,size_t n)5pmemccpy(void *a1, void *a2, int c, size_t n) 6 { 7 char *s1, *s2; 8 9 s1 = a1; 10 s2 = a2; 11 while(n > 0) { 12 if((*s1++ = *s2++) == c) 13 return s1; 14 n--; 15 } 16 return 0; 17 } 18 19 char* strcpy(char * s1,const char * s2)20strcpy(char *s1, const char *s2) 21 { 22 char *os1; 23 24 os1 = s1; 25 while(!pmemccpy(s1, s2, 0, N)) { 26 s1 += N; 27 s2 += N; 28 } 29 return os1; 30 } 31