In case the clock is set to advance with each faked time(), etc. call, the
counter uses the same clock counter stored in shared memory and protected
by a semaphore.
Used (emacs) M-x untabify for whole faketime.c as the prevailing
style in that file used spaces for indentation.
Used M-x delete-trailing-whitespace to all files that had either
trailing whitespace or empty lines at the end of file to remove
those.
This feature makes libfaketime execute an arbitrary system
command, such as a shell script, after a program has been
running for X seconds or has made Y time-related function
calls.
It is controlled by three environment variables.
FAKETIME_SPAWN_TARGET is the full path + file name +
command line arguments to the user-specified system
command.
FAKETIME_SPAWN_SECONDS is the number of seconds (after
program start / program's first time function call) after
which FAKETIME_SPAWN_TARGET will be executed.
FAKETIME_SPAWN_NUMCALLS can be used as an alternative
to ..._SECONDS.
These changes add a new feature that can be used to limit
libfaketime's activity period, and prepares for the upcoming
0.9 release.
Four new environment variables can optionally be set:
FAKETIME_START_AFTER_SECONDS, FAKETIME_STOP_AFTER_SECONDS,
FAKETIME_START_AFTER_NUMCALLS, and FAKETIME_START_AFTER_NUMCALLS.
libfaketime will only return faked timestamps if the program's
runtime is between FAKETIME_START_AFTER_SECONDS and
FAKETIME_STOP_AFTER_SECONDS seconds. For example, a program
may be started with the real current time, and after 60
seconds, it will start to receive faked timestamps, e.g.,
one year in the future. The other pair of environment
variables limits libfaketime's activity based on the number
of time-related system calls of the started program,
instead of its run-time in seconds.
Using this new feature will break applications that cannot
handle larger sudden changes in timestamps, so use it with
care.
port libfaketime to macos and dyld.
1) _ftpl_time calls gettimeofday since real time() does so. needed
to avoid double adjustment.
2) reduce call stack: use time tptr and call fake_time instead of
calling time for faking other time calls.
3) provide MacOS makefile and README notes.
4) make posix realtime calls under ifdef; define for base port but not
MacOS.