Skip to content

Commit 05e480f

Browse files
authored
Merge pull request #9644 from philljj/bsdkm_time
bsdkm: sys time wrapper.
2 parents 48cb84d + 268fc98 commit 05e480f

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

bsdkm/bsdkm_wc_port.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@
4040
#define NO_THREAD_LS
4141
#define NO_ATTRIBUTE_CONSTRUCTOR
4242

43+
/* <time.h> and TIME(3) are userspace only in FreeBSD.
44+
* Use a small wrapper around <sys/time.h> time_second instead. */
45+
#include <sys/time.h>
46+
static inline time_t wolfkmod_time(time_t * tloc) {
47+
time_t _now = time_second;
48+
if (tloc) {
49+
*tloc = _now;
50+
}
51+
return _now;
52+
}
53+
#define XTIME wolfkmod_time
54+
4355
/* needed to prevent wolfcrypt/src/asn.c version shadowing
4456
* extern global version from /usr/src/sys/sys/systm.h */
4557
#define version wc_version
@@ -101,7 +113,6 @@ extern struct malloc_type M_WOLFSSL[1];
101113
#define wc_FreeMutex FreeMutex
102114
#define wc_LockMutex LockMutex
103115
#define wc_UnLockMutex UnLockMutex
104-
#define NO_THREAD_LS
105116
#endif /* HAVE_FIPS */
106117

107118
typedef struct wolfSSL_Mutex {

0 commit comments

Comments
 (0)