mirror of https://github.com/openssl/openssl.git
Revert "Guard use of struct tms with #ifdef __TMS"
The __TMS might be necessary on VMS however there is no such
define on glibc even though the times() function is fully
supported.
Fixes #11903
This reverts commit db71d31547.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/11905)
This commit is contained in:
parent
e919166927
commit
2bd928a1bf
|
|
@ -2270,30 +2270,17 @@ double app_tminterval(int stop, int usertime)
|
||||||
double app_tminterval(int stop, int usertime)
|
double app_tminterval(int stop, int usertime)
|
||||||
{
|
{
|
||||||
double ret = 0;
|
double ret = 0;
|
||||||
clock_t now;
|
|
||||||
static clock_t tmstart;
|
|
||||||
long int tck = sysconf(_SC_CLK_TCK);
|
|
||||||
# ifdef __TMS
|
|
||||||
struct tms rus;
|
struct tms rus;
|
||||||
|
clock_t now = times(&rus);
|
||||||
|
static clock_t tmstart;
|
||||||
|
|
||||||
now = times(&rus);
|
|
||||||
if (usertime)
|
if (usertime)
|
||||||
now = rus.tms_utime;
|
now = rus.tms_utime;
|
||||||
# else
|
|
||||||
if (usertime)
|
|
||||||
now = clock(); /* sum of user and kernel times */
|
|
||||||
else {
|
|
||||||
struct timeval tv;
|
|
||||||
gettimeofday(&tv, NULL);
|
|
||||||
now = (clock_t)((unsigned long long)tv.tv_sec * tck +
|
|
||||||
(unsigned long long)tv.tv_usec * (1000000 / tck)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
|
|
||||||
if (stop == TM_START) {
|
if (stop == TM_START) {
|
||||||
tmstart = now;
|
tmstart = now;
|
||||||
} else {
|
} else {
|
||||||
|
long int tck = sysconf(_SC_CLK_TCK);
|
||||||
ret = (now - tmstart) / (double)tck;
|
ret = (now - tmstart) / (double)tck;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue