From: Jeff Lucovsky Date: Wed, 29 Jul 2020 13:56:55 +0000 (-0400) Subject: output: Check for fwrite_unlocked X-Git-Tag: suricata-6.0.0-beta1~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15b4554ab3d673342ea348035ff8cf7297fbf8f6;p=thirdparty%2Fsuricata.git output: Check for fwrite_unlocked This commit creates a macro for fwrite_unlocked which is probed during configuration time. --- diff --git a/configure.ac b/configure.ac index 00326e7066..7098309554 100644 --- a/configure.ac +++ b/configure.ac @@ -245,6 +245,8 @@ AC_CHECK_FUNCS([gettimeofday clock_gettime utime strptime tzset localtime_r]) AC_CHECK_FUNCS([socket setenv select putenv dup2 endgrent endpwent atexit munmap]) + AC_CHECK_FUNCS([fwrite_unlocked]) + AC_CHECK_DECL([getrandom], AC_DEFINE([HAVE_GETRANDOM], [1], [Use getrandom]), [], [ diff --git a/src/suricata-common.h b/src/suricata-common.h index 9f3bfc1b48..f55347e185 100644 --- a/src/suricata-common.h +++ b/src/suricata-common.h @@ -520,6 +520,11 @@ size_t strlcpy(char *dst, const char *src, size_t siz); char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict); #endif +#ifndef HAVE_FWRITE_UNLOCKED +#define SCFwriteUnlocked fwrite +#else +#define SCFwriteUnlocked fwrite_unlocked +#endif extern int coverage_unittests; extern int g_ut_modules; extern int g_ut_covered;