1 2 3 4 5 6 7 8 9 10 11 12
#include <stdio.h> #include <sys/random.h> int main(void) { int x; getrandom(&x, sizeof(typeof(x)), 0); printf("Random number from the kernel: %d\n", x); return 0; }