• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

man/H03-May-2022-11498

packaging/H27-Jun-2016-358262

src/H03-May-2022-3,3832,399

test/H03-May-2022-801566

.gitignoreH A D27-Jun-201692 107

COPYINGH A D27-Jun-201617.7 KiB340281

MakefileH A D27-Jun-2016953 3526

NEWSH A D27-Jun-20166.3 KiB131117

READMEH A D27-Jun-201621.6 KiB540384

README.OSXH A D27-Jun-20164.7 KiB13793

README.developersH A D27-Jun-20163.7 KiB10776

TODOH A D27-Jun-2016529 129

README

1      =======================================================
2             libfaketime, version 0.9.6 (June 2014)
3        (previously also known as FakeTime Preload Library)
4      =======================================================
5
6
7Content of this file:
8---------------------
9
101. Introduction
112. Compatibility issues
123. Installation
134. Usage
14   a) Basics
15   b) Using absolute dates
16   c) Using 'start at' dates
17   d) Using offsets for relative dates
18   e) Advanced features and caveats
19   f) Faking the date and time system-wide
20   g) Using the "faketime" wrapper script
21   h) "Limiting" libfaketime based on elapsed time or number of calls
22   i) "Limiting" libfaketime per process
23   j) Spawning an external process
24   k) Saving timestamps to file, loading them from file
255. License
266. Contact
27
28
29
301. Introduction
31---------------
32
33libfaketime intercepts various system calls which programs use to
34retrieve the current date and time. It can then report faked dates and times
35(as specified by you, the user) to these programs. This means you can modify
36the system time a program sees without having to change the time system-wide.
37
38libfaketime allows you to specify both absolute dates (e.g., 01/01/2004) and
39relative dates (e.g., 10 days ago).
40
41libfaketime might be used for various purposes, for example
42
43- running legacy software with y2k bugs
44- testing software for year-2038 compliance
45- debugging time-related issues, such as expired SSL certificates
46- running software which ceases to run outside a certain timeframe
47- using different system-wide date and time settings, e.g., on OpenVZ-
48  based virtual machines running on the same host
49- deterministic build processes.
50
51
52
532. Compatibility issues
54-----------------------
55
56* libfaketime has been designed on and for Linux, but is supposed and has been
57  reported to work on other *NIXes as well, including Mac OS X.
58
59* libfaketime uses the library preload mechanism and thus cannot work with
60  statically linked binaries or binaries that have the setuid-flag set (e.g.,
61  suidroot programs like "ping" or "passwd"). Please see you system linker's
62  manpage for further details (man ld).
63
64* As of version 0.7, support has been added for use in a pthreads environment. A
65  separate library is built (libfaketimeMT.so.1) which contains the pthread
66  synchronization calls. This library also single-threads calls through the
67  time() intercept, because several variables are statically cached by the
68  library and could cause issues when accessed without synchronization. However,
69  the performance penalty for this might be an issue for some applications. If
70  this is the case, you can try using an unsynchronized time() intercept by
71  removing the -DPTHREAD_SINGLETHREADED_TIME from the Makefile and rebuilding
72  libfaketimeMT.so.1 . Thanks to David North, TDI!
73
74* If and only if you want to run Java programs with faked times in the future
75  (not in the past) on Linux, you also should set the environment variable
76  LD_ASSUME_KERNEL=2.4.19 before running the appropriate "java" command. This
77  fixes an occasional bug where Java locks up at exiting. Again, this is only
78  required for Java with faked times in the future. Thanks to Jamie Cameron for
79  reporting this issue and finding a workaround!
80
81* libfaketime will eventually be bypassed by applications that dynamically load
82  system libraries, such as librt, explicitly themselves instead of relying on
83  the linker to do so at application start time. libfaketime will not work with
84  those applications unless you can modify them.
85
86* Applications can explicitly be designed to prevent libfaketime from working,
87  e.g., by checking whether certain environment variables are set or whether
88  libfaketime-specific files are present.
89
90
91
923. Installation
93---------------
94
95Running "make" should compile both library versions and a test program, which
96it then also executes.
97
98If the test works fine, you should copy the libfaketime libraries
99(libfaketime.so.1, and libfaketimeMT.so.1) to the place you want them in.
100Running "make install" will attempt to place them in /usr/local/lib/faketime
101and will install the wrapper shell script "faketime" in /usr/local/bin, both of
102which most likely will require root privileges; however, from a technical point
103of view, there is no necessity for a system-wide installation, so you can use
104libfaketime also on machines where you do not have root privileges. You may want
105to adjust the PREFIX variable in the Makefiles accordingly.
106
107By default, the Makefile compiles/links libfaketime for your default system
108architecture. If you need to build, e.g., 32-bit files on a 64-bit platform,
109please see the notes about CFLAGS and LDFLAGS in src/Makefile.
110
111Since version 0.6, system calls to file timestamps are also intercepted,
112thanks to a contribution by Philipp Hachtmann. This is especially useful in
113combination with relative time offsets as explained in section 4d) below, if a
114program writes and reads files whose timestamps also shall be faked. If you do
115not need this feature or if it confuses the application you want to use FTPL
116with, define the environment variable NO_FAKE_STAT, and the intercepted stat
117calls will be passed through unaltered.
118
119On OS X, it is necessary to compile differently, due to the different
120behavior dyld has. Use the Makefile provided to compile
121libfaketime.1.dylib. Additionally, instead of using LD_PRELOAD,
122the variable DYLD_INSERT_LIBRARIES should be set to the path to
123libfaketime.1.dylib, and the variable DYLD_FORCE_FLAT_NAMESPACE should be
124set (to anything). Mac OS X users should read README.OSX for additional
125details.
126
127
128
1294. Usage
130--------
131
1324a) Usage basics
133----------------
134
135Using libfaketime on a program of your choice consists of two steps:
136
1371. Making sure libfaketime gets loaded by the system's linker.
1382. Specify the faked time.
139
140
141As an example, we want the "date" command to report our faked time. To do so,
142we could use the following command line on Linux:
143
144user@host> date
145Tue Nov 23 12:01:05 CEST 2007
146
147user@host> LD_PRELOAD=/usr/local/lib/libfaketime.so.1 FAKETIME="-15d" date
148Mon Nov  8 12:01:12 CEST 2007
149
150
151The basic way of running any command/program with libfaketime enabled is to
152make sure the environment variable LD_PRELOAD contains the path and
153filename of the libfaketime library. This can either be done by setting it once
154beforehand:
155
156export LD_PRELOAD=/path/to/libfaketime.so.1
157(now run any command you want)
158
159
160Or it can be done by specifying it on the command line itself:
161
162LD_PRELOAD=/path/to/libfaketime.so.1 your_command_here
163
164(These examples are for the bash shell; how environment variables are set may
165vary on your system.)
166
167On Linux, library search paths can be set as part of the linker configuration.
168LD_PRELOAD then also works with relative paths. For example, when libfaketime.so.1
169is installed as /path/to/libfaketime.so.1, you can add /path/to to an appropriate
170linker configuration file, e.g., /etc/ld.so.conf.d/local.conf and then run
171the "ldconfig" command. Afterwards, using LD_PRELOAD=libfaketime.so.1 suffices.
172
173However, also the faked time should be specified; otherwise, libfaketime
174will be loaded, but just report the real system time. There are three
175ways to specify the faked time:
176
177a) By setting the environment variable FAKETIME.
178b) By using the file given in the environment variable FAKETIME_TIMESTAMP_FILE
179c) By using the file .faketimerc in your home directory.
180d) By using the file /etc/faketimerc for a system-wide default.
181
182If you want to use b) c) or d), $HOME/.faketimerc or /etc/faketimerc consist of
183only one line of text with exactly the same content as the FAKETIME environment
184variable, which is described below. Note that /etc/faketimerc will only be used
185if there is no $HOME/.faketimerc nor FAKETIME_TIMESTAMP_FILE file exists, and
186the FAKETIME environment variable always has priority over the files.
187
188
1894b) Using absolute dates
190------------------------
191
192The format which _must_ be used for _absolute_ dates is "YYYY-MM-DD hh:mm:ss".
193For example, the 24th of December, 2002, 8:30 PM would have to be specified as
194FAKETIME="2002-12-24 20:30:00".
195
196
1974c) Using 'start at' dates
198--------------------------
199
200(Thanks to a major contribution by David North, TDI in version 0.7)
201
202The format which _must_ be used for _start_at_ dates is "@YYYY-MM-DD hh:mm:ss".
203For example, the 24th of December, 2002, 8:30 PM would have to be specified as
204FAKETIME="@2002-12-24 20:30:00".
205
206The absolute dates described in 4b simulate a STOPPED system clock at the
207specified absolute time. The 'start at' format allows a 'relative' clock
208operation as described below in section 4d, but using a 'start at' time
209instead of an offset time.
210
211
2124d) Using offsets for relative dates
213------------------------------------
214
215Relative date offsets can be positive or negative, thus what you put into
216FAKETIME _must_ either start with a + or a -, followed by a number, and
217optionally followed by a multiplier:
218
219- by default, the offset you specify is in seconds. Example:
220
221  export FAKETIME="-120" will set the faked time 2 minutes (120 seconds) behind
222  the real time.
223
224- the multipliers "m", "h", "d" and "y" can be used to specify the offset in
225  minutes, hours, days and years (365 days each), respectively. Examples:
226
227  export FAKETIME="-10m" sets the faked time 10 minutes behind the real time.
228  export FAKETIME="+14d" sets the faked time to 14 days in the future.
229
230
231You now should understand the complete example we've used before:
232
233LD_PRELOAD=/usr/local/lib/libfaketime.so.1 FAKETIME="-15d" date
234
235This command line makes sure FTPL gets loaded and sets the faked time to
23615 days in the past.
237
238Moreno Baricevic has contributed support for the FAKETIME_FMT environment
239variable, which allows you to optionally set the strptime() format:
240
241Some simple examples:
242LD_PRELOAD=./libfaketime.so.1 FAKETIME_FMT=%s FAKETIME="`date +%s -d'1 year ago'`" date
243LD_PRELOAD=./libfaketime.so.1 FAKETIME_FMT=%s FAKETIME="`stat -c %Y somefile`" date
244LD_PRELOAD=./libfaketime.so.1 FAKETIME_FMT=%c FAKETIME="`date`" date
245
246
2474e) Advanced features and caveats
248---------------------------------
249
250Advanced time specification options:
251------------------------------------
252
253Since version 0.8, thanks to a contribution by Karl Chen, fractions can be used
254in the specification of time offsets. For example,
255
256FAKETIME="+1,5h"
257
258is equivalent to FAKETIME="+90m". Please be aware that the fraction delimiter
259depends on your locale settings, so actually you might need to use
260
261FAKETIME="+1.5h"
262
263You should figure out the proper delimiter, e.g. by using libfaketime on
264a command like /bin/date where you immediately can verify whether it worked as
265expected.
266
267Also contributed by Karl Chen in v0.8 is the option to speed up or slow
268down the wall clock time for the program which is executed using libfaketime.
269For example,
270
271FAKETIME="+1y x2"
272
273will set the faked time one year into the future and will make the clock run
274twice as fast. Similarly,
275
276FAKETIME="+1y x0,5"
277
278will make the clock run only half as fast. As stated above, the fraction
279delimiter depends on your locale.
280
281FAKETIME="+1y i2,0"
282
283will make the clock step two seconds per each time(), etc. call, running
284completely independently of the system clock. It helps running programs
285with some determinism. In this single case all spawned processes will use
286the same global clock without restarting it at the start of each process.
287
288For testing, your should run a command like
289
290LD_PRELOAD=./libfaketime.so.1 FAKETIME="+1,5y x10,0" \
291/bin/bash -c 'while true; do echo $SECONDS ; sleep 1 ; done'
292
293For each second that the endless loop sleeps, the executed bash shell will
294think that 10 seconds have passed ($SECONDS is a bash-internal variable
295measuring the time since the shell was started).
296
297(Please note that replacing "echo $SECONDS" e.g. with a call to "/bin/date"
298will not give the expected result, since /bin/date will always be started
299as a new process for which also FTPL will be re-initialized. It will show
300the correct offset (1.5 years in the future), but no speed-ups or
301slow-downs.)
302
303For applications that should use a different date & time each time they are
304run, consider using the included timeprivacy wrapper shellscript (contributed
305by adrelanos at riseup dot net).
306
307
308Caveats:
309--------
310
311Whenever possible, you should use relative offsets or 'start at' dates,
312and not use absolute dates.
313
314Why? Because the absolute date/time you set is fixed, i.e., if a program
315retrieves the current time, and retrieves the current time again 5
316minutes later, it will still get the same result twice. This is likely to break
317programs which measure the time passing by (e.g., a mail program which checks
318for new mail every X minutes).
319
320Using relative offsets or 'start at' dates solves this problem.
321libfaketime then will always report the faked time based on the real
322current time and the offset you've specified.
323
324Please also note that your default specification of the fake time is cached for
32510 seconds in order to enhance the library's performance. Thus, if you change the
326content of $HOME/.faketimerc or /etc/faketimerc while a program is running, it
327may take up to 10 seconds before the new fake time is applied. If this is a
328problem in your scenario, you can change number of seconds before the file is read
329again with environment variable FAKETIME_CACHE_DURATION, or disable caching at all
330with FAKETIME_NO_CACHE=1. Remember that disabling the cache may negatively
331influence the performance.
332
333
3344f) Faking the date and time system-wide
335----------------------------------------
336
337David Burley of SourceForge, Inc. reported an interesting use case of applying
338libfaketime system-wide: Currently, all virtual machines running inside
339an OpenVZ host have the same system date and time. In order to use multiple
340sandboxes with different system dates, the libfaketime library can be put into
341/etc/ld.so.preload; it will then be applied to all commands and programs
342automatically. This is of course best used with a system-wide /etc/faketimerc
343file. Kudos to SourceForge, Inc. for providing the patch!
344
345Caveat: If you run a virtual machine, its real-time clock might be reset to the
346real world date & time when you reboot. Depending on your FAKETIME setting,
347this may lead to side effects, such as forced file system checks on each reboot.
348System-wide faked time may also lead to unexpected side effects with software
349auto-update tools, if the offset between real world time and faked system time
350is too large. If in doubt, set your system's date to the faked time and try out
351whether everything still works as expected before applying libfaketime
352system-wide.
353
354
3554g) Using the "faketime" wrapper
356--------------------------------
357
358As of version 0.8, libfaketime provides a command named "faketime", which is
359placed into /usr/bin by "make install". It spares the hassle of setting
360the LD_PRELOAD and FAKETIME environment variables manually, but only exposes
361a subset of libfaketime's functionality. On the other hand, it uses the date
362interpretation function by /bin/date in order to provide higher flexibility
363regarding the specification of the faked date and time. For example, you
364can use
365
366faketime 'last Friday 5 pm' /your/command/here
367
368Of course, also absolute dates can be used, such as in
369
370faketime '2008-12-24 08:15:42' /bin/date
371
372Thanks to Daniel Kahn Gillmor for providing these suggestions!
373
374Balint Reczey has rewritten the wrapper in 0.9.5 from a simple shell script
375to an efficient wrapper application.
376
377
3784h) "Limiting" libfaketime based on elapsed time or number of calls
379--------------------------
380
381Starting with version 0.9, libfaketime can be configured to not be continuously
382active, but only during a certain time interval.
383
384For example, you might want to start a program with the real current time, but
385after 5 minutes of usage, you might want it to see a faked time, e.g., a year
386in the future.
387
388Dynamic changes to the faked time are alternatively possible by
389
390- changing the FAKETIME environment variable at run-time; this is the preferred
391  way if you use libfaketime for debugging and testing as a programmer, as it
392  gives you the most direct control of libfaketime without any performance
393  penalities.
394
395- not using the FAKETIME environment variable, but specifying the fake time in a
396  file (such as ~/.faketimerc). You can change the content of this file at
397  run-time. This works best with caching disabled (see Makefile), but comes at a
398  performance cost because this file has to be read and evaluated each time.
399
400The feature described here works based on two pairs of environment variables,
401
402  FAKETIME_START_AFTER_SECONDS and FAKETIME_STOP_AFTER_SECONDS, and
403  FAKETIME_START_AFTER_NUMCALLS and FAKETIME_STOP_AFTER_NUMCALLS
404
405The default value for each of these environment variables is -1, which means
406"ignore this value".
407
408If you want libfaketime to be only active during the run-time minutes 2 to 5
409of your application, you would set
410
411  FAKETIME_START_AFTER_SECONDS=60
412  FAKETIME_STOP_AFTER_SECONDS=300
413
414This means that your application will work with the real time from start (second
4150) up to second 60. It will then see a faked time from run-time seconds 60 to
416300 (minutes 2, 3, 4, and 5). After run-time second 600, it will again see the
417real (not-faked) time.
418
419This approach is not as flexible as changing the FAKETIME environment variable
420during runtime, but may be easier to use, works on a per-program (and not a
421per-user or system-wide) scope, and has only a minor performance overhead.
422
423Using the other pair of environment variables, you can limit the activity time
424of libfaketime not based on wall-clock seconds, but on the number of
425time-related function calls the started program performs. This alternative is
426probably only suitable for programmers who either know the code of the program
427in order to determine useful start/stop values or want to perform fuzzing
428tests.
429
430Both pairs of environment variables can be combined to further restrict
431libfaketime activity, although this is only useful in very few scenarios.
432
433Limiting libfaketime activity in this way is not recommended in general. Many
434programs will break when they are subject to sudden changes in time, especially
435if they are started using the current (real) time and are then sent back into
436the past after, e.g., 5 minutes. For example, they may appear to be frozen or
437stuck because they are waiting until a certain point in time that, however, is
438never reached due to the delayed libfaketime activity. Avoid using this
439functionality unless you are sure you really need it and know what you are
440doing.
441
442
4434i) "Limiting" libfaketime per process
444--------------------------------------
445
446Faketime can be instructed to fake time related calls only for selected
447commands or to fake time for each command except for a certain subset of
448commands.
449
450The environment variables are FAKETIME_ONLY_CMDS and FAKETIME_SKIP_CMDS
451respectively.
452
453Example:
454    FAKETIME_ONLY_CMDS=javadoc faketime '2008-12-24 08:15:42' make
455will run the "make" command but the time faking will only be applied
456to javadoc processes.
457
458Multiple commands are separated by commas.
459
460Example:
461    FAKETIME_SKIP_CMDS="javadoc,ctags" faketime '2008-12-24 08:15:42' make
462will run the "make" command and apply time faking for everything "make"
463does except for javadoc and ctags processes.
464
465FAKETIME_ONLY_CMDS and FAKETIME_SKIP_CMDS are mutually exclusive, i.e.,
466you cannot set them both at the same time. Faketime will terminate with
467an error message if both environment variables are set.
468
469
4704j) Spawning an external process
471--------------------------------
472
473From version 0.9 on, libfaketime can execute a shell command once after an
474arbitrary number of seconds or number of time-related system calls of the
475program started. This has two limitations one needs to be aware of:
476
477* Spawning the external process happens during a time-related system call
478  of the original program. If you want the external process to be started
479  5 seconds after program start, but this program does not make any time-
480  related system calls before run-time second 8, the start of your external
481  process will be delayed until run-time second 8.
482
483* The original program is blocked until the external process is finished,
484  because the intercepting time-related system call will not return earlier. If
485  you need to start a long-running external process, make sure it forks into the
486  background.
487
488Spawning the external process is controlled using three environment variables:
489FAKETIME_SPAWN_TARGET, FAKETIME_SPAWN_SECONDS, FAKETIME_SPAWN_NUMCALLS.
490
491Example (using bash on Linux):
492
493(... usual libfaketime setup here, setting LD_PRELOAD and FAKETIME ...)
494export FAKETIME_SPAWN_TARGET="/bin/echo 'Hello world'"
495export FAKETIME_SPAWN_SECONDS=5
496/opt/local/bin/myprogram
497
498This will run the "echo" command with the given parameter during the first
499time-related system function call that "myprogram" performs after running for 5
500seconds.
501
502
5034k) Saving timestamps to file, loading them from file
504-----------------------------------------------------
505
506Faketime can save faked timestamps to a file specified by FAKETIME_SAVE_FILE
507environment variable. It can also use the file specified by FAKETIME_LOAD_FILE
508to replay timestamps from it. After consuming the whole file, libfaketime
509returns to using the rule set in FAKETIME variable, but the timestamp processes
510will start counting from will be the last timestamp in the file.
511
512The file stores each timestamp in a stream of saved_timestamp structs
513without any metadata or padding:
514
515/* Storage format for timestamps written to file. Big endian. */
516struct saved_timestamp {
517  int64_t sec;
518  uint64_t nsec;
519};
520
521Faketime needs to be run using the faketime wrapper to use these files. This
522functionality has been added by Balint Reczey in v0.9.5.
523
524
5255. License
526----------
527
528libfaketime has been released under the GNU General Public License, GPL.
529Please see the included COPYING file.
530
531
5326. Contact
533-----------
534
535Bug reports, feature suggestions, success reports, and patches/pull
536requests are highly appreciated:
537
538            https://github.com/wolfcw/libfaketime
539
540

