diff options
author | J.W. Jagersma <jwjagersma@gmail.com> | 2022-09-25 19:04:31 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-09-29 12:04:00 +0200 |
commit | 7adcdb2a5144d826e2e74c019aa80a9d7eb6bcda (patch) | |
tree | 37fee19a7650fdd9375317120cd1bc4bbf4fc751 | |
parent | ed634b1ea4e1826916dee97674fd09b5446139cb (diff) |
djgpp: Use usleep() for ossl_sleep()
This part failed to compile due to a circular dependency between
internal/e_os.h and internal/time.h, when ossl_sleep() falls back to a
busy wait. However, djgpp has a usleep function, so it can use the
regular Unix version of ossl_sleep().
It's not great though. The resolution is only ~55ms, and it may break
when a user program hooks the timer interrupt without periodically
updating BIOS time. A high-resolution alternative is uclock(), but
that is generally less desirable since it reprograms the system timer.
The circular dependency is still there and may still cause trouble for
other platforms.
CLA: trivial
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19274)
(cherry picked from commit 651255941c49a5089dfc011f2abd636433da8b82)
-rw-r--r-- | e_os.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -287,7 +287,7 @@ struct servent *getservbyname(const char *name, const char *proto); /* end vxworks */ /* system-specific variants defining ossl_sleep() */ -#ifdef OPENSSL_SYS_UNIX +#if defined(OPENSSL_SYS_UNIX) || defined(__DJGPP__) # include <unistd.h> static ossl_inline void ossl_sleep(unsigned long millis) { |