Skip to content

Commit

Permalink
Merge pull request wolfcw#415 from usertam/master
Browse files Browse the repository at this point in the history
libfaketime.c: wrap timespec_get in TIME_UTC macro
  • Loading branch information
wolfcw authored Dec 20, 2022
2 parents df8a045 + e0e6b79 commit de37190
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libfaketime.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ static time_t (*real_time) (time_t *);
static int (*real_ftime) (struct timeb *);
static int (*real_gettimeofday) (struct timeval *, void *);
static int (*real_clock_gettime) (clockid_t clk_id, struct timespec *tp);
#ifdef TIME_UTC
static int (*real_timespec_get) (struct timespec *ts, int base);
#endif
#ifdef FAKE_INTERNAL_CALLS
static int (*real___ftime) (struct timeb *);
static int (*real___gettimeofday) (struct timeval *, void *);
Expand Down Expand Up @@ -2441,6 +2443,7 @@ int clock_gettime(clockid_t clk_id, struct timespec *tp)
}


#ifdef TIME_UTC
#ifdef MACOS_DYLD_INTERPOSE
int macos_timespec_get(struct timespec *ts, int base)
#else
Expand Down Expand Up @@ -2475,6 +2478,7 @@ int timespec_get(struct timespec *ts, int base)
/* return the result to the caller */
return result;
}
#endif


/*
Expand Down Expand Up @@ -2681,7 +2685,9 @@ static void ftpl_init(void)
real_lxstat64 = dlsym(RTLD_NEXT, "__lxstat64");
real_time = dlsym(RTLD_NEXT, "time");
real_ftime = dlsym(RTLD_NEXT, "ftime");
#ifdef TIME_UTC
real_timespec_get = dlsym(RTLD_NEXT, "timespec_get");
#endif
#ifdef FAKE_FILE_TIMESTAMPS
real_utimes = dlsym(RTLD_NEXT, "utimes");
real_utime = dlsym(RTLD_NEXT, "utime");
Expand Down Expand Up @@ -4163,7 +4169,9 @@ void do_macos_dyld_interpose(void) {
DYLD_INTERPOSE(macos_nanosleep, nanosleep);
DYLD_INTERPOSE(macos_poll, poll);
#endif
#ifdef TIME_UTC
DYLD_INTERPOSE(macos_timespec_get, timespec_get);
#endif
DYLD_INTERPOSE(macos_select, select);
#ifdef FAKE_RANDOM
DYLD_INTERPOSE(macos_getentropy, getentropy);
Expand Down

0 comments on commit de37190

Please sign in to comment.