1 /*
2  * Copyright (C) 2002     Manuel Novoa III
3  * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
4  *
5  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
6  */
7 
8 #include <string.h>
9 
10 #ifdef __UCLIBC_SUSV3_LEGACY__
bcopy(const void * s2,void * s1,size_t n)11 void bcopy(const void *s2, void *s1, size_t n)
12 {
13 #if 1
14 	memmove(s1, s2, n);
15 #else
16 	register char *s;
17 	register const char *p;
18 
19 	s = s1;
20 	p = s2;
21 	if (p >= s) {
22 		while (n) {
23 			*s++ = *p++;
24 			--n;
25 		}
26 	} else {
27 		while (n) {
28 			--n;
29 			s[n] = p[n];
30 		}
31 	}
32 #endif
33 }
34 #endif
35