RFC 3161 compliant time stamp request creation, response generation
[openssl.git] / apps / apps.c
index 4468e50494749f94cca37754923df40408cb627f..be710a6adb1d76aea98c3977846fec672a9f85aa 100644 (file)
  *
  */
 
+#define _POSIX_C_SOURCE 2      /* On VMS, you need to define this to get
+                                  the declaration of fileno().  The value
+                                  2 is to make sure no function defined
+                                  in POSIX-2 is left undefined. */
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -2418,12 +2422,34 @@ double app_tminterval(int stop,int usertime)
                tmstop.u.LowPart   = now.dwLowDateTime;
                tmstop.u.HighPart  = now.dwHighDateTime;
 
-               ret = (tmstop.QuadPart - tmstart.QuadPart)*1e-7;
+               ret = (__int64)(tmstop.QuadPart - tmstart.QuadPart)*1e-7;
                }
 
        return (ret);
        }
 
+#elif defined(OPENSSL_SYSTEM_NETWARE)
+#include <time.h>
+
+double app_tminterval(int stop,int usertime)
+       {
+       double          ret=0;
+       static clock_t  tmstart;
+       static int      warning=1;
+
+       if (usertime && warning)
+               {
+               BIO_printf(bio_err,"To get meaningful results, run "
+                                  "this program on idle system.\n");
+               warning=0;
+               }
+
+       if (stop==TM_START)     tmstart = clock();
+       else                    ret     = (clock()-tmstart)/(double)CLOCKS_PER_SEC;
+
+       return (ret);
+       }
+
 #elif defined(OPENSSL_SYSTEM_VXWORKS)
 #include <time.h>