explicit_memset.c revision 1.3.4.2
1/* $NetBSD: explicit_memset.c,v 1.3.4.2 2014/05/22 11:26:30 yamt Exp $ */
2
3#if !defined(_KERNEL) && !defined(_STANDALONE)
4#include "namespace.h"
5#include <string.h>
6#ifdef __weak_alias
7__weak_alias(explicit_memset,_explicit_memset)
8#endif
9#define explicit_memset_impl __explicit_memset_impl
10#else
11#include <lib/libkern/libkern.h>
12#endif
13
14/*
15 * The use of a volatile pointer guarantees that the compiler
16 * will not optimise the call away.
17 */
18void *(* volatile explicit_memset_impl)(void *, int, size_t) = memset;
19
20void *
21explicit_memset(void *b, int c, size_t len)
22{
23
24	return (*explicit_memset_impl)(b, c, len);
25}
26