qemu-e2k/tests/tcg/x86_64/vsyscall.c
Ilya Leoshkevich f66487756b tests/tcg/x86_64: add vsyscall smoke test
Having a small test will prevent trivial regressions in the future.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20210519045738.1335210-3-iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2021-05-20 14:19:30 +02:00

13 lines
249 B
C

#include <stdio.h>
#include <time.h>
#define VSYSCALL_PAGE 0xffffffffff600000
#define TIME_OFFSET 0x400
typedef time_t (*time_func)(time_t *);
int main(void)
{
printf("%ld\n", ((time_func)(VSYSCALL_PAGE + TIME_OFFSET))(NULL));
return 0;
}