summaryrefslogtreecommitdiff
path: root/src/sysdeps/trygetrandom.c
blob: a9f03d11f1697f2837c2742804d1360b09921086 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* ISC license. */

#include <features.h>

#ifdef __stub_getrandom
#error getrandom() appears to be a stub function, we won't use it.
#endif

#include <sys/random.h>

int main (void)
{
  char buf[4] ;
  if (getrandom(buf, 4, GRND_NONBLOCK) < 0) return 1 ;
  return 0 ;
}