]>
git.saurik.com Git - apple/xnu.git/blob - tests/remote_time.c
1 #include <darwintest.h>
2 #include <System/kern/remote_time.h>
3 #include <mach/mach_time.h>
5 #include <sys/sysctl.h>
6 #include <TargetConditionals.h>
7 extern uint64_t __mach_bridge_remote_time(uint64_t);
9 T_DECL(remote_time_syscall
, "test mach_bridge_remote_time syscall",
10 T_META_CHECK_LEAKS(false))
13 uint64_t local_time
= mach_absolute_time();
14 uint64_t remote_time1
= mach_bridge_remote_time(local_time
);
15 uint64_t remote_time2
= __mach_bridge_remote_time(local_time
);
16 T_LOG("local_time = %llu, remote_time1 = %llu, remote_time2 = %llu",
17 local_time
, remote_time1
, remote_time2
);
18 T_ASSERT_EQ(remote_time1
, remote_time2
, "syscall works");
20 T_SKIP("Skipping test");
21 #endif /* TARGET_OS_BRIDGE */