From 7f51257c0885106d0197f37f2277edede4fc9e59 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 15 Jan 2018 22:10:58 +0000 Subject: [PATCH] NetBSD has its own unoptimizable memset version since 2013 checking presence of the function if older versions of NetBSD --- configure.ac | 1 + main/explicit_bzero.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0d3c83ee1b4..de2fbaae358 100644 --- a/configure.ac +++ b/configure.ac @@ -608,6 +608,7 @@ chroot \ ctime_r \ cuserid \ crypt \ +explicit_memset \ flock \ ftok \ funopen \ diff --git a/main/explicit_bzero.c b/main/explicit_bzero.c index 5f37811d37c..22d768d18bc 100644 --- a/main/explicit_bzero.c +++ b/main/explicit_bzero.c @@ -32,7 +32,9 @@ PHPAPI void php_explicit_bzero(void *dst, size_t siz) { -#ifdef __GNUC__ +#if HAVE_EXPLICIT_MEMSET + explicit_memset(dst, 0, siz); +#elif defined(__GNUC__) memset(dst, 0, siz); asm __volatile__("" :: "r"(dst) : "memory"); #else