summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/apps/speed.c
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2002-07-30 12:44:15 +0000
committernectar <nectar@FreeBSD.org>2002-07-30 12:44:15 +0000
commit0aed2eea83b351d68092e43b5a9496ce3dd5043d (patch)
treea6133c35ab337984fbbd26293f8b1ad7a958132b /crypto/openssl/apps/speed.c
parent1f8c2aa1763b5d8a328b2fd4053396e94ea48d35 (diff)
downloadFreeBSD-src-0aed2eea83b351d68092e43b5a9496ce3dd5043d.zip
FreeBSD-src-0aed2eea83b351d68092e43b5a9496ce3dd5043d.tar.gz
Import of OpenSSL 0.9.6d.
Diffstat (limited to 'crypto/openssl/apps/speed.c')
-rw-r--r--crypto/openssl/apps/speed.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/crypto/openssl/apps/speed.c b/crypto/openssl/apps/speed.c
index 2900470..f73deba 100644
--- a/crypto/openssl/apps/speed.c
+++ b/crypto/openssl/apps/speed.c
@@ -82,12 +82,12 @@
#include <openssl/rand.h>
#include <openssl/err.h>
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(_DARWIN)
# define USE_TOD
-#elif !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
+#elif !defined(MSDOS) && !defined(VXWORKS) && (!defined(VMS) || defined(__DECC))
# define TIMES
#endif
-#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(MPE) && !defined(__NetBSD__)
+#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(MPE) && !defined(__NetBSD__) && !defined(_DARWIN) && !defined(VXWORKS)
# define TIMEB
#endif
@@ -115,7 +115,7 @@
#include <sys/timeb.h>
#endif
-#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD)
+#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) && !defined(VXWORKS)
#error "It seems neither struct tms nor struct timeb is supported in this platform!"
#endif
@@ -224,7 +224,7 @@ static double Time_F(int s, int usertime)
#ifdef USE_TOD
if(usertime)
- {
+ {
static struct rusage tstart,tend;
if (s == START)
@@ -284,7 +284,23 @@ static double Time_F(int s, int usertime)
# if defined(TIMES) && defined(TIMEB)
else
# endif
-# ifdef TIMEB
+# ifdef VXWORKS
+ {
+ static unsigned long tick_start, tick_end;
+
+ if( s == START )
+ {
+ tick_start = tickGet();
+ return 0;
+ }
+ else
+ {
+ tick_end = tickGet();
+ ret = (double)(tick_end - tick_start) / (double)sysClkRateGet();
+ return((ret < 0.001)?0.001:ret);
+ }
+ }
+# elif defined(TIMEB)
{
static struct timeb tstart,tend;
long i;
@@ -303,6 +319,7 @@ static double Time_F(int s, int usertime)
}
}
# endif
+
#endif
}
@@ -318,7 +335,9 @@ int MAIN(int argc, char **argv)
#define DSA_NUM 3
long count,rsa_count;
int i,j,k;
+#ifndef NO_RSA
unsigned rsa_num;
+#endif
#ifndef NO_MD2
unsigned char md2[MD2_DIGEST_LENGTH];
#endif
OpenPOWER on IntegriCloud