f14fb60209
* Updating common/lib * Updating lib/csu * Updating lib/libc * Updating libexec/ld.elf_so * Corrected test on __minix in featuretest to actually follow the meaning of the comment. * Cleaned up _REENTRANT-related defintions. * Disabled -D_REENTRANT for libfetch * Removing some unneeded __NBSD_LIBC defines and tests Change-Id: Ic1394baef74d11b9f86b312f5ff4bbc3cbf72ce2
22 lines
540 B
C
22 lines
540 B
C
/* $NetBSD: explicit_bzero.c,v 1.1 2012/08/30 12:16:49 drochner Exp $ */
|
|
|
|
#if !defined(_KERNEL) && !defined(_STANDALONE)
|
|
#include <string.h>
|
|
#define explicit_bzero __explicit_bzero
|
|
#define explicit_memset_impl __explicit_memset_impl
|
|
#else
|
|
#include <lib/libkern/libkern.h>
|
|
#endif
|
|
|
|
/*
|
|
* The use of a volatile pointer guarantees that the compiler
|
|
* will not optimise the call away.
|
|
*/
|
|
void *(* volatile explicit_memset_impl)(void *, int, size_t) = memset;
|
|
|
|
void
|
|
explicit_bzero(void *b, size_t len)
|
|
{
|
|
|
|
(*explicit_memset_impl)(b, 0, len);
|
|
}
|