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.
- Changed interception of internal syscalls on OSX
and malloc arena treatment
- Adapted the faketime wrapper shell script to set
the appropriate environment variables on OSX and
use gdate instead of date
- Added README.OSX to explain the OSX-specific
aspects of compiling and using libfaketime
* Move "COPYING" and "Changelog" from "meta/" to the top-level source
directory. No need to have a separate directory for two small text
files. Also, it's common practice to put these there.
* Makefile: Merge "meta/Makefile".
* Rename "Changelog" to "NEWS". The file containing a summary of changes
between two releases in generally called "NEWS". The name "ChangeLog"
should only be used for a detailed log of every commit.
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
needed to avoid a malloc recursion; dyld calls the libSystem
initializer, which calls malloc as the first caller; that uses
the arc4 randomizer, which calls gettimeofday... the call to fake_time
calls strptime_l, _strptime0, gmtsub, and boom, back at malloc.
pass one gettimeofday call to let the malloc succeed.
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.
Add "-f" option to gzip(1) invocation to avoid user prompts if
compressed man pages already exist in the target directory.
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
* Create separate "install" and "uninstall" targets for meta files.
* Add meta file targets to the shortcut Makefile.
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
* Create separate "install" and "uninstall" targets for man pages.
* Add man page targets to the shortcut Makefile.
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
* Use variables for compiler and linker flags.
* Use variables for source/object files and binaries.
* Use proper targets instead of phony targets to build the timetest
program.
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
* Use variables for compiler and linker flags.
* Use variables for source/object files, library names and sonames.
* Use proper targets instead of phony targets to build the shared
libraries.
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
* Move test suite related stuff from "src/" to "test/".
* Fix "test.sh" to search for libfaketime libraries in the right place.
* Split up Makefile into two separate Makefiles (one for the main
program and one for the test suite).
Test cases should go in another directory for the sake of clean code
separation. This will also facilitate the creation of proper Makefiles.
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
This is especially advantageous if libfaketime is built from source as
there isn't another convenient way to do a clean uninstall.
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
This is a standard used by almost all open source projects and allows
installing to different locations than the default location (which is
especially useful for packagers, e.g.) Switch to installing to
"/usr/local" by default, also. "/usr" should never be used as default
prefix.
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>