git: c85cf4929417 - stable/13 - loader: userboot: provide a getsecs() implementation

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Thu, 21 Apr 2022 22:38:19 UTC
The branch stable/13 has been updated by kevans:

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

commit c85cf4929417ce6e11a84d1dfed13654b14c6ae7
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2022-04-13 00:29:54 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2022-04-21 22:35:01 +0000

    loader: userboot: provide a getsecs() implementation
    
    We don't need it for userboot, but it avoids issues with BIND_NOW, so
    just provide it.  time(3) isn't defined but ends up being provided by
    libc linked into the host process, which is generally fine.
    
    PR:     262920
    Reviewed by:    imp, jhb
    
    (cherry picked from commit 660c1892d5c90500d37f98185326c6287b2b61be)
---
 stand/userboot/userboot/main.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/stand/userboot/userboot/main.c b/stand/userboot/userboot/main.c
index 48c4e388b828..07630945cf80 100644
--- a/stand/userboot/userboot/main.c
+++ b/stand/userboot/userboot/main.c
@@ -70,6 +70,18 @@ delay(int usec)
 	CALLBACK(delay, usec);
 }
 
+time_t
+getsecs(void)
+{
+
+	/*
+	 * userboot can't do netboot, so this implementation isn't strictly
+	 * required.  Defining it avoids issues with BIND_NOW, and it doesn't
+	 * hurt to do it.
+	 */
+	return (time(NULL));
+}
+
 void
 exit(int v)
 {