diff options
| author | tedu <> | 2014-01-22 21:06:45 +0000 |
|---|---|---|
| committer | tedu <> | 2014-01-22 21:06:45 +0000 |
| commit | 4e1aa1ee5b941edcc77a1abbb462455376b314f0 (patch) | |
| tree | 720c5274efe0595e27c584f2d90331efa736ad03 /src/lib/libc/string/explicit_bzero.c | |
| parent | 7d65e8fd4a57dbcd77c42bbff8ee7ed5ce9732e5 (diff) | |
| download | openbsd-4e1aa1ee5b941edcc77a1abbb462455376b314f0.tar.gz openbsd-4e1aa1ee5b941edcc77a1abbb462455376b314f0.tar.bz2 openbsd-4e1aa1ee5b941edcc77a1abbb462455376b314f0.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.c | 20 |
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 | */ | ||
| 16 | void | ||
| 17 | explicit_bzero(void *p, size_t n) | ||
| 18 | { | ||
| 19 | bzero(p, n); | ||
| 20 | } | ||
