summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/bcopy.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-11-30 19:43:54 +0000
committerderaadt <deraadt@openbsd.org>2014-11-30 19:43:54 +0000
commit5b859c19fe53bbea08f5c342e0a4470e99f883e1 (patch)
tree7252e6d2fe4779d5efa144101312151b0f8abeaa /lib/libc/string/bcopy.c
parentMask out EFER_LMA when restoring saved EFER on zzz/ZZZ resume as it's a (diff)
downloadwireguard-openbsd-5b859c19fe53bbea08f5c342e0a4470e99f883e1.tar.xz
wireguard-openbsd-5b859c19fe53bbea08f5c342e0a4470e99f883e1.zip
restructure libc/string + libc/arch/*/string coperation regarding
(potentially) MD versions (function dependent, not filename dependent) split out memcpy/memmove/bcopy and strchr/index/strrchr/rindex Bring back amd64 .S versions And the final touch: switch all architectures temporarily to MI memcpy.c, which contains syslog + abort for overlapping copies. A nice harsh undefined behaviour. We will clean the entire userland of the remaining issues in this catagory, then switch to the optimised memcpy which skips the memmove check. I tried to cut this change into pieces, but testing each sub-step on every architecture is too time consuming and mindnumbing. ok miod
Diffstat (limited to 'lib/libc/string/bcopy.c')
-rw-r--r--lib/libc/string/bcopy.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/lib/libc/string/bcopy.c b/lib/libc/string/bcopy.c
index 4308c6484ab..fcaa843c71c 100644
--- a/lib/libc/string/bcopy.c
+++ b/lib/libc/string/bcopy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcopy.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: bcopy.c,v 1.6 2014/11/30 19:43:56 deraadt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -44,21 +44,9 @@ typedef long word; /* "word" used for optimal copy speed */
/*
* Copy a block of memory, handling overlap.
- * This is the routine that actually implements
- * (the portable versions of) bcopy, memcpy, and memmove.
*/
-#ifdef MEMCOPY
-void *
-memcpy(void *dst0, const void *src0, size_t length)
-#else
-#ifdef MEMMOVE
-void *
-memmove(void *dst0, const void *src0, size_t length)
-#else
void
bcopy(const void *src0, void *dst0, size_t length)
-#endif
-#endif
{
char *dst = dst0;
const char *src = src0;
@@ -120,9 +108,5 @@ bcopy(const void *src0, void *dst0, size_t length)
TLOOP(*--dst = *--src);
}
done:
-#if defined(MEMCOPY) || defined(MEMMOVE)
- return (dst0);
-#else
return;
-#endif
}