README.OSX

1README file for libfaketime on Mac OS X
2=======================================
3
4Support for Mac OS X has meanwhile matured and many command line and
5GUI applications will run stable.
6
7Developments and tests are done on OSX 10.8+ currently, although the
8current version will also work with OSX 10.7.
9
10Version 0.9.5 and higher no longer works with OSX <= 10.6 due to
11changes in the underlying system libraries. If you need libfaketime
12on OSX <= 10.6, please use libfaketime version 0.9.
13
14
15Installing and using libfaketime on OS X is slightly different than
16on Linux. Please make sure to read the README file for general
17setup and usage, and refer to this file only about OS X specifics.
18
19
201) Installing libfaketime on OS X
21---------------------------------
22
23If you use MacPorts, libfaketime can be installed on the command line
24as follows:
25
26    sudo port install libfaketime
27
28Or, if you use Fink, install using:
29
30    fink install libfaketime
31
32Or, if you use Homebrew, install using:
33
34    brew install libfaketime
35
36Otherwise, you have to compile and install libfaketime manually; this
37will require a working installation of Xcode and its command line tools
38on your machine.
39
40You can compile libfaketime by running the command
41
42    make
43
44in libfaketime's top-level directory.
45
46The resulting library will be named libfaketime.1.dylib ; to check
47whether it works properly, run the test suite and verify whether its
48output is correct:
49
50    cd test
51    make -f Makefile.OSX
52
53
542) Using libfaketime from the command line on OS X
55--------------------------------------------------
56
57You will need to set three environment variables. In a Terminal.app
58or iTerm2 session, the following commands can be used:
59
60export DYLD_FORCE_FLAT_NAMESPACE=1
61export DYLD_INSERT_LIBRARIES=/path/to/libfaketime.1.dylib
62export FAKETIME="your favorite faketime-spec here"
63
64Please refer to the general README file concerning the format
65of the FAKETIME environment variable value and other environment
66variables that are related to it.
67
68The "faketime" wrapper application has been adapted to OS X;
69it offers the same limited libfaketime functionality as on Linux
70in a simple-to-use manner without the need to manually set
71those environment variables. Run "faketime" without parameters
72for help and use "man faketime" for details.
73
74
753) Integrating libfaketime with applications
76--------------------------------------------
77
78Given the limited number of system calls libfaketime intercepts,
79it may not work too well with specific GUI applications on OS X.
80This can result in crashes after a seemingly random time, or an
81application will not or at least not always see the faked time,
82and so on.
83
84A safe way to try out whether a specific application works fine
85with libfaketime is to start it from the command line. Perform
86the steps outlined above and run the application by issuing the
87following command:
88
89/Applications/ApplicationName.app/Contents/MacOS/ApplicationName
90
91(Make sure to replace "ApplicationName" twice in that command with
92the name of your actual application.)
93
94If it works fine, you can configure the application to permanently
95run with libfaketime by editing its Info.plist file. Add the
96LSEnvironment key unless it is already there and add a dictionary
97with the three keys like this:
98
99    <key>LSEnvironment</key>
100    <dict>
101        <key>DYLD_FORCE_FLAT_NAMESPACE</key>
102        <string>1</string>
103        <key>DYLD_INSERT_LIBRARIES</key>
104        <string>/path/to/libfaketime.1.dylib</string>
105        <key>FAKETIME</key>
106        <string>value of FAKETIME here</string>
107    </dict>
108
109(If the application is installed in /Applications instead of in
110$HOME/Applications, you eventually will need root privileges. If
111the application's Info.plist is not in XML, but in binary format,
112use appropriate editing or conversion tools.)
113
114Afterwards, you will probably need to run
115
116    /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/ApplicationName.app
117
118to make sure the change to Info.plist does not go unnoticed.
119
120Please note that modifications to Info.plist will be lost when the
121application is updated, so this process needs to be repeated after
122such updates, including own new builds when using Xcode.
123
124Please feel free to report non-working applications on the Github
125libfaketime issues website. This may help us to identify further
126time-related system calls that need to be intercepted on OS X.
127
128    https://github.com/wolfcw/libfaketime/issues
129
130
1314) Notes for developers of OS X applications
132--------------------------------------------
133
134The environment variable FAKETIME can be changed at application run-time
135and always takes precedence over other user-controlled settings. It can
136be re-set to 0 (zero) to work around potential incompatibilities.
137

