From 42317e642645b36e711b5dd560d06a303a492e0f Mon Sep 17 00:00:00 2001 From: Dmitry Chagin Date: Mon, 4 Jul 2022 23:41:32 +0300 Subject: [PATCH] linux(4): Implement __vdso_time PR: 240769 MFC after: 3 days --- sys/compat/linux/linux_vdso_gtod.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_vdso_gtod.inc b/sys/compat/linux/linux_vdso_gtod.inc index f101fe81f7f8..8a3840edd87d 100644 --- a/sys/compat/linux/linux_vdso_gtod.inc +++ b/sys/compat/linux/linux_vdso_gtod.inc @@ -372,7 +372,14 @@ __vdso_getcpu(uint32_t *cpu, uint32_t *node, void *cache) int __vdso_time(long *tm) { + struct timeval tv; + int error; - return (__vdso_time_fallback(tm)); + error = freebsd_gettimeofday(&tv, NULL); + if (error != 0) + return (__vdso_time_fallback(tm)); + if (tm != NULL) + *tm = tv.tv_sec; + return (tv.tv_sec); } #endif