mosquitto/libcommon
Yann E. MORIN a487cd4f8f libcommon: check for getrandom()
Not all C libraries are glibc, or impersonating it; for example, musl
does not pretend to be any version of glibc. Thus, building on musl
fails when openssl is disabled, because no random-providing function is
detected, although musl does provide getrandom().

uClibc-ng on the other hand, can impersonate glibc, but availability of
getrandom() is not guatranteed there: getrandom() can be compiled out of
uClinbc-ng, or uClibc-ng can be too old to have it.

Add a configure-time check that getrandom() is available, as a fallback
when TLS is not enabled (and thus openssl is not used), and when not on
Win32 (where getting random numbers is always possible, at least from a
build perspective).

However, building with the plain Makefiles should keep working, so
slightly rework the defines checks in the code to account for the fact
that HAVE_GETRANDOM may already be defined at configure time.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
2026-02-25 08:27:42 +00:00
..
base64_common.c libcommon base64 unit tests 2025-12-01 00:05:36 +00:00
cjson_common.c
CMakeLists.txt libcommon: check for getrandom() 2026-02-25 08:27:42 +00:00
file_common.c Fix potential crash if group id has no group name. 2026-02-13 00:36:47 +00:00
linker.version Fix missing SONAME. 2026-02-13 11:21:28 +00:00
Makefile Fix missing SONAME. 2026-02-13 11:21:28 +00:00
memory_common.c
mqtt_common.c
password_common.c Fix build for WITH_TLS=no WITH_ARGON2=yes WITH_ASAN=yes 2026-02-05 10:43:39 +00:00
property_common.c
property_common.h Refactor property functions to common static library. 2024-03-17 20:56:14 +00:00
random_common.c libcommon: check for getrandom() 2026-02-25 08:27:42 +00:00
strings_common.c
time_common.c OpenBSD build fixes 2026-02-06 14:50:20 +00:00
topic_common.c
utf8_common.c