libdl: first execute all destructors, then munmap library
[uclibc-ng.git] / libc / string / bcopy.c
blobe16ba241d1ef879d1021c7b7e789c92cb6c3a617
1 /*
2 * Copyright (C) 2002 Manuel Novoa III
3 * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
6 */
8 #include <string.h>
10 #ifdef __UCLIBC_SUSV3_LEGACY__
11 void bcopy(const void *s2, void *s1, size_t n)
13 #if 1
14 memmove(s1, s2, n);
15 #else
16 register char *s;
17 register const char *p;
19 s = s1;
20 p = s2;
21 if (p >= s) {
22 while (n) {
23 *s++ = *p++;
24 --n;
26 } else {
27 while (n) {
28 --n;
29 s[n] = p[n];
32 #endif
34 #endif