summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorWolfgang Hommel <wolf@code-wizards.com>2013-08-22 06:53:12 -0700
committerWolfgang Hommel <wolf@code-wizards.com>2013-08-22 06:53:12 -0700
commit2dceb574acf96474e9d157c19c260bde4f825d19 (patch)
tree2bf2126b619dfb94f2214147b9605374883d5c64 /README
parenta0e33461a0cd92d916bbcdbfcdee4574411aee93 (diff)
parentb84e76ccf8912879ee5e2a2e9b82c0f2d154a469 (diff)
downloadlibfaketime-2dceb574acf96474e9d157c19c260bde4f825d19.tar.gz
Merge pull request #22 from tonigi/master
Libfaketime patch: process-shared "start at"
Diffstat (limited to 'README')
-rw-r--r--README27
1 files changed, 23 insertions, 4 deletions
diff --git a/README b/README
index 05fdafa..63cfba9 100644
--- a/README
+++ b/README
@@ -171,15 +171,34 @@ FAKETIME="2002-12-24 20:30:00".
(Thanks to a major contribution by David North, TDI in version 0.7)
-The format which _must_ be used for _start_at_ dates is "@YYYY-MM-DD hh:mm:ss".
-For example, the 24th of December, 2002, 8:30 PM would have to be specified as
-FAKETIME="@2002-12-24 20:30:00".
-
The absolute dates described in 4b simulate a STOPPED system clock at the
specified absolute time. The 'start at' format allows a 'relative' clock
operation as described below in section 4d, but using a 'start at' time
instead of an offset time.
+There are two subtypes of 'start at' dates, namely "@YYYY-MM-DD
+hh:mm:ss" and "^YYYY-MM-DD hh:mm:ss". The date *must* be written as
+indicated (see example below).
+
+The 'at' and 'caret' specifications differ with respect to what
+happens when subprocesses are spawned: with @ each subprocess "sees"
+the same faked starting time, regardless of the time at which it was
+spawned; the caret, instead, creates a single shared clock for the
+process group. The caret requires the use of the "faketime" wrapper.
+
+For example (24th of December, 2002, 8:30 PM)
+
+ faketime -f '@2002-12-24 20:30:00' /bin/bash -c 'date; sleep 2; date'
+
+will print the same time twice, because each invocation of the
+"date" command sees its own independent faked clock, while
+
+ faketime -f '^2002-12-24 20:30:00' /bin/bash -c 'date; sleep 2; date'
+
+will show dates 2 seconds apart because the two processes share a
+single faked clock.
+
+
4d) Using offsets for relative dates
------------------------------------