]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: wrap ADD_SYSCALL for getrandom in test for SYS_getrandom
authorR. Andrew Bailey <bailey@akamai.com>
Thu, 14 Feb 2019 14:38:33 +0000 (09:38 -0500)
committerR. Andrew Bailey <bailey@akamai.com>
Thu, 14 Feb 2019 17:04:35 +0000 (12:04 -0500)
Signed-off-by: R. Andrew Bailey <bailey@akamai.com>
tests/seccomp.c

index b68fcd7efabf80bc58621fe3c9de257c59636154..466f7db740e6e503fb910798d2416cd3fc28a5f2 100644 (file)
@@ -26,6 +26,9 @@
 #include <seccomp.h>
 #include <errno.h>
 #include <string.h>
+#if defined(__linux__)
+#  include <sys/syscall.h>
+#endif
 
 int disable_system_calls(void)
 {
@@ -70,7 +73,9 @@ int disable_system_calls(void)
 
        /* to read from /dev/urandom */
        ADD_SYSCALL(read, 0);
+#ifdef SYS_getrandom
        ADD_SYSCALL(getrandom, 0);
+#endif
 
        /* we use it in select */
        ADD_SYSCALL(sigprocmask, 0);