if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
checklibc=True):
strlcpy_in_bsd = True
+ elif conf.env.enable_fuzzing:
+ # Just to complicate it more, some versions of Honggfuzz have
+ # got strlcpy and strlcat in libc, but not in <string.h>
+ # (unless it is there coincidentally, on a BSD). Therefore we
+ # can't use CHECK_FUNCS alone to decide whether to add the
+ # headers to replace.h.
+ #
+ # As this is only known to happen on a fuzzing compiler, we'll
+ # skip the check when not in fuzzing mode.
+ conf.CHECK_HEADERS('bsd/string.h')
+
if not conf.CHECK_FUNCS('getpeereid'):
conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):