From: Richard Levitte Date: Mon, 18 Nov 2002 23:06:46 +0000 (+0000) Subject: Determine HZ exactly as in apps/speed.c. X-Git-Tag: OpenSSL_0_9_7-beta4~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=412fd4708d84e9a572eba53fc37fe4f907a6f5bd;p=oweals%2Fopenssl.git Determine HZ exactly as in apps/speed.c. --- diff --git a/crypto/tmdiff.c b/crypto/tmdiff.c index e1a0e17ac0..307523ebba 100644 --- a/crypto/tmdiff.c +++ b/crypto/tmdiff.c @@ -59,6 +59,9 @@ #include #include "cryptlib.h" #include +#if !defined(OPENSSL_SYS_MSDOS) +#include OPENSSL_UNISTD +#endif #ifdef TIMEB #undef OPENSSL_SYS_WIN32 @@ -101,14 +104,19 @@ /* The following if from times(3) man page. It may need to be changed */ #ifndef HZ -# ifndef CLK_TCK -# ifndef _BSD_CLK_TCK_ /* FreeBSD hack */ -# define HZ 100.0 -# else /* _BSD_CLK_TCK_ */ -# define HZ ((double)_BSD_CLK_TCK_) +# if defined(_SC_CLK_TCK) \ + && (!defined(OPENSSL_SYS_VMS) || __CTRL_VER >= 70000000) +# define HZ ((double)sysconf(_SC_CLK_TCK)) +# else +# ifndef CLK_TCK +# ifndef _BSD_CLK_TCK_ /* FreeBSD hack */ +# define HZ 100.0 +# else /* _BSD_CLK_TCK_ */ +# define HZ ((double)_BSD_CLK_TCK_) +# endif +# else /* CLK_TCK */ +# define HZ ((double)CLK_TCK) # endif -# else /* CLK_TCK */ -# define HZ ((double)CLK_TCK) # endif #endif