mirror of
https://github.com/wolfcw/libfaketime.git
synced 2026-05-17 00:26:16 +03:00
Interpose gettimeofday64
This commit is contained in:
@@ -171,6 +171,13 @@ struct __timespec64
|
||||
uint32_t tv_nsec; /* this is 32-bit, apparently! */
|
||||
};
|
||||
|
||||
/* __timespec64 is needed for clock_gettime64 on 32-bit architectures */
|
||||
struct __timeval64
|
||||
{
|
||||
uint64_t tv_sec; /* Seconds */
|
||||
uint64_t tv_usec; /* this is 64-bit, apparently! */
|
||||
};
|
||||
|
||||
/*
|
||||
* Per thread variable, which we turn on inside real_* calls to avoid modifying
|
||||
* time multiple times of for the whole process to prevent faking time
|
||||
@@ -2437,6 +2444,18 @@ int __clock_gettime64(clockid_t clk_id, struct __timespec64 *tp64)
|
||||
return result;
|
||||
}
|
||||
|
||||
/* this is used by 32-bit architectures only */
|
||||
int __gettimeofday64(struct __timeval64 *tv64, void *tz)
|
||||
{
|
||||
struct timeval tv;
|
||||
int result;
|
||||
|
||||
result = gettimeofday(&tv, tz);
|
||||
tv64->tv_sec = tv.tv_sec;
|
||||
tv64->tv_usec = tv.tv_usec;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* this is used by 32-bit architectures only */
|
||||
uint64_t __time64(uint64_t *write_out)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user