summaryrefslogtreecommitdiff
path: root/missing/explicit_bzero.c
diff options
context:
space:
mode:
Diffstat (limited to 'missing/explicit_bzero.c')
-rw-r--r--missing/explicit_bzero.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/missing/explicit_bzero.c b/missing/explicit_bzero.c
index a7ff9cb517..1220e5f9ad 100644
--- a/missing/explicit_bzero.c
+++ b/missing/explicit_bzero.c
@@ -17,9 +17,9 @@
/* OS support note:
* BSDs have explicit_bzero().
- * OS-X has memset_s().
+ * macOS has memset_s().
* Windows has SecureZeroMemory() since XP.
- * Linux has none. *Sigh*
+ * Linux has explicit_bzero() since glibc 2.25, musl libc 1.1.20.
*/
/*
@@ -33,7 +33,13 @@
#undef explicit_bzero
#ifndef HAVE_EXPLICIT_BZERO
- #ifdef HAVE_MEMSET_S
+ #ifdef HAVE_EXPLICIT_MEMSET
+void
+explicit_bzero(void *b, size_t len)
+{
+ (void)explicit_memset(b, 0, len);
+}
+ #elif defined HAVE_MEMSET_S
void
explicit_bzero(void *b, size_t len)
{