Also use explicit_memset (NetBSD) with cmake, scons and meson
This commit is contained in:
parent
79760d935a
commit
d7c0fc295f
|
@ -388,6 +388,7 @@ if 1:
|
|||
'dup2',
|
||||
'epoll_ctl',
|
||||
'explicit_bzero',
|
||||
'explicit_memset',
|
||||
'fork',
|
||||
'getcwd',
|
||||
'gethostbyname',
|
||||
|
|
|
@ -185,6 +185,7 @@ check_function_exists(issetugid HAVE_ISSETUGID)
|
|||
check_function_exists(inet_pton HAVE_INET_PTON)
|
||||
check_function_exists(memset_s HAVE_MEMSET_S)
|
||||
check_function_exists(explicit_bzero HAVE_EXPLICIT_BZERO)
|
||||
check_function_exists(explicit_memset HAVE_EXPLICIT_MEMSET)
|
||||
check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
|
||||
if (NOT HAVE_CLOCK_GETTIME)
|
||||
check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
|
||||
|
|
|
@ -151,6 +151,7 @@ conf_data.set('HAVE_ISSETUGID', compiler.has_function('issetugid', args: defs))
|
|||
conf_data.set('HAVE_INET_PTON', compiler.has_function('inet_pton', args: defs))
|
||||
conf_data.set('HAVE_MEMSET_S', compiler.has_function('memset_s', args: defs))
|
||||
conf_data.set('HAVE_EXPLICIT_BZERO', compiler.has_function('explicit_bzero', args: defs))
|
||||
conf_data.set('HAVE_EXPLICIT_MEMSET', compiler.has_function('explicit_memset', args: defs))
|
||||
|
||||
conf_data.set('HAVE_CLOCK_GETTIME', compiler.has_header_symbol('time.h', 'clock_gettime'))
|
||||
clock_lib = []
|
||||
|
|
|
@ -42,7 +42,7 @@ void safe_memclear(void *s, size_t n) {
|
|||
#elif defined(HAVE_EXPLICIT_BZERO)
|
||||
explicit_bzero(s, n);
|
||||
#elif defined(HAVE_EXPLICIT_MEMSET)
|
||||
explicit_memset(s, 0, n);
|
||||
explicit_memset(s, 0, n);
|
||||
#else
|
||||
safe_memset(s, 0, n);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue