From 8740fa7fd0f1eba18059b2794c9cdfe29ef564d3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 18 Mar 2016 11:49:25 +0100 Subject: 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. --- newlib/libc/string/explicit_bzero.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 newlib/libc/string/explicit_bzero.c (limited to 'newlib/libc/string/explicit_bzero.c') 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 + +/* + * explicit_bzero - don't let the compiler optimize away bzero + */ +void +explicit_bzero(void *p, size_t n) +{ + bzero(p, n); +} -- cgit v1.2.3