add a specific configure check for sys/random.h (closes #28932)
diff --git a/Python/random.c b/Python/random.c
index 2f83b5d..08b2a99 100644
--- a/Python/random.c
+++ b/Python/random.c
@@ -3,7 +3,7 @@
 #include <windows.h>
 #else
 #include <fcntl.h>
-#if defined(HAVE_GETRANDOM) || defined(HAVE_GETENTROPY)
+#ifdef HAVE_SYS_RANDOM_H
 #include <sys/random.h>
 #endif
 #endif