From 609c7e86794158f847023679841b17bb3f7b8325 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 22 May 2024 12:01:15 +0200 Subject: CrtLibSupport: add sleep() Will be needed by openssl-3.2.x Signed-off-by: Gerd Hoffmann --- CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c | 8 ++++++++ CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c | 10 ++++++++++ .../Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c | 8 ++++++++ CryptoPkg/Library/Include/CrtLibSupport.h | 6 ++++++ 4 files changed, 32 insertions(+) (limited to 'CryptoPkg') diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c b/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c index 2956b92d08..4f23de2830 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c @@ -42,3 +42,11 @@ gmtime ( { return NULL; } + +unsigned int +sleep ( + unsigned int seconds + ) +{ + return 0; +} diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c index 2dfc6fe6c5..30c93a45ea 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c @@ -9,6 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include +#include #include // @@ -195,3 +196,12 @@ gmtime ( return GmTime; } + +unsigned int +sleep ( + unsigned int seconds + ) +{ + gBS->Stall (seconds * 1000 * 1000); + return 0; +} diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c index 244e57437e..1ec7fa37cd 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c @@ -104,4 +104,12 @@ getegid ( return 0; } +unsigned int +sleep ( + unsigned int seconds + ) +{ + return 0; +} + int errno = 0; diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h index afc00956ab..a9171fba36 100644 --- a/CryptoPkg/Library/Include/CrtLibSupport.h +++ b/CryptoPkg/Library/Include/CrtLibSupport.h @@ -16,6 +16,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include #define OPENSSLDIR "" #define ENGINESDIR "" @@ -334,6 +335,11 @@ gmtime ( const time_t * ); +unsigned int +sleep ( + unsigned int seconds + ); + uid_t getuid ( void -- cgit v1.2.3