mirror of
https://github.com/wolfcw/libfaketime.git
synced 2026-05-17 08:36:28 +03:00
@@ -5,3 +5,4 @@
|
||||
#include <sys/syscall.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
|
||||
8
test/snippets/syscall_clock_gettime.c
Normal file
8
test/snippets/syscall_clock_gettime.c
Normal file
@@ -0,0 +1,8 @@
|
||||
struct timespec ts;
|
||||
clockid_t ckid = CLOCK_REALTIME;
|
||||
long ret = syscall(__NR_clock_gettime, ckid, &ts);
|
||||
if (ret == 0)
|
||||
printf("[%s] syscall(__NR_gettime, CLOCK_REALTIME[%d], &ts) -> {%lld, %ld}\n", where, ckid, (long long)ts.tv_sec, ts.tv_nsec);
|
||||
else
|
||||
printf("[%s] syscall(__NR_gettime, CLOCK_REALTIME[%d], &ts) returned non-zero (%ld)\n", where, ckid, ret);
|
||||
|
||||
1
test/snippets/syscall_clock_gettime.variable
Normal file
1
test/snippets/syscall_clock_gettime.variable
Normal file
@@ -0,0 +1 @@
|
||||
FAKETIME 2020-01-01 00:00:00
|
||||
Reference in New Issue
Block a user