mirror of
https://github.com/wolfcw/libfaketime.git
synced 2026-05-17 00:26:16 +03:00
Include a check for getentropy interception
This snippet applies to both the library constructors and variable data test frameworks.
This commit is contained in:
6
test/snippets/getentropy.c
Normal file
6
test/snippets/getentropy.c
Normal file
@@ -0,0 +1,6 @@
|
||||
unsigned int targ;
|
||||
if (getentropy(&targ, sizeof(targ)) == 0) {
|
||||
printf("[%s] getentropy() yielded 0x%08x\n", where, targ);
|
||||
} else {
|
||||
printf("[%s] getentropy() failed with %d (%s)\n", where, errno, strerror(errno));
|
||||
}
|
||||
1
test/snippets/getentropy.variable
Normal file
1
test/snippets/getentropy.variable
Normal file
@@ -0,0 +1 @@
|
||||
FAKERANDOM_SEED 0x0123456789ABCDEF
|
||||
@@ -3,3 +3,5 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/random.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
Reference in New Issue
Block a user