Re: faking time

From: Theodore Tso (tytso@mit.edu)
Date: Mon Feb 11 2002 - 22:47:23 EST


On Mon, Feb 11, 2002 at 11:49:39AM +0000, SA products wrote:
>
> Dear Kernel list,
>
> I want to fake the time returned by the time() system call so that
> for a limited number of user space programs the time can be set to
> the future or the past without affecting other applications and
> without affecting system time-- Ideally I would like to install a
> loadable module to accomplish this- Any hints ? Any starting points?

Here's an LD_PRELOAD shared library that will do the trick... just
export the environment variable FAKETIME with the time that you'd
like, and then export the LD_PRELOAD environment variable to point
that the faketime.so library, and then execute your program. All
programs that have these two environment variables set will have their
time faked out accordingly.

                                                        - Ted





-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:00:46 EST