summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/string/explicit_bzero.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/src/string/explicit_bzero.c')
-rw-r--r--libc-top-half/musl/src/string/explicit_bzero.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/string/explicit_bzero.c b/libc-top-half/musl/src/string/explicit_bzero.c
new file mode 100644
index 0000000..f2e12f2
--- /dev/null
+++ b/libc-top-half/musl/src/string/explicit_bzero.c
@@ -0,0 +1,8 @@
+#define _BSD_SOURCE
+#include <string.h>
+
+void explicit_bzero(void *d, size_t n)
+{
+ d = memset(d, 0, n);
+ __asm__ __volatile__ ("" : : "r"(d) : "memory");
+}