summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2022-12-05 15:38:03 +0100
committerTomas Mraz <tomas@openssl.org>2022-12-15 12:04:35 +0100
commit47dec02433a95d45fc94c4dc097b3d5e0bb50f00 (patch)
tree7a680d5932c18a4d60697bca6830b8290ade129c
parent0756e7a401665fea55c53d758ce36e06efee7a8a (diff)
timing_load_creds requires POSIX1.2001 due to rusage
Fixes #19838 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/19839) (cherry picked from commit adf289b5b67ecb414ab709a2c25b0c6f0d463d31)
-rw-r--r--test/timing_load_creds.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/test/timing_load_creds.c b/test/timing_load_creds.c
index 3931b274c9..978523c2cd 100644
--- a/test/timing_load_creds.c
+++ b/test/timing_load_creds.c
@@ -20,6 +20,7 @@
# include <openssl/err.h>
# include <openssl/bio.h>
# include "internal/e_os.h"
+# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
# ifndef timersub
/* struct timeval * subtraction; a must be greater than or equal to b */
@@ -90,11 +91,12 @@ static void usage(void)
fprintf(stderr, " p for private key\n");
exit(EXIT_FAILURE);
}
+# endif
#endif
int main(int ac, char **av)
{
-#ifdef OPENSSL_SYS_UNIX
+#if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
int i, debug = 0, count = 100, what = 'c';
struct stat sb;
FILE *fp;
@@ -206,13 +208,8 @@ int main(int ac, char **av)
OPENSSL_free(contents);
return EXIT_SUCCESS;
#else
-# if defined(OPENSSL_SYS_WINDOWS)
- fprintf(stderr, "This tool is not supported on Windows\n");
-# elif defined(OPENSSL_SYS_VMS)
- fprintf(stderr, "This tool is not supported on VMS\n");
-# else
- fprintf(stderr, "This tool is not supported on this platform\n");
-# endif
+ fprintf(stderr,
+ "This tool is not supported on this platform for lack of POSIX1.2001 support\n");
exit(EXIT_FAILURE);
#endif
}