Index: agent/protect.c =================================================================== --- agent/protect.c +++ agent/protect.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -104,11 +105,14 @@ &data->creation_time, &data->exit_time, &data->kernel_time, &data->user_time); # endif -#else - struct tms tmp; +#elif defined (CLOCK_THREAD_CPUTIME_ID) + struct timespec tmp; - times (&tmp); - data->ticks = tmp.tms_utime; + clock_gettime (CLOCK_THREAD_CPUTIME_ID, &tmp); + data->ticks = (clock_t)(((unsigned long long)tmp.tv_sec * 1000000000 + + tmp.tv_nsec) * CLOCKS_PER_SEC / 1000000000); +#else + data->ticks = clock (); #endif } @@ -135,7 +139,7 @@ } #else return (unsigned long)((((double) (stoptime.ticks - starttime->ticks)) - /CLOCKS_PER_SEC)*10000000); + /CLOCKS_PER_SEC)*1000); #endif } Index: agent/t-protect.c =================================================================== --- agent/t-protect.c +++ agent/t-protect.c @@ -322,9 +322,9 @@ int main (int argc, char **argv) { - (void)argc; (void)argv; + opt.verbose = argc - 1; /* We can do "./t-protect -v -v" */ gcry_control (GCRYCTL_DISABLE_SECMEM); test_agent_protect ();