summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/explicit_bzero.c
diff options
context:
space:
mode:
authortedu <>2014-01-22 21:06:45 +0000
committertedu <>2014-01-22 21:06:45 +0000
commit4fa31e96a25424fef44451ad022218b3233f54f3 (patch)
tree720c5274efe0595e27c584f2d90331efa736ad03 /src/lib/libc/string/explicit_bzero.c
parenta263ce82893e1ce0d825e878afa7914f21507549 (diff)
downloadopenbsd-4fa31e96a25424fef44451ad022218b3233f54f3.tar.gz
openbsd-4fa31e96a25424fef44451ad022218b3233f54f3.tar.bz2
openbsd-4fa31e96a25424fef44451ad022218b3233f54f3.zip
add explicit_bzero to libc. implementation subject to change, but start
the ball rolling. ok deraadt.
Diffstat (limited to 'src/lib/libc/string/explicit_bzero.c')
-rw-r--r--src/lib/libc/string/explicit_bzero.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/libc/string/explicit_bzero.c b/src/lib/libc/string/explicit_bzero.c
new file mode 100644
index 0000000000..fd2948ca44
--- /dev/null
+++ b/src/lib/libc/string/explicit_bzero.c
@@ -0,0 +1,20 @@
1/* $OpenBSD: explicit_bzero.c,v 1.1 2014/01/22 21:06:45 tedu Exp $ */
2/*
3 * Public domain.
4 * Written by Ted Unangst
5 */
6
7#if !defined(_KERNEL) && !defined(_STANDALONE)
8#include <string.h>
9#else
10#include <lib/libkern/libkern.h>
11#endif
12
13/*
14 * explicit_bzero - don't let the compiler optimize away bzero
15 */
16void
17explicit_bzero(void *p, size_t n)
18{
19 bzero(p, n);
20}