1/* $OpenBSD: explicit_bzero.c,v 1.3 2014/06/21 02:34:26 matthew Exp $ */ 2/* 3 * Public domain. 4 * Written by Matthew Dempsky. 5 */ 6 7#include <sys/cdefs.h> 8__FBSDID("$FreeBSD$"); 9 10#ifdef _KERNEL 11#include <sys/libkern.h> 12#else 13#include <string.h> 14#endif /* _KERNEL */ 15 16__attribute__((weak)) void __explicit_bzero_hook(void *, size_t); 17 18__attribute__((weak)) void 19__explicit_bzero_hook(void *buf, size_t len) 20{ 21} 22 23void 24explicit_bzero(void *buf, size_t len) 25{ 26 memset(buf, 0, len); 27 __explicit_bzero_hook(buf, len); 28} 29