Rename ossl_sleep() to OSSL_sleep() and make it public
authorRichard Levitte <levitte@openssl.org>
Mon, 3 Oct 2022 05:10:34 +0000 (07:10 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 6 Oct 2022 06:01:09 +0000 (08:01 +0200)
commit82d28c6b3cbd8074faaa34cc2ce57dacc580792f
treeee3ec2399066e8e508512d4e4c7eb6342f44c3a9
parenta8572674f12ceb39f7e66ccbaa8918b922c76739
Rename ossl_sleep() to OSSL_sleep() and make it public

ossl_sleep() was implemented as a static inline function in internal/e_os.h,
using usleep() on Unix and Sleep() on Windows.  So far well and good.
However, it also has a fallback implementation for systems that do not have
usleep() or Sleep(), and that implementation happens to use ossl_time_now(),
which is a normal function, private to libcrypto, and is judged to be too
complex to sanely make into a static inline function.

This fallback creates a problem, because we do use ossl_sleep() in apps/ and
a few test programs in test/, and when they are linked with libcrypto in
shared library form, ossl_time_now() can't be found, since it's not publicly
exposed.

Something needs to give, and the easiest, and hopefully sanest answer is to
make ossl_sleep() a publicly exposed function, which requires a slight name
change.

Documentation and 'make update' result included.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/19330)
crypto/build.info
crypto/sleep.c [new file with mode: 0644]
doc/build.info
doc/man3/OSSL_sleep.pod [new file with mode: 0644]
include/internal/e_os.h
include/openssl/crypto.h.in
util/libcrypto.num