summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/explicit_bzero.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/string/explicit_bzero.c')
-rw-r--r--lib/libc/string/explicit_bzero.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/libc/string/explicit_bzero.c b/lib/libc/string/explicit_bzero.c
new file mode 100644
index 00000000000..fd2948ca44e
--- /dev/null
+++ b/lib/libc/string/explicit_bzero.c
@@ -0,0 +1,20 @@
+/* $OpenBSD: explicit_bzero.c,v 1.1 2014/01/22 21:06:45 tedu Exp $ */
+/*
+ * Public domain.
+ * Written by Ted Unangst
+ */
+
+#if !defined(_KERNEL) && !defined(_STANDALONE)
+#include <string.h>
+#else
+#include <lib/libkern/libkern.h>
+#endif
+
+/*
+ * explicit_bzero - don't let the compiler optimize away bzero
+ */
+void
+explicit_bzero(void *p, size_t n)
+{
+ bzero(p, n);
+}