by ForkMeOnTinder · 2y ago · 0 comments
Most of the time usage need to advance time in controlled fashion. So you'll need to create a shell wrapper that runs faketime with correct FAKETIME_TIMESTAMP_FILE value, hook it up to your build system, create C++ wrapper to write to this file... If you are controlling source code, adding a "time" argument might be easier to implement and easier to understand.
My library modifies the code for the time-related vDSO functions, which is incredibly sketchy yet effective. There are also Python bindings at [1].