Replace gettimeofday with clock_gettime (#2159)

This commit is contained in:
carpintero-de-c
2024-07-14 03:55:58 +05:30
committed by GitHub
parent 3f26818d97
commit 7c380a6612
8 changed files with 50 additions and 51 deletions

View File

@ -555,8 +555,7 @@ int main(int argc, char **argv_orig, char **envp) {
char *frida_afl_preload = NULL;
char **use_argv;
struct timeval tv;
struct timezone tz;
struct timespec spec;
doc_path = access(DOC_PATH, F_OK) != 0 ? (u8 *)"docs" : (u8 *)DOC_PATH;
@ -603,8 +602,8 @@ int main(int argc, char **argv_orig, char **envp) {
SAYF(cCYA "afl-fuzz" VERSION cRST
" based on afl by Michal Zalewski and a large online community\n");
gettimeofday(&tv, &tz);
rand_set_seed(afl, tv.tv_sec ^ tv.tv_usec ^ getpid());
clock_gettime(CLOCK_REALTIME, &spec);
rand_set_seed(afl, spec.tv_sec ^ spec.tv_nsec ^ getpid());
afl->shmem_testcase_mode = 1; // we always try to perform shmem fuzzing