explicit_bzero.c 384 B

12345678910111213141516171819202122
  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. #pragma GCC diagnostic ignored "-Wunused-parameter"
  7. #include <string.h>
  8. __attribute__((weak)) void
  9. __explicit_bzero_hook(void *buf, size_t len)
  10. {
  11. }
  12. void
  13. explicit_bzero(void *buf, size_t len)
  14. {
  15. memset(buf, 0, len);
  16. __explicit_bzero_hook(buf, len);
  17. }