#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <linux/random.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
int main(void) {
int random_fd = -1;
int current = 0;
random_fd = open("/dev/random", O_RDWR);
if (random_fd == -1) {
perror("open(...)");
exit(1);
}
if (ioctl(random_fd, RNDGETENTCNT, ¤t) == -1) {
perror("ioctl(...)");
exit(1);
}
printf("%d\n", current);
}