diff --git a/profiles/osapi/linux.h b/profiles/osapi/linux.h
index 54d5142..38893ec 100644
--- a/profiles/osapi/linux.h
+++ b/profiles/osapi/linux.h
@@ -6,7 +6,6 @@
 
 /* interfaces */
 #define HAVE_EPOLL                      1
-#define HAVE_GETRANDOM_SYSCALL          1
 #define HAVE_LINUX_CAN_RAW_FD_FRAMES    1
 #define HAVE_SOCKADDR_ALG               1
 
diff --git a/profiles/osapi/midipix.h b/profiles/osapi/midipix.h
index 90bf421..0c3300a 100644
--- a/profiles/osapi/midipix.h
+++ b/profiles/osapi/midipix.h
@@ -6,9 +6,6 @@
 #define HAVE_DIRENT_H                   1
 #define HAVE_NETPACKET_PACKET_H         1
 
-/* interfaces */
-#define HAVE_GETRANDOM_SYSCALL          1
-
 /* os characteristics */
 #define RETSIGTYPE                      void
 #define SHLIB_EXT                       ".so"
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index 750de3a..a94a143 100644
--- a/project/config/cfgdefs.sh
+++ b/project/config/cfgdefs.sh
@@ -105,6 +105,15 @@ cfgdefs_perform_common_tests()
 	mb_cfgtest_headers='sys/sendfile.h'
 	cfgtest_interface_presence 'sendfile'
 
+	# getrandom: easier to simply test,
+	# than to test whether we need to test
+	# (and then test).
+	mb_cfgtest_headers='sys/syscall.h'
+
+	if cfgtest_decl_presence 'SYS_getrandom'; then
+		cfgtest_cflags_append '-DHAVE_GETRANDOM_SYSCALL'
+	fi
+
 	# ncurses: python refers to members of typedef struct _win_st WINDOW
 	cfgtest_cflags_append '-DNCURSES_INTERNALS'