summaryrefslogtreecommitdiffstats
path: root/newlib/libc/string/explicit_bzero.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-18 11:49:25 +0100
committerCorinna Vinschen <corinna@vinschen.de>2016-03-18 12:33:40 +0100
commit8740fa7fd0f1eba18059b2794c9cdfe29ef564d3 (patch)
tree72cf4f30258df1d05830ecab109a3d8136b439af /newlib/libc/string/explicit_bzero.c
parenta10dacbdac3ed9ad8e12e29473236cbbe0ff4e10 (diff)
downloadcygnal-8740fa7fd0f1eba18059b2794c9cdfe29ef564d3.tar.gz
cygnal-8740fa7fd0f1eba18059b2794c9cdfe29ef564d3.tar.bz2
cygnal-8740fa7fd0f1eba18059b2794c9cdfe29ef564d3.zip
Add explicit_bzero()
This function is used by LibreSSL and OpenSSH and is provided by the OpenBSD libc. * libc/include/string.h (explicit_bzero): Declare. * libc/string/explicit_bzero.c: New file. * libc/string/Makefile.am: Add new file. * libc/string/Makefile.in: Regenerate.
Diffstat (limited to 'newlib/libc/string/explicit_bzero.c')
-rw-r--r--newlib/libc/string/explicit_bzero.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/newlib/libc/string/explicit_bzero.c b/newlib/libc/string/explicit_bzero.c
new file mode 100644
index 000000000..5124df23c
--- /dev/null
+++ b/newlib/libc/string/explicit_bzero.c
@@ -0,0 +1,16 @@
+/* $OpenBSD: explicit_bzero.c,v 1.2 2014/06/10 04:17:37 deraadt Exp $ */
+/*
+ * Public domain.
+ * Written by Ted Unangst
+ */
+
+#include <string.h>
+
+/*
+ * explicit_bzero - don't let the compiler optimize away bzero
+ */
+void
+explicit_bzero(void *p, size_t n)
+{
+ bzero(p, n);
+}