1 // RUN: %clang -O2 %s -o %t && %run %t
2 // UNSUPPORTED: android, darwin, target={{.*(netbsd|solaris).*}}
8 #if !defined(__GLIBC_PREREQ)
9 #define __GLIBC_PREREQ(a, b) 0
12 #if (defined(__linux__) && __GLIBC_PREREQ(2, 25)) || defined(__FreeBSD__) || \
13 (defined(__sun) && defined(__svr4__))
17 #if defined(HAS_GETRANDOM)
18 #include <sys/random.h>
24 #if defined(HAS_GETRANDOM)
25 n
= getrandom(buf
, sizeof(buf
), 0);
26 if (n
== -1 && errno
== ENOSYS
)