README.developers

1This file contains information for libfaketime developers and contributors.
2
3
4GENERAL
5=======
6
7Starting with libfaketime v0.9.5, development and issue handling is
8completely done via Github:
9
10	https://github.com/wolfcw/libfaketime
11
12- Official releases are tagged.
13- Code contributions and bugfixes are merged into the "development" branch,
14  which is considered unstable and may contain code that is not yet fully
15  tested.
16- The "master" branch is updated with tested code only; it is ensured that
17  it compiles and works cleanly at least on current Linux and OS X systems.
18
19Code contributions are highly welcome, preferably via pull requests on Github.
20
21
22CODE STYLE
23==========
24
25Please try to stick to the following code formatting style guidelines:
26
27- No tabs, only spaces for indentation.
28- Avoid trailing whitespace.
29- Indentation is 2 spaces for each level.
30- Opening and closing curly brackets have to be on lines of their own.
31- Use under_score_names for function and variable names; avoid using camelCase.
32- // and /*...*/ style comments may and shall be used.
33
34Example:
35
36/* This function will do nothing */
37void do_nothing(int how_often)
38{
39  int counter;
40  for (counter = 0; counter < how_often; counter++)
41  {
42    counter = counter; // our do-nothing algorithm
43  }
44}
45
46- Use -DDEBUG and #ifdef DEBUG for development and testing. Avoid printing
47  to stdout or stderr outside "#ifdef DEBUG"; if it is necessary to inform
48  the user a run-time, prefix your output with "faketime" or make otherwise
49  sure that the user knows where the message is coming from.
50
51- If you add new functions to libfaketime.c, try placing them somewhere
52  where they fit will: Usually, functions are grouped by functionality
53  (e.g., all functions related to faking file timestamps). If that's not
54  possible, group them by contributor, or document your placement strategy
55  in the commit message.
56
57
58DEVELOPMENT, BUILDING, AND TESTING
59==================================
60
61- Don't break existing behaviour. Backward compatibility matters (unless
62  the modification fixes bugs :-)).
63
64- Add tests for new features. Extend test/timetest.c appropriately and
65  try to use the functional testing framework wherever possible.
66
67- Compiler and linker warnings are treated as errors and not acceptable.
68
69- If you cannot test the code on both Linux and OS X yourself, please
70  let us know and consider wrapping your code in #ifdef / #ifndef __APPLE__
71  statements.
72
73
74DOCUMENTATION
75=============
76
77For anything more than small bugfixes, please update the user documentation
78and credits appropriately:
79
80- The NEWS file should mention the change and your credits.
81- The README and README.OSX files should be updated whenever functionality
82  is added or modified.
83- The manpage man/faketime.1 should be updated when the wrapper application
84  is modified.
85
86For credits, please either mention your real name, your Github username, or
87your email address.
88
89In your own interest, please be verbose on user documentation and comments
90in the source code. Users will not know about new features unless they are
91documented. Other authors and maintainers will need to understand your code
92easily.
93
94
95RELEASES
96========
97
98Official new releases are created whenever a significant amount of changes
99(bugfixes or new functionality) has piled up; on average, there is one new
100official release per year. Users who need to stick to the bleeding edge
101are supposed to use the current state of the "master" branch at any time.
102
103libfaketime maintainers for several Linux distributions are informed about
104release candidates and new releases by email. Contact wolfcw on Github if
105you are interested in receiving notifications, or use Github functionality
106to get informed about updates.
107