[prev in list] [next in list] [prev in thread] [next in thread]
List: novalug
Subject: Re: clock shell to run an application a year earlier?
From: Peter Teuben <teuben () astro ! umd ! edu>
Date: 2000-10-31 22:00:35
[Download RAW message or body]
there is something available publicly. Essentially you can do it yourself
too, by writing a replacement for time(2) [or whichever kernel function
you need], compile it, make it a shared object, and add this file to your
LD_LIBRARY_PATH environment in the shell where your timed application
needs to run. But after I learned about this trick, i later saw it
announced, maybe it was freshmeat or so.
ah, just found it again, it's called "timefake"
http://www.trier.linux.de/lpac/index.php?show=41
I've attached the one I must have been using long time ago
On Tue, 31 Oct 2000, Jameson C. Burt wrote:
> Occasionally, I want to run an appliation so that it receives clock responses
> changed to one year earlier.
> However, I would rather the rest of my system worked
> with the correct clock time (ie, I do not want to change the system clock).
> Is there some shell, some intercept, ... with which I might
> run an application that will receive a different clock setting?
>
> I wanted to do this a year ago, when setting up some public software
> (StarOffice?) whose full configuration took a few hours,
> only to see the software expire two months later.
>
["timefake.c" (TEXT/PLAIN)]
#include <sys/types.h>
#include <time.h>
/* to get the right number, simply get it via the
date +%s
command, and/or adjust to what you need. Also handy
may be the clock command, to write a new system time
after it has been set with date. However, this can
upset other things on your machine.
*/
#ifndef faketime
/* 5 dec 1999, 21:00 -- for mathematica ?? */
/* 944445600 */
#define faketime 931482192
/* 8 July 1999, 21:00 - for IDL ?? */
/* 931482192 */
#endif
time_t time(time_t *loc)
{
if (loc) *loc = faketime;
return faketime;
}
#if 1
int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue)
{
printf("Sorry, faking out setitimer for IDL\n");
return 0;
}
#endif
/*
solaris:
cc -G -o libtimefake.so libtimefake.c
linux, freeBSD:
cc -shared -o libtimefake.so libtimefake.c
*/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic