libfaketime icon indicating copy to clipboard operation
libfaketime copied to clipboard

faketime would change the system tick time to unix timestamp ?

Open mrmgxxxx opened this issue 2 years ago • 3 comments

my a.out which is a simple test tools, it could show the local CLOCK_MONOTONIC time, and it works like:

image

but I run the faketime command, the tick CLOCK_MONOTONIC time would be changed to unix timestamp,

image

Is that a problem or did I miss the applicable instructions?

mrmgxxxx avatar Nov 13 '23 06:11 mrmgxxxx

a.out code:

#include <stdio.h>
#include <time.h>

int main() 
{
    struct timespec current_time;

    clock_gettime(CLOCK_MONOTONIC, &current_time);

    printf("Current tick time: %lld.%09ld seconds since epoch\n", (long long)current_time.tv_sec, current_time.tv_nsec);

    return 0;
}

mrmgxxxx avatar Nov 13 '23 06:11 mrmgxxxx

faketime version:

Version 0.9.10

mrmgxxxx avatar Nov 13 '23 06:11 mrmgxxxx

Is there any way not to change the tick time?

mrmgxxxx avatar Nov 13 '23 06:11 mrmgxxxx