The following execution does not work.
LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1 FAKETIME_TIMESTAMP_FILE=my-faketime.rc FAKETIME_NO_CACHE=1 .test_faketime
where my-faketime.rc is:
2020-12-24 20:30:00
The code is the same as in the previous execution.
I find this weird, because getting the time with boost, which does not use a syscall, works in both cases.
I have compiled libfaketime with INTERCEPT_SYSCALL.
The following execution works. LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1 FAKETIME="2020-12-24 20:30:00" .test_faketime
The code is:
`#include
include
int main() { const auto today = std::chrono::system_clock::now(); const time_t tt = std::chrono::system_clock::to_time_t( today ); std::cout << "now: " << ctime(&tt) << std::endl; return 0; }`
The following execution does not work. LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1 FAKETIME_TIMESTAMP_FILE=my-faketime.rc FAKETIME_NO_CACHE=1 .test_faketime where my-faketime.rc is: 2020-12-24 20:30:00
The code is the same as in the previous execution.
I find this weird, because getting the time with boost, which does not use a syscall, works in both cases.