The branch stable/13 has been updated by dchagin:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f8da86347070ce4b6c39a8d6ba2df53e49ec4f84

commit f8da86347070ce4b6c39a8d6ba2df53e49ec4f84
Author:     Dmitry Chagin <[email protected]>
AuthorDate: 2022-07-04 20:41:32 +0000
Commit:     Dmitry Chagin <[email protected]>
CommitDate: 2022-07-11 21:28:28 +0000

    linux(4): Implement __vdso_time
    
    PR:             240769
    MFC after:      3 days
    
    (cherry picked from commit 42317e642645b36e711b5dd560d06a303a492e0f)
---
 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

Reply via